Re: CREATE INDEX CONCURRENTLY on partitioned index

Alexander Pyhalov <a.pyhalov@postgrespro.ru>

From: Alexander Pyhalov <a.pyhalov@postgrespro.ru>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Ilya Gladyshev <ilya.v.gladyshev@gmail.com>, pgsql-hackers@lists.postgresql.org, Masahiko Sawada <sawada.mshk@gmail.com>, Michael Paquier <michael@paquier.xyz>, 李杰(慎追) <adger.lj@alibaba-inc.com>, 曾文旌(义从) <wenjing.zwj@alibaba-inc.com>, Alvaro Herrera <alvherre@2ndquadrant.com>
Date: 2024-01-29T12:43:34Z
Lists: pgsql-hackers

Attachments

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

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix assertion failure with REINDEX and event triggers