Re: COPY, lock release and MVCC

2020-05-14 Thread Laurenz Albe
On Fri, 2020-05-15 at 10:11 +0530, Amit Kapila wrote: > Okay, changed, and pushed. Thank you! Yours, Laurenz Albe

Re: COPY, lock release and MVCC

2020-05-14 Thread Amit Kapila
On Thu, May 14, 2020 at 7:10 PM Laurenz Albe wrote: > > 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

Re: COPY, lock release and MVCC

2020-05-14 Thread Laurenz Albe
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

Re: COPY, lock release and MVCC

2020-05-14 Thread Amit Kapila
On Thu, May 14, 2020 at 2:06 AM Laurenz Albe wrote: > > > I wonder why you have removed (rel != NULL) check? > > That was just unexcusable sloppiness, nothing more. > LGTM. I have slightly modified the commit message, see if that looks fine to you. -- With Regards, Amit Kapila. EnterpriseDB:

Re: COPY, lock release and MVCC

2020-05-13 Thread Laurenz Albe
On Wed, 2020-05-13 at 19:29 +0530, Amit Kapila 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

Re: COPY, lock release and MVCC

2020-05-13 Thread Amit Kapila
On Wed, May 13, 2020 at 1:20 AM Laurenz Albe wrote: > > On Tue, 2020-05-12 at 11:50 -0400, Tom Lane wrote: > > 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

Re: COPY, lock release and MVCC

2020-05-12 Thread Laurenz Albe
On Tue, 2020-05-12 at 11:50 -0400, Tom Lane wrote: > 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

Re: COPY, lock release and MVCC

2020-05-12 Thread Tom Lane
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

Re: COPY, lock release and MVCC

2020-05-12 Thread Laurenz Albe
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

Re: COPY, lock release and MVCC

2020-05-11 Thread Robert Haas
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

COPY, lock release and MVCC

2020-05-08 Thread Laurenz Albe
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: >From backend/commands/copy.c: /* * Close the relation. If reading, we can release the AccessShareLock * we got; if writing, we