Re: unsupportable composite type partition keys

Поиск
Список
Период
Сортировка
От Amit Langote
Тема Re: unsupportable composite type partition keys
Дата
Msg-id CA+HiwqENLY2ta0goA0jcfk4cWdj2W0r6Ywjf=PQiMpJkyXygmg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: unsupportable composite type partition keys  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: unsupportable composite type partition keys  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Wed, Dec 18, 2019 at 10:38 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Amit Langote <amitlangote09@gmail.com> writes:
> > On Wed, Dec 18, 2019 at 2:12 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >> Hm.  Seems like the restrictions here ought to be just about the same
> >> as on index columns, no?
>
> > We also need to disallow self-referencing composite type in the case
> > of partitioning, because otherwise it leads to infinite recursion
> > shown in my first email.
>
> My point is basically that CheckAttributeType already covers that
> issue, as well as a lot of others.  So why isn't the partitioning
> code using it?

My reason to not use it was that the error message that are produced
are not quite helpful in this case; compare what my patch produces vs.
what one gets with CheckAttributeType("expr", ...):

    a int,
    b int
 ) PARTITION BY RANGE (((a, b)));
-ERROR:  partition key cannot be of anonymous or self-referencing composite type
-LINE 4: ) PARTITION BY RANGE (((a, b)));
-                              ^
+ERROR:  column "expr" has pseudo-type record

 CREATE TABLE partitioned (
    a int,
    b int
 ) PARTITION BY RANGE ((row(a, b)));
-ERROR:  partition key cannot be of anonymous or self-referencing composite type
-LINE 4: ) PARTITION BY RANGE ((row(a, b)));
-                              ^
+ERROR:  column "expr" has pseudo-type record

 CREATE TABLE partitioned (
    a int,
    b int
 ) PARTITION BY RANGE ((row(a, b)::partitioned));
-ERROR:  partition key cannot be of anonymous or self-referencing composite type
-LINE 4: ) PARTITION BY RANGE ((row(a, b)::partitioned));
-                              ^
+ERROR:  composite type partitioned cannot be made a member of itself

Thanks,
Amit



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: Clean up some old cruft related to Windows
Следующее
От: Masahiko Sawada
Дата:
Сообщение: Re: [HACKERS] Block level parallel vacuum