Boolean partitions syntax

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Boolean partitions syntax
Date: 2017-12-12 01:49:09
Message-ID: e05c5162-1103-7e37-d1ab-6de3e0afaf70@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi.

Horiguchi-san pointed out [1] on a nearby thread that the partitioning
syntax (the FOR VALUES clause) doesn't accept true and false as valid
partition bound datums, which seems to me like an oversight. Attached a
patch to fix that.

create table bools (a bool) partition by list (a);

Before patch:

create table bools_t partition of bools for values in (true);
ERROR: syntax error at or near "true"
LINE 1: ...reate table bools_t partition of bools for values in (true);

After:

create table bools_t partition of bools for values in (true);
CREATE TABLE
\d bools_t
Table "public.bools_t"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+---------
a | boolean | | |
Partition of: bools FOR VALUES IN (true)

Thanks,
Amit

[1]
https://www.postgresql.org/message-id/20171128.203915.26713586.horiguchi.kyotaro%40lab.ntt.co.jp

Attachment Content-Type Size
0001-Allow-Boolean-values-in-partition-FOR-VALUES-clause.patch text/plain 5.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2017-12-12 01:55:52 Re: Testing Extension Upgrade Paths
Previous Message Masahiko Sawada 2017-12-12 00:40:56 Re: User defined data types in Logical Replication