Message style improvement
authorPeter Eisentraut <[email protected]>
Fri, 8 Nov 2024 06:17:55 +0000 (07:17 +0100)
committerPeter Eisentraut <[email protected]>
Fri, 8 Nov 2024 06:32:14 +0000 (07:32 +0100)
Back the part of edee0c621de that applies to a90bdd7a44d, which
was also backed.  That way, the message is consistent in all
branches.

src/backend/commands/tablecmds.c
src/test/regress/expected/foreign_key.out

index 24c0e82c016387a0993fa9d29afd32bc75a52d32..143711045ef60792fcefee1489451591321f94ec 100644 (file)
@@ -9765,7 +9765,7 @@ CloneFkReferencing(List **wqueue, Relation parentRel, Relation partRel)
        if (fk->confrelid == RelationGetRelid(partRel))
            ereport(ERROR,
                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                    errmsg("can't attach table \"%s\" as a partition which is referenced by foreign key \"%s\"",
+                    errmsg("cannot attach table \"%s\" as a partition because it is referenced by foreign key \"%s\"",
                            RelationGetRelationName(partRel),
                            get_constraint_name(fk->conoid))));
 
index 5eecdf4af2b008d8c7698a46a4360ed3a41190d7..501db7718ce3c166ddd7e742ee22b98062ac30d0 100644 (file)
@@ -1901,7 +1901,7 @@ ALTER TABLE fk_partitioned_fk ATTACH PARTITION fk_partitioned_fk_2
 CREATE TABLE fk_partitioned_pk_6 (a int PRIMARY KEY);
 CREATE TABLE fk_partitioned_fk_6 (a int REFERENCES fk_partitioned_pk_6) PARTITION BY LIST (a);
 ALTER TABLE fk_partitioned_fk_6 ATTACH PARTITION fk_partitioned_pk_6 FOR VALUES IN (1);
-ERROR:  can't attach table "fk_partitioned_pk_6" as a partition which is referenced by foreign key "fk_partitioned_fk_6_a_fkey"
+ERROR:  cannot attach table "fk_partitioned_pk_6" as a partition because it is referenced by foreign key "fk_partitioned_fk_6_a_fkey"
 DROP TABLE fk_partitioned_pk_6, fk_partitioned_fk_6;
 -- This case is similar to above, but the referenced relation is one level
 -- lower in the hierarchy.  This one fails in a different way as the above,