Re: COPY, lock release and MVCC

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: COPY, lock release and MVCC
Дата
в 15:50:10
Msg-id
22885.1589298610@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
COPY, lock release and MVCC Laurenz Albe <laurenz.albe@cybertec.at>
Re: COPY, lock release and MVCC Robert Haas <robertmhaas@gmail.com>
Re: COPY, lock release and MVCC Laurenz Albe <laurenz.albe@cybertec.at>
Re: COPY, lock release and MVCC Tom Lane <tgl@sss.pgh.pa.us>
Re: COPY, lock release and MVCC Laurenz Albe <laurenz.albe@cybertec.at>
Re: COPY, lock release and MVCC Amit Kapila <amit.kapila16@gmail.com>
Re: COPY, lock release and MVCC Laurenz Albe <laurenz.albe@cybertec.at>
Re: COPY, lock release and MVCC Amit Kapila <amit.kapila16@gmail.com>
Re: COPY, lock release and MVCC Laurenz Albe <laurenz.albe@cybertec.at>
Re: COPY, lock release and MVCC Amit Kapila <amit.kapila16@gmail.com>
Re: COPY, lock release and MVCC Laurenz Albe <laurenz.albe@cybertec.at>
Laurenz Albe  writes:
> On Mon, 2020-05-11 at 15:43 -0400, Robert Haas wrote:
>> On Fri, May 8, 2020 at 4:58 AM Laurenz Albe  wrote:
>>> I happened to notice that COPY TO releases the ACCESS SHARE lock
>>> on the table right when the command ends rather than holding it
>>> until the end of the transaction:

>> That seems inconsistent with what an INSERT statement would do, and thus bad.

> Well, should we fix the code or the documentation?

I'd agree with fixing the code.  Early lock release is something we do on
system catalog accesses, and while it hasn't bitten us yet, I've been
kind of expecting that someday it will.  We should not do it on SQL-driven
accesses to user tables.

Having said that, I'd vote for just changing it in HEAD, not
back-patching.  It's not clear that there are consequences bad enough
to merit a back-patched behavior change.

			regards, tom lane


В списке pgsql-hackers по дате отправления
От: Laurenz Albe
Дата:
От: Peter Geoghegan
Дата:
FAQ