diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-02-25 20:59:53 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-02-25 20:59:53 +0000 |
commit | 99419d36f2214458cc1f495b80be36da95291596 (patch) | |
tree | b10e6452bae9dd8dd51ce49e5ef882e590b27d25 /src/backend/access/gist/gistproc.c | |
parent | 1951c97805d52e56b3fbdb2618fcde56d11a79f4 (diff) | |
download | postgresql-99419d36f2214458cc1f495b80be36da95291596.tar.gz |
Allow predicate_refuted_by() to deduce that NOT A refutes A.
We had originally made the stronger assumption that NOT A refutes any B
if B implies A, but this fails in three-valued logic, because we need to
prove B is false not just that it's not true. However the logic does
go through if B is equal to A.
Recognizing this limited case is enough to handle examples that arise when
we have simplified "bool_var = true" or "bool_var = false" to just "bool_var"
or "NOT bool_var". If we had not done that simplification then the
btree-operator proof logic would have been able to prove that the expressions
were contradictory, but only for identical expressions being compared to the
constants; so handling identical A and B covers all the same cases.
The motivation for doing this is to avoid unexpected asymmetrical behavior
when a partitioned table uses a boolean partitioning column, as in today's
gripe from Dominik Sander.
Back-patch to 8.2, which is as far back as predicate_refuted_by attempts to
do anything at all with NOTs.
Diffstat (limited to 'src/backend/access/gist/gistproc.c')
0 files changed, 0 insertions, 0 deletions