Skip to content

Commit 04f9b44

Browse files
committed
Restore RI trigger sanity check
I unnecessarily removed this check in 3de241d 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
1 parent 08cf04b commit 04f9b44

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/backend/utils/adt/ri_triggers.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,6 +2320,13 @@ ri_FetchConstraintInfo(Trigger *trigger, Relation trig_rel, bool rel_is_pk)
23202320
elog(ERROR, "wrong pg_constraint entry for trigger \"%s\" on table \"%s\"",
23212321
trigger->tgname, RelationGetRelationName(trig_rel));
23222322
}
2323+
else
2324+
{
2325+
if (riinfo->fk_relid != RelationGetRelid(trig_rel) ||
2326+
riinfo->pk_relid != trigger->tgconstrrelid)
2327+
elog(ERROR, "wrong pg_constraint entry for trigger \"%s\" on table \"%s\"",
2328+
trigger->tgname, RelationGetRelationName(trig_rel));
2329+
}
23232330

23242331
return riinfo;
23252332
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy