diff --git a/doc/src/sgml/release-16.sgml b/doc/src/sgml/release-16.sgml index f90ead3d56e..3a2b60a9279 100644 --- a/doc/src/sgml/release-16.sgml +++ b/doc/src/sgml/release-16.sgml @@ -3091,10 +3091,14 @@ FROM pg_catalog.pg_constraint c WHERE contype = 'f' AND conparentid = 0 AND (SELECT count(*) FROM pg_catalog.pg_constraint c2 WHERE c2.conparentid = c.oid) <> - (SELECT count(*) FROM pg_catalog.pg_inherits i + ((SELECT count(*) FROM pg_catalog.pg_inherits i WHERE (i.inhparent = c.conrelid OR i.inhparent = c.confrelid) AND EXISTS (SELECT 1 FROM pg_catalog.pg_partitioned_table - WHERE partrelid = i.inhparent)); + WHERE partrelid = i.inhparent)) + + CASE WHEN pg_catalog.pg_partition_root(conrelid) = confrelid THEN + (SELECT count(*) FROM pg_catalog.pg_partition_tree(confrelid) + WHERE level = 1) + ELSE 0 END); Since it is possible that one or more of the ADD CONSTRAINT steps will fail, you should save the query's