Re: CREATE INDEX CONCURRENTLY does not index prepared xact's data

Victor Yegorov <vyegorov@gmail.com>

From: Victor Yegorov <vyegorov@gmail.com>
To: Andrey Borodin <x4mmm@yandex-team.ru>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2020-12-19T17:22:14Z
Lists: pgsql-bugs
сб, 19 дек. 2020 г. в 18:13, Andrey Borodin <x4mmm@yandex-team.ru>:

> Steps to reproduce:
> create extension if not exists amcheck;
> create table if not exists t1(i int);
> begin;
> insert into t1 values(1);
> prepare transaction 'x';
> create index concurrently i1 on t1(i);
> commit prepared 'x';
> select bt_index_check('i1', true);
>
> I observe:
> NOTICE:  heap tuple (1,8) from table "t1" lacks matching index tuple
> within index "i1"
> I expect: awaiting 'x' commit before index is created, correct index after.
>

CREATE INDEX CONCURRENTLY isn't supposed to be run inside a transaction?..


-- 
Victor Yegorov

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY.

  2. Fix minor memory leaks in pg_dump.

  3. Avoid race in RelationBuildDesc() affecting CREATE INDEX CONCURRENTLY.

  4. Fix CREATE INDEX CONCURRENTLY for the newest prepared transactions.

  5. Add -w back to the flags for pg_ctl (re)start in PostgresNode

  6. Fix CREATE INDEX CONCURRENTLY for simultaneous prepared transactions.