aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeFunctionscan.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2020-02-07 18:27:18 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2020-02-07 18:27:18 -0300
commit55173d2e663fbe32430665ce7bd65a47856dc237 (patch)
tree96275566cdbb2595a528853e89f686009730e9ac /src/backend/executor/nodeFunctionscan.c
parent9710d3d4a87f428a10f63015a0d75ccf028dd137 (diff)
downloadpostgresql-55173d2e663fbe32430665ce7bd65a47856dc237.tar.gz
postgresql-55173d2e663fbe32430665ce7bd65a47856dc237.zip
Fix failure to create FKs correctly in partitions
On a multi-level partioned table, when adding a partition not directly connected to the root table, foreign key constraints referencing the root were not cloned to the new partition, leading to the FK being possibly inadvertently violated later on. This was caused by fuzzy thinking in CloneFkReferenced (commit f56f8f8da6af): it was skipping constraints marked as having parents on the theory that cloning those would create duplicates; but that's only correct for the top level of the partitioning hierarchy. For levels below that one, such constraints must still be considered and only skipped if later on we see that we'd create duplicates. Apparently, I (Álvaro) wrote the comments right but the code implemented something slightly different. Author: Jehan-Guillaume de Rorthais Discussion: https://postgr.es/m/20200206004948.238352db@firost
Diffstat (limited to 'src/backend/executor/nodeFunctionscan.c')
0 files changed, 0 insertions, 0 deletions