diff options
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r-- | src/backend/commands/tablecmds.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 32ed9186750..f988c16659d 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -7334,12 +7334,14 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, if (!recurse) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), - errmsg("foreign key referencing partitioned table \"%s\" must not be ONLY", + errmsg("cannot use ONLY for foreign key on partitioned table \"%s\" referencing relation \"%s\"", + RelationGetRelationName(rel), RelationGetRelationName(pkrel)))); if (fkconstraint->skip_validation && !fkconstraint->initially_valid) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), - errmsg("cannot add NOT VALID foreign key to relation \"%s\"", + errmsg("cannot add NOT VALID foreign key on partitioned table \"%s\" referencing relation \"%s\"", + RelationGetRelationName(rel), RelationGetRelationName(pkrel)), errdetail("This feature is not yet supported on partitioned tables."))); } |