Re: BUG #15169: create index CONCURRENTLY conflict with other table's COPY - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #15169: create index CONCURRENTLY conflict with other table's COPY
Date
Msg-id CAKFQuwY+N5tXnhtgWR5qmZwNDBuxSL=Sopb9+NH72KfPWDz1CQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #15169: create index CONCURRENTLY conflict with othertable's COPY  (Andres Freund <andres@anarazel.de>)
Responses Re:Re: BUG #15169: create index CONCURRENTLY conflict with othertable's COPY  (德哥 <digoal@126.com>)
List pgsql-bugs
On Tue, Apr 24, 2018 at 8:16 AM, Andres Freund <andres@anarazel.de> wrote:
On 2018-04-24 12:29:47 +0000, PG Bug reporting form wrote:
> table a's copy will block table b's CONCURRENTLY index creating.

Yes, concurrently waits for other sessions to complete. I don't see a
bug here?

​To be more specific a create index can stop processing as soon as its done its own work because it prevented any concurrent transactions from operating at the same time.  With concurrently those other transactions can continue to work and thus the concurrent indexing performed by CREATE INDEX cannot know it is finished while other transactions hold write locks on the affected table/index.  Instead it waits "to finish" ​until those transactions finish.  The concurrent index creation has already started and is in progress - there just isn't any communication to the client as to progress.

David J.

pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: BUG #15169: create index CONCURRENTLY conflict with othertable's COPY
Next
From: Alexey Bashtanov
Date:
Subject: set/reset issues in create function and set_config