pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix handling of partition bounds for boolean partitioning column
Date: Mon, 23 Apr 2018 19:29:25 +0000
Message-ID: <E1fAh9R-0000d5-Fx@gemulon.postgresql.org> (raw)

Fix handling of partition bounds for boolean partitioning columns.

Previously, you could partition by a boolean column as long as you
spelled the bound values as string literals, for instance FOR VALUES
IN ('t').  The trouble with this is that ruleutils.c printed that as
FOR VALUES IN (TRUE), which is reasonable syntax but wasn't accepted by
the grammar.  That results in dump-and-reload failures for such cases.

Apply a minimal fix that just causes TRUE and FALSE to be converted to
strings 'true' and 'false'.  This is pretty grotty, but it's too late for
a more principled fix in v11 (to say nothing of v10).  We should revisit
the whole issue of how partition bound values are parsed for v12.

Amit Langote

Discussion: https://postgr.es/m/e05c5162-1103-7e37-d1ab-6de3e0afaf70@lab.ntt.co.jp

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4df58f7ed7f9ddc5a3196fcbad35690d1b3218de

Modified Files
--------------
doc/src/sgml/ref/alter_table.sgml          |  6 +++---
doc/src/sgml/ref/create_table.sgml         |  6 +++---
src/backend/parser/gram.y                  |  2 ++
src/test/regress/expected/create_table.out | 14 ++++++++++++++
src/test/regress/sql/create_table.sql      |  7 +++++++
5 files changed, 29 insertions(+), 6 deletions(-)



view thread (2+ messages)

Message-ID: <E1fAh9R-0000d5-Fx@gemulon.postgresql.org>
Permalink:  ../E1fAh9R-0000d5-Fx@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1fAh9R-0000d5-Fx@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix handling of partition bounds for boolean partitioning column
  In-Reply-To: <E1fAh9R-0000d5-Fx@gemulon.postgresql.org>
  References: <E1fAh9R-0000d5-Fx@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox