pgsql: Fix logical errors in constraint exclusion: we cannot assume that

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Fix logical errors in constraint exclusion: we cannot assume that
Дата
Msg-id 20080112001145.3E713754108@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Fix logical errors in constraint exclusion: we cannot assume that a CHECK
constraint yields TRUE for every row of its table, only that it does not
yield FALSE (a NULL result isn't disallowed).  This breaks a couple of
implications that would be true in two-valued logic.  I had put in one such
mistake in an 8.2.5 patch: foo IS NULL doesn't refute a strict operator
on foo.  But there was another in the original 8.2 release: NOT foo doesn't
refute an expression whose truth would imply the truth of foo.
Per report from Rajesh Kumar Mallah.

To preserve the ability to do constraint exclusion with one partition
holding NULL values, extend relation_excluded_by_constraints() to check
for attnotnull flags, and add col IS NOT NULL expressions to the set of
constraints we hope to refute.

Tags:
----
REL8_2_STABLE

Modified Files:
--------------
    pgsql/src/backend/optimizer/util:
        plancat.c (r1.127 -> r1.127.2.1)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/plancat.c?r1=1.127&r2=1.127.2.1)
        predtest.c (r1.10.2.2 -> r1.10.2.3)

(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/predtest.c?r1=1.10.2.2&r2=1.10.2.3)

В списке pgsql-committers по дате отправления:

Предыдущее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Fix logical errors in constraint exclusion: we cannot assume that
Следующее
От: neilc@postgresql.org (Neil Conway)
Дата:
Сообщение: pgsql: Minor perf tweak for _SPI_strdup(): if we're going to call