pgsql: Add null test to partition constraint for default range partitio

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add null test to partition constraint for default range partitio
Date: 2017-11-28 15:51:06
Message-ID: E1eJiA6-0001uy-GA@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add null test to partition constraint for default range partitions.

Non-default range partitions have a constraint which include null
tests, and both default and non-default list partitions also have a
constraint which includes null tests, but for some reason this was
missed for default range partitions. This could cause the partition
constraint to evaluate to false for rows that were (correctly) routed
to that partition by insert tuple routing, which could in turn
cause constraint exclusion to prune the default partition in cases
where it should not.

Amit Langote, reviewed by Kyotaro Horiguchi

Discussion: http://postgr.es/m/ba7aaeb1-4399-220e-70b4-62eade1522d0@lab.ntt.co.jp

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7b88d63a9122646ead60c1afffc248a31d4e457d

Modified Files
--------------
src/backend/catalog/partition.c | 29 ++++++++++++++++++++-----
src/test/regress/expected/inherit.out | 41 +++++++++++++++++++++++------------
src/test/regress/expected/update.out | 2 +-
src/test/regress/sql/inherit.sql | 9 ++++----
4 files changed, 56 insertions(+), 25 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2017-11-28 16:31:18 pgsql: PL/Python: Fix potential NULL pointer dereference
Previous Message Robert Haas 2017-11-28 13:22:40 pgsql: Fix typo.