From: | Amit Langote <amitlangote09(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: unsupportable composite type partition keys |
Date: | 2019-12-19 05:15:34 |
Message-ID: | CA+HiwqENLY2ta0goA0jcfk4cWdj2W0r6Ywjf=PQiMpJkyXygmg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, Dec 18, 2019 at 10:38 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Amit Langote <amitlangote09(at)gmail(dot)com> writes:
> > On Wed, Dec 18, 2019 at 2:12 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Masahiko Sawada | 2019-12-19 05:41:05 | Re: [HACKERS] Block level parallel vacuum |
Previous Message | Kyotaro Horiguchi | 2019-12-19 04:46:33 | Re: Clean up some old cruft related to Windows |