aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/mcxtfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-08-22 12:34:17 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2020-08-22 12:34:17 -0400
commit5b02d68e758307e0ae8fae4d7bbcd687f1dd6ce1 (patch)
treeedcad8a2fcc4a4f87c6089f2ae6ea5c42ba805a2 /src/backend/utils/adt/mcxtfuncs.c
parentc3a288649e152612791121fa6d17a1322b8f2814 (diff)
downloadpostgresql-5b02d68e758307e0ae8fae4d7bbcd687f1dd6ce1.tar.gz
postgresql-5b02d68e758307e0ae8fae4d7bbcd687f1dd6ce1.zip
Fix ALTER TABLE's scheduling rules for AT_AddConstraint subcommands.
Commit 1281a5c90 rearranged the logic in this area rather drastically, and it broke the case of adding a foreign key constraint in the same ALTER that adds the pkey or unique constraint it depends on. While self-referential fkeys are surely a pretty niche case, this used to work so we shouldn't break it. To fix, reorganize the scheduling rules in ATParseTransformCmd so that a transformed AT_AddConstraint subcommand will be delayed into a later pass in all cases, not only when it's been spit out as a side-effect of parsing some other command type. Also tweak the logic so that we won't run ATParseTransformCmd twice while doing this. It seems to work even without that, but it's surely wasting cycles to do so. Per bug #16589 from Jeremy Evans. Back-patch to v13 where the new code was introduced. Discussion: https://postgr.es/m/16589-31c8d981ca503896@postgresql.org
Diffstat (limited to 'src/backend/utils/adt/mcxtfuncs.c')
0 files changed, 0 insertions, 0 deletions