postgresql/src
Amit Kapila a9cf48a4cf Make COPY TO keep locks until the transaction end.
COPY TO released the ACCESS SHARE lock immediately when it was done rather
than holding on to it until the end of the transaction.

This breaks the case where a REPEATABLE READ transaction could see an
empty table if it repeats a COPY statement and somebody truncated the
table in the meantime.

Before 4dded12faa the lock was also released after COPY FROM, but the
commit failed to notice the irregularity in COPY TO.

This is old behavior but doesn't seem important enough to backpatch.

Author: Laurenz Albe, based on suggestion by Robert Haas and Tom Lane
Reviewed-by: Amit Kapila
Discussion: https://postgr.es/m/7bcfc39d4176faf85ab317d0c26786953646a411.camel@cybertec.at
2020-05-15 08:10:00 +05:30
..
backend Make COPY TO keep locks until the transaction end. 2020-05-15 08:10:00 +05:30
bin Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
common Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
fe_utils Add SQL type xid8 to expose FullTransactionId to users. 2020-04-07 12:03:59 +12:00
include Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
interfaces Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
port Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
template Fix compiler warning for ppoll() on Cygwin 2019-12-22 23:20:00 +01:00
test Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
timezone Dial back -Wimplicit-fallthrough to level 3 2020-05-13 15:31:14 -04:00
tools Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
tutorial Update copyrights for 2020 2020-01-01 12:21:45 -05:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Update Unicode data to Unicode 13.0.0 and CLDR 37 2020-04-24 09:52:59 +02:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00