should CREATE INDEX ON partitioned_table call PreventInTransactionBlock() ?

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: should CREATE INDEX ON partitioned_table call PreventInTransactionBlock() ?
Date: 2020-06-08 09:35:53
Message-ID: 20200608093553.GN22473@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This blocks writes to all partitions until commit:

postgres=# begin; CREATE INDEX ON pt(i);
BEGIN
CREATE INDEX

Compare with CLUSTER rel1, rel2, ..., and REINDEX {SCHEMA|DATABASE|SYSTEM},
which release their locks as soon as each rel is processed.

I noticed while implementing REINDEX for partitioned tables, which, it seems
clear, should also avoid slowly accumulating more and more write locks across
an entire partition heirarchy.

--
Justin

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ahsan hadi 2020-06-08 10:24:58 Re: Improving psql slash usage help message
Previous Message Vianello Fabio 2020-06-08 09:13:44 RE: BUG #16481: Stored Procedure Triggered by Logical Replication is Unable to use Notification Events