Re: COPY, lock release and MVCC

Laurenz Albe <laurenz.albe@cybertec.at>

From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Robert Haas <robertmhaas@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2020-05-14T13:40:44Z
Lists: pgsql-hackers
On Thu, 2020-05-14 at 15:11 +0530, Amit Kapila wrote:
> LGTM.  I have slightly modified the commit message, see if that looks
> fine to you.

Fine with me, thanks.

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

I would use "case" rather than "cases" here.

Yours,
Laurenz Albe




Commits

  1. Make COPY TO keep locks until the transaction end.

  2. COPY to a relation should keep write lock till transaction commit.

  3. Mega-commit to make heap_open/heap_openr/heap_close take an