aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeModifyTable.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2021-05-07 11:46:37 -0400
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2021-05-07 11:46:37 -0400
commitef70b6f8e28dae452d2bdb379204db234c930d26 (patch)
tree8c8a2b46ae237cf818f2a2b9587456acddd5e7dd /src/backend/executor/nodeModifyTable.c
parentf518c3df4eb0acc9ad6cb49f98c56f392b76c9c1 (diff)
downloadpostgresql-ef70b6f8e28dae452d2bdb379204db234c930d26.tar.gz
postgresql-ef70b6f8e28dae452d2bdb379204db234c930d26.zip
AlterSubscription_refresh: avoid stomping on global variable
This patch replaces use of the global "wrconn" variable in AlterSubscription_refresh with a local variable of the same name, making it consistent with other functions in subscriptioncmds.c (e.g. DropSubscription). The global wrconn is only meant to be used for logical apply/tablesync worker. Abusing it this way is known to cause trouble if an apply worker manages to do a subscription refresh, such as reported by Jeremy Finzel and diagnosed by Andres Freund back in November 2020, at https://www.postgresql.org/message-id/20201111215820.qihhrz7fayu6myfi@alap3.anarazel.de Backpatch to 10. In branch master, also move the connection establishment to occur outside the PG_TRY block; this way we can remove a test for NULL in PG_FINALLY, and it also makes the code more consistent with similar code in the same file. Author: Peter Smith <peter.b.smith@fujitsu.com> Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> Reviewed-by: Japin Li <japinli@hotmail.com> Discussion: https://postgr.es/m/CAHut+Pu7Jv9L2BOEx_Z0UtJxfDevQSAUW2mJqWU+CtmDrEZVAg@mail.gmail.com
Diffstat (limited to 'src/backend/executor/nodeModifyTable.c')
0 files changed, 0 insertions, 0 deletions