pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix list partition constraints for partition keys of array type.
Date: Wed, 31 Jan 2018 21:08:52 +0000
Message-ID: <E1egzci-0004sh-99@gemulon.postgresql.org> (raw)

Fix list partition constraints for partition keys of array type.

The old code generated always generated a constraint of the form
col = ANY(ARRAY[val1, val2, ...]), but that's invalid when col is an
array type.  Instead, generate col = val when there's only one value,
col = val1 OR col = val2 OR ... when there are multiple values and
col is of array type, and the old form when there are multiple values
and col is not of an array type.

As a side benefit, this makes constraint exclusion able to prune
a list partition declared to accept a single Boolean value, which
didn't work before.

Amit Langote, reviewed by Etsuro Fujita

Discussion: http://postgr.es/m/97267195-e235-89d1-a41a-c110198dfce9@lab.ntt.co.jp

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3ccdc6f9a5876d0953912fd589989387764ed9a3

Modified Files
--------------
src/backend/catalog/partition.c               | 98 ++++++++++++++++++---------
src/test/regress/expected/create_table.out    | 18 ++++-
src/test/regress/expected/foreign_data.out    |  6 +-
src/test/regress/expected/partition_prune.out |  8 +--
src/test/regress/sql/create_table.sql         |  6 ++
5 files changed, 93 insertions(+), 43 deletions(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1egzci-0004sh-99@gemulon.postgresql.org>
Permalink:  ../E1egzci-0004sh-99@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1egzci-0004sh-99@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: rhaas@postgresql.org
  Subject: Re: pgsql: Fix list partition constraints for partition keys of array type.
  In-Reply-To: <E1egzci-0004sh-99@gemulon.postgresql.org>
  References: <E1egzci-0004sh-99@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