pgsql: Fix PG 17 [NOT] NULL optimization bug for domains - Mailing list pgsql-committers

From Bruce Momjian
Subject pgsql: Fix PG 17 [NOT] NULL optimization bug for domains
Date
Msg-id E1u1xqp-003DV0-1d@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix PG 17 [NOT] NULL optimization bug for domains

A PG 17 optimization allowed columns with NOT NULL constraints to skip
table scans for IS NULL queries, and to skip IS NOT NULL checks for IS
NOT NULL queries.  This didn't work for domain types, since domain types
don't follow the IS NULL/IS NOT NULL constraint logic.  To fix, disable
this optimization for domains for PG 17+.

Reported-by: Jan Behrens

Diagnosed-by: Tom Lane

Discussion: https://postgr.es/m/Z37p0paENWWUarj-@momjian.us

Backpatch-through: 17

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/46b4ba533cee9f64a60714d91607e74362abf67f

Modified Files
--------------
doc/src/sgml/ref/create_domain.sgml    |  3 ++-
src/backend/optimizer/plan/initsplan.c | 14 ++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Flush the IO statistics of active WAL senders more frequently
Next
From: Amit Kapila
Date:
Subject: pgsql: Stabilize 035_standby_logical_decoding.pl.