pgsql: Teach predtest.c that "foo" implies "foo IS NOT NULL".

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Teach predtest.c that "foo" implies "foo IS NOT NULL".
Date: 2015-08-01 18:32:07
Message-ID: E1ZLbZn-0000UE-7c@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Teach predtest.c that "foo" implies "foo IS NOT NULL".

Per complaint from Peter Holzer. It's useful to cover this special case,
since for a boolean variable "foo", earlier parts of the planner will have
reduced variants like "foo = true" to just "foo", and thus we may fail
to recognize the applicability of a partial index with predicate
"foo IS NOT NULL".

Back-patch to 9.5, but not further; given the lack of previous complaints
this doesn't seem like behavior to change in stable branches.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/8dccf030e884ea8c723275a070acf8a8ed1eebe1

Modified Files
--------------
src/backend/optimizer/util/predtest.c | 4 ++++
1 file changed, 4 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2015-08-02 00:58:04 pgsql: Fix some planner issues with degenerate outer join clauses.
Previous Message Tom Lane 2015-07-31 23:26:49 pgsql: Fix an oversight in checking whether a join with LATERAL refs is