Refactor duplicate code into DeconstructFkConstraintRow
Alvaro Herrera <alvherre@alvh.no-ip.org>
Refactor duplicate code into DeconstructFkConstraintRow My commit 3de241dba86f introduced some code (in tablecmds.c) to obtain data from a pg_constraint row for a foreign key, that already existed in ri_triggers.c. Split it out into its own routine in pg_constraint.c, where it naturally belongs. No functional code changes, only code movement. Backpatch to pg11, because a future bugfix is simpler after this.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/pg_constraint.c | modified | +109 −90 |
| src/backend/utils/adt/ri_triggers.c | modified | +7 −82 |
| src/backend/utils/cache/relcache.c | modified | +5 −56 |
| src/include/catalog/pg_constraint.h | modified | +3 −0 |