Hi. In alter_table.sgml " Adding a CHECK or NOT NULL constraint requires scanning the table to verify that existing rows meet the constraint, but does not require a table rewrite. If a CHECK constraint is added as NOT ENFORCED, no verification will be performed. " The above also applies to FOREIGN KEY constraints, so I made the change, see the attached.
BTW, i notice that "foreign-key" appearance in alter_table.sgml. Is the hyphen (or en-dash) necessary? -- jian https://www.enterprisedb.com/
From 49b9786fd46f378ad4349230b313893887d2a15c Mon Sep 17 00:00:00 2001 From: jian he <[email protected]> Date: Fri, 25 Sep 2026 12:12:40 +0800 Subject: [PATCH v1 1/1] document not enforced foreign key no need verification --- doc/src/sgml/ref/alter_table.sgml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index 0f9d698d170..c8a755f3b6f 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -1498,9 +1498,10 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM </para> <para> - Adding a <literal>CHECK</literal> or <literal>NOT NULL</literal> - constraint requires scanning the table to verify that existing rows meet the - constraint, but does not require a table rewrite. If a <literal>CHECK</literal> + Adding a <literal>CHECK</literal>, <literal>NOT NULL</literal>, or + <literal>FOREIGN KEY</literal> constraint requires scanning the table to + verify that existing rows meet the constraint, but does not require a table + rewrite. If a <literal>CHECK</literal> or <literal>FOREIGN KEY</literal> constraint is added as <literal>NOT ENFORCED</literal>, no verification will be performed. </para> -- 2.34.1
