should CREATE INDEX ON partitioned_table callPreventInTransactionBlock() ? - Mailing list pgsql-hackers

From Justin Pryzby
Subject should CREATE INDEX ON partitioned_table callPreventInTransactionBlock() ?
Date
Msg-id 20200608093553.GN22473@telsasoft.com
Whole thread Raw
Responses Re: should CREATE INDEX ON partitioned_table callPreventInTransactionBlock() ?
List 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



pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Bump default wal_level to logical
Next
From: ahsan hadi
Date:
Subject: Re: Improving psql slash usage help message