ALTER TABLE ... REPLICA IDENTITY USING INDEX verified key columns by reading pg_attribute.attnotnull, but commita379061a22made attnotnull true also for unvalidated (NOT VALID) not-null constraints, which do not prove the column null-free. An index over such a column could thus be marked as replica identity even though the column might contain NULLs, causing apply-side divergence for UPDATE/DELETE on the nullable rows. Fix by additionally requiring convalidated for the underlying constraint, mirroring the fixd9ffc27291applied to ATExecAddIdentity for the analogous identity-column case. Author: Ante Krešić <ante@tigerdata.com> Reviewed-by: Aleksander Alekseev <aleksander@tigerdata.com> Reviewed-by: solai v <solai.cdac@gmail.com> Backpatch-through: 18 Discussion: https://postgr.es/m/CABXQ4dJUibZzN91qvWmsfA7MUDn9YRCNyu3CcukdyokbH1=41Q@mail.gmail.com
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/18/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/18/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.