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: Teach predtest.c about CHECK clauses to fix partitioning bugs.
Date: Wed, 14 Jun 2017 17:13:30 +0000
Message-ID: <E1dLBrG-000290-7p@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Teach predtest.c about CHECK clauses to fix partitioning bugs.

In a CHECK clause, a null result means true, whereas in a WHERE clause
it means false.  predtest.c provided different functions depending on
which set of semantics applied to the predicate being proved, but had
no option to control what a null meant in the clauses provided as
axioms.  Add one.

Use that in the partitioning code when figuring out whether the
validation scan on a new partition can be skipped.  Rip out the
old logic that attempted (not very successfully) to compensate
for the absence of the necessary support in predtest.c.

Ashutosh Bapat and Robert Haas, reviewed by Amit Langote and
incorporating feedback from Tom Lane.

Discussion: http://postgr.es/m/CAFjFpReT_kq_uwU_B8aWDxR7jNGE=P0iELycdq5oupi=xSQTOw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b08df9cab777427fdafe633ca7b8abf29817aa55

Modified Files
--------------
src/backend/commands/tablecmds.c          |  60 +-----------
src/backend/optimizer/path/indxpath.c     |  11 ++-
src/backend/optimizer/plan/createplan.c   |   7 +-
src/backend/optimizer/util/plancat.c      |   6 +-
src/backend/optimizer/util/predtest.c     | 152 +++++++++++++++++++-----------
src/backend/utils/adt/selfuncs.c          |   4 +-
src/include/optimizer/predtest.h          |   8 +-
src/test/regress/expected/alter_table.out |   6 ++
src/test/regress/sql/alter_table.sql      |   7 +-
9 files changed, 129 insertions(+), 132 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1dLBrG-000290-7p@gemulon.postgresql.org>
Permalink:  ../E1dLBrG-000290-7p@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1dLBrG-000290-7p@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: Teach predtest.c about CHECK clauses to fix partitioning bugs.
  In-Reply-To: <E1dLBrG-000290-7p@gemulon.postgresql.org>
  References: <E1dLBrG-000290-7p@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