mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-31 14:57:22 +02:00
Restore RI trigger sanity check
I unnecessarily removed this check in 3de241dba8
because I
misunderstood what the final representation of constraints across a
partitioning hierarchy was to be. Put it back (in both branches).
Discussion: https://postgr.es/m/201901222145.t6wws6t6vrcu@alvherre.pgsql
This commit is contained in:
parent
08cf04bb47
commit
04f9b449aa
@ -2320,6 +2320,13 @@ ri_FetchConstraintInfo(Trigger *trigger, Relation trig_rel, bool rel_is_pk)
|
||||
elog(ERROR, "wrong pg_constraint entry for trigger \"%s\" on table \"%s\"",
|
||||
trigger->tgname, RelationGetRelationName(trig_rel));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (riinfo->fk_relid != RelationGetRelid(trig_rel) ||
|
||||
riinfo->pk_relid != trigger->tgconstrrelid)
|
||||
elog(ERROR, "wrong pg_constraint entry for trigger \"%s\" on table \"%s\"",
|
||||
trigger->tgname, RelationGetRelationName(trig_rel));
|
||||
}
|
||||
|
||||
return riinfo;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user