Re: CREATE INDEX CONCURRENTLY on partitioned index

From: Alexander Pyhalov <a(dot)pyhalov(at)postgrespro(dot)ru>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Ilya Gladyshev <ilya(dot)v(dot)gladyshev(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, 李杰(慎追) <adger(dot)lj(at)alibaba-inc(dot)com>, 曾文旌(义从) <wenjing(dot)zwj(at)alibaba-inc(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: Re: CREATE INDEX CONCURRENTLY on partitioned index
Date: 2024-01-29 12:43:34
Message-ID: efd4febd4ed08e579318de59e16e087c@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi.

I've rebased patch on master and it'seems to me there's one more issue -

when we call DefineIndexConcurrentInternal() in partitioned case, it
waits for transactions, locking tableId, not tabrelid - heaprelid
LockRelId is constructed for parent index relation, not for child index
relation.

Attaching fixed version.

Also I'm not sure what to do with locking of child relations. If we
don't do anything, you can drop one of the partitioned table childs
while CIC is in progress, and get error

ERROR: cache lookup failed for index 16399

If you try to lock all child tables in CIC session, you'll get
deadlocks.

--
Best regards,
Alexander Pyhalov,
Postgres Professional

Attachment Content-Type Size
0001-Allow-CREATE-INDEX-CONCURRENTLY-on-partitioned-table.patch text/x-diff 19.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message torikoshia 2024-01-29 13:02:29 Re: RFC: Logging plan of the running query
Previous Message Dean Rasheed 2024-01-29 12:42:32 Re: Functions to return random numbers in a given range