From 321421de15be0a09ae5cd71317d0deeb50173c9b Mon Sep 17 00:00:00 2001 From: "Chao Li (Evan)" Date: Mon, 25 May 2026 16:59:21 +0800 Subject: [PATCH v1] doc: Clarify ALTER CONSTRAINT enforceability behavior The ALTER TABLE documentation said that FOREIGN KEY and CHECK constraints may be altered, but did not distinguish between deferrability and enforceability attributes. Clarify that deferrability attributes can currently be altered only for FOREIGN KEY constraints, while enforceability can be altered for both FOREIGN KEY and CHECK constraints. Also document that setting a constraint to ENFORCED verifies existing rows and resumes checking new or updated rows. Author: Chao Li --- doc/src/sgml/ref/alter_table.sgml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index dec34337d1a..af247d82902 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -586,8 +586,18 @@ WITH ( MODULUS numeric_literal, REM This form alters the attributes of a constraint that was previously - created. Currently FOREIGN KEY and CHECK - constraints may be altered in this fashion, but see below. + created. Currently, the deferrability attributes can be altered only + for FOREIGN KEY constraints. The enforceability + attribute can be altered for FOREIGN KEY and + CHECK constraints. + + + + Setting a constraint to NOT ENFORCED causes the + database system to stop checking it for new or updated rows. Setting + a constraint to ENFORCED causes the database system + to verify that existing rows satisfy the constraint and to check it + for new or updated rows. -- 2.50.1 (Apple Git-155)