Re: BUG #15169: create index CONCURRENTLY conflict with other table's COPY

From: Sergei Kornilov <sk(at)zsrv(dot)org>
To: "digoal(at)126(dot)com" <digoal(at)126(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15169: create index CONCURRENTLY conflict with other table's COPY
Date: 2018-04-24 12:38:16
Message-ID: 1204731524573496@web23g.yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 potentially modify 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) predating the 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2018-04-24 15:16:58 Re: BUG #15169: create index CONCURRENTLY conflict with other table's COPY
Previous Message PG Bug reporting form 2018-04-24 12:29:47 BUG #15169: create index CONCURRENTLY conflict with other table's COPY