| From: | Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> |
|---|---|
| To: | jonathan(dot)katz(at)excoventures(dot)com |
| Cc: | Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp, tgl(at)sss(dot)pgh(dot)pa(dot)us, david(dot)rowley(at)2ndquadrant(dot)com, robertmhaas(at)gmail(dot)com, peter(dot)eisentraut(at)2ndquadrant(dot)com, sfrost(at)snowman(dot)net, hornschnorter(at)gmail(dot)com, dilipbalaut(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: Boolean partitions syntax |
| Date: | 2018-04-12 04:12:27 |
| Message-ID: | 20180412.131227.36134095.horiguchi.kyotaro@lab.ntt.co.jp |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hello.
At Wed, 11 Apr 2018 09:43:37 -0400, "Jonathan S. Katz" <jonathan(dot)katz(at)excoventures(dot)com> wrote in <EFEBA03D-EFFC-46E2-A0F7-41D00487066B(at)excoventures(dot)com>
> case EXPR_KIND_PARTITION_BOUNDS:
> ^~~~~~~~~~~~~~~~~~~~~~~~~~
..
> 2 errors generated.
>
> The attached patch fixes the error.
Sorry for the silly mistake.
> I ran the following cases:
>
> Case #1: My Original Test Case
>
> CREATE TABLE records (
> id int GENERATED BY DEFAULT AS IDENTITY NOT NULL,
> record_date date NOT NULL,
> record_text text,
> archived bool NOT NULL DEFAULT FALSE
> ) PARTITION BY LIST(archived);
>
> CREATE TABLE records_archive
> PARTITION OF records
> FOR VALUES IN (TRUE);
>
> CREATE TABLE records_active
> PARTITION OF records
> FOR VALUES IN (FALSE);
>
> Everything created like a charm.
>
> Case #2: random()
>
> CREATE TABLE oddity (
> id int GENERATED BY DEFAULT AS IDENTITY NOT NULL,
> random_filter int
> ) PARTITION BY LIST(random_filter);
>
> CREATE TABLE oddity_random
> PARTITION OF oddity
> FOR VALUES IN ((random() * 100)::int);
>
> I did a \d+ on oddity and:
>
> partitions=# \d+ oddity
> (truncated)
> Partition key: LIST (random_filter)
> Partitions: oddity_random FOR VALUES IN (19)
>
> So this appears to behave as described above.
>
> Attached is the patch with the fix for the build. This is the first time I’m attaching
> a patch for the core server, so apologizes if I missed up the formatting.
Thank you for verification and the revised patch. The format is
fine and the fix is correct but I noticed that I forgot to remove
plural S's from error messages. The attached is the version with
the fix.
regards,
--
Kyotaro Horiguchi
NTT Open Source Software Center
| Attachment | Content-Type | Size |
|---|---|---|
| any_expression_as_partbound_v5.patch | text/x-patch | 21.1 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David Rowley | 2018-04-12 04:40:12 | Re: [HACKERS] Runtime Partition Pruning |
| Previous Message | Amit Langote | 2018-04-12 02:21:07 | Re: relispartition for index partitions |