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

From Sergei Kornilov
Subject Re: BUG #15169: create index CONCURRENTLY conflict with other table's COPY
Date
Msg-id 1204731524573496@web23g.yandex.ru
Whole thread Raw
In response to BUG #15169: create index CONCURRENTLY conflict with other table's COPY  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
Hello
This works as documented:
https://www.postgresql.org/docs/current/static/sql-createindex.html#SQL-CREATEINDEX-CONCURRENTLY

> PostgreSQL must perform two scans of the table, and in addition it must wait for all existing transactions that could
potentiallymodify or use the index to terminate
 
> Before each table scan, the index build must wait for existing transactions that have modified the table to
terminate.After the second scan, the index build must wait for any transactions that have a snapshot (see Chapter 13)
predatingthe second scan to terminate. Then finally the index can be marked ready for use, and the CREATE INDEX command
terminates

So create index concurrently waiting your transaction.

regards, Sergei


pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #15169: create index CONCURRENTLY conflict with other table's COPY
Next
From: Andres Freund
Date:
Subject: Re: BUG #15169: create index CONCURRENTLY conflict with othertable's COPY