From: Sergei Kornilov <sk@zsrv.org>
To: digoal@126.com <digoal@126.com>
To: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #15169: create index CONCURRENTLY conflict with other table's COPY
Date: Tue, 24 Apr 2018 15:38:16 +0300
Message-ID: <1204731524573496@web23g.yandex.ru> (raw)
In-Reply-To: <152457298745.19804.5702434604866048036@wrigleys.postgresql.org>
References: <152457298745.19804.5702434604866048036@wrigleys.postgresql.org>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: sk@zsrv.org, digoal@126.com
Subject: Re: BUG #15169: create index CONCURRENTLY conflict with other table's COPY
In-Reply-To: <1204731524573496@web23g.yandex.ru>
References: <152457298745.19804.5702434604866048036@wrigleys.postgresql.org> <1204731524573496@web23g.yandex.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox