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.
I applied the new version of the patch and ran through the above scenarios
again. Everything behaved as expected from a user standpoint.