aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/pg_locale.c
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2020-05-13 20:42:09 -0700
committerNoah Misch <noah@leadboat.com>2020-05-13 20:42:34 -0700
commit357012e17f3f7d47bd276d4441c28fbcd58a2c8b (patch)
tree2541909b6ca29ea8955906df5eb5d93bee2cb999 /src/backend/utils/adt/pg_locale.c
parentd439e27d5f57df1365b53688daa367d56d55599d (diff)
downloadpostgresql-357012e17f3f7d47bd276d4441c28fbcd58a2c8b.tar.gz
postgresql-357012e17f3f7d47bd276d4441c28fbcd58a2c8b.zip
In successful pg_recvlogical, end PGRES_COPY_OUT cleanly.
pg_recvlogical merely called PQfinish(), so the backend sent messages after the disconnect. When that caused EPIPE in internal_flush(), before a LogicalConfirmReceivedLocation(), the next pg_recvlogical would repeat already-acknowledged records. Whether or not the defect causes EPIPE, post-disconnect messages could contain an ErrorResponse that the user should see. One properly ends PGRES_COPY_OUT by repeating PQgetCopyData() until it returns a negative value. Augment one of the tests to cover the case of WAL past --endpos. Back-patch to v10, where commit 7c030783a5bd07cadffc2a1018bc33119a4c7505 first appeared. Before that commit, pg_recvlogical never reached PGRES_COPY_OUT. Reported by Thomas Munro. Discussion: https://postgr.es/m/CAEepm=1MzM2Z_xNe4foGwZ1a+MO_2S9oYDq3M5D11=JDU_+0Nw@mail.gmail.com
Diffstat (limited to 'src/backend/utils/adt/pg_locale.c')
0 files changed, 0 insertions, 0 deletions