mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Clarify a foreign key error message
Clarify the message about type mismatch in foreign key definition to indicate which column the referencing and which is the referenced one. Reported-by: Jian He <jian.universality@gmail.com> Discussion: https://www.postgresql.org/message-id/CACJufxEL82ao-aXOa=d_-Xip0bix-qdSyNc9fcWxOdkEZFko8w@mail.gmail.com
This commit is contained in:
@ -9961,7 +9961,7 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel,
|
||||
(errcode(ERRCODE_DATATYPE_MISMATCH),
|
||||
errmsg("foreign key constraint \"%s\" cannot be implemented",
|
||||
fkconstraint->conname),
|
||||
errdetail("Key columns \"%s\" and \"%s\" "
|
||||
errdetail("Key columns \"%s\" of the referencing table and \"%s\" of the referenced table "
|
||||
"are of incompatible types: %s and %s.",
|
||||
strVal(list_nth(fkconstraint->fk_attrs, i)),
|
||||
strVal(list_nth(fkconstraint->pk_attrs, i)),
|
||||
|
Reference in New Issue
Block a user