Re: COPY, lock release and MVCC

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: COPY, lock release and MVCC
Дата
Msg-id ed6f3e0064abb75538439377750c8d2e7d82f9f0.camel@cybertec.at
обсуждение исходный текст
Ответ на Re: COPY, lock release and MVCC  (Amit Kapila <amit.kapila16@gmail.com>)
Ответы Re: COPY, lock release and MVCC  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
On Wed, 2020-05-13 at 19:29 +0530, Amit Kapila wrote:
> > > > > On Fri, May 8, 2020 at 4:58 AM Laurenz Albe <laurenz.albe@cybertec.at> 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:
> > 
> > Here is a patch.
> > 
> 
> - /*
> - * Close the relation. If reading, we can release the AccessShareLock we
> - * got; if writing, we should hold the lock until end of transaction to
> - * ensure that updates will be committed before lock is released.
> - */
> - if (rel != NULL)
> - table_close(rel, (is_from ? NoLock : AccessShareLock));
> + table_close(rel, NoLock);
> 
> I wonder why you have removed (rel != NULL) check?

That was just unexcusable sloppiness, nothing more.

Here is a fixed patch.

Yours,
Laurenz Albe

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Gurjeet Singh
Дата:
Сообщение: Re: JSON output from psql
Следующее
От: Chapman Flack
Дата:
Сообщение: Re: JSON output from psql