pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: reindexdb: Forbid index-level REINDEX with CONCURRENTLY and mult
4+ messages / 1 participants
[nested] [flat]

* pgsql: reindexdb: Forbid index-level REINDEX with CONCURRENTLY and mult
@ 2026-10-07 01:40  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 4+ messages in thread

From: Michael Paquier @ 2026-10-07 01:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

reindexdb: Forbid index-level REINDEX with CONCURRENTLY and multiple jobs

reindexdb batches the REINDEX commands of all indexes attached to the
same table into a single multi-statement query when using multiple jobs,
as two steps with query "gen" and "run".

Such a query fails with REINDEX CONCURRENTLY, as this command cannot run
inside a transaction block.  Batching cannot be avoided because the
indexes of one table have to be re-indexed one at a time to avoid
conflicts across jobs.

Let's error out cleanly on the reindexdb side if this combination of
options is used, instead of having the server complain about that.  This
case has not been considered by 47f99a407d.

If there is interest in supporting this combination of options, the code
should be redesigned for this purpose with some better batching, rather
than try to use sets of "gen" and "run" routines.  As currently written,
an index-level reindexdb uses a set of "gen" steps with one final "run"
step, which is nice code-wise.  (Note: I doubt that that this would be
worth the effort.)

Author: Kirill Reshke <reshkekirill@gmail.com>
Discussion: https://postgr.es/m/CALdSSPiEkAmS+n7Ea9XDMrLjkbQk=CrB7zw1kcq9B47hfKUhXw@mail.gmail.com
Backpatch-through: 17

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e9c03f0f1bf698c0c603c51baaacfa60dc8c91c7

Modified Files
--------------
src/bin/scripts/reindexdb.c        |  3 +++
src/bin/scripts/t/090_reindexdb.pl | 10 ++++++++++
2 files changed, 13 insertions(+)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: reindexdb: Forbid index-level REINDEX with CONCURRENTLY and mult
@ 2026-10-07 01:40  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 4+ messages in thread

From: Michael Paquier @ 2026-10-07 01:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

reindexdb: Forbid index-level REINDEX with CONCURRENTLY and multiple jobs

reindexdb batches the REINDEX commands of all indexes attached to the
same table into a single multi-statement query when using multiple jobs,
as two steps with query "gen" and "run".

Such a query fails with REINDEX CONCURRENTLY, as this command cannot run
inside a transaction block.  Batching cannot be avoided because the
indexes of one table have to be re-indexed one at a time to avoid
conflicts across jobs.

Let's error out cleanly on the reindexdb side if this combination of
options is used, instead of having the server complain about that.  This
case has not been considered by 47f99a407d.

If there is interest in supporting this combination of options, the code
should be redesigned for this purpose with some better batching, rather
than try to use sets of "gen" and "run" routines.  As currently written,
an index-level reindexdb uses a set of "gen" steps with one final "run"
step, which is nice code-wise.  (Note: I doubt that that this would be
worth the effort.)

Author: Kirill Reshke <reshkekirill@gmail.com>
Discussion: https://postgr.es/m/CALdSSPiEkAmS+n7Ea9XDMrLjkbQk=CrB7zw1kcq9B47hfKUhXw@mail.gmail.com
Backpatch-through: 17

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c84243d5b484b0a672664fcfaeeac22204887423

Modified Files
--------------
src/bin/scripts/reindexdb.c        |  3 +++
src/bin/scripts/t/090_reindexdb.pl | 10 ++++++++++
2 files changed, 13 insertions(+)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: reindexdb: Forbid index-level REINDEX with CONCURRENTLY and mult
@ 2026-10-07 01:40  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 4+ messages in thread

From: Michael Paquier @ 2026-10-07 01:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

reindexdb: Forbid index-level REINDEX with CONCURRENTLY and multiple jobs

reindexdb batches the REINDEX commands of all indexes attached to the
same table into a single multi-statement query when using multiple jobs,
as two steps with query "gen" and "run".

Such a query fails with REINDEX CONCURRENTLY, as this command cannot run
inside a transaction block.  Batching cannot be avoided because the
indexes of one table have to be re-indexed one at a time to avoid
conflicts across jobs.

Let's error out cleanly on the reindexdb side if this combination of
options is used, instead of having the server complain about that.  This
case has not been considered by 47f99a407d.

If there is interest in supporting this combination of options, the code
should be redesigned for this purpose with some better batching, rather
than try to use sets of "gen" and "run" routines.  As currently written,
an index-level reindexdb uses a set of "gen" steps with one final "run"
step, which is nice code-wise.  (Note: I doubt that that this would be
worth the effort.)

Author: Kirill Reshke <reshkekirill@gmail.com>
Discussion: https://postgr.es/m/CALdSSPiEkAmS+n7Ea9XDMrLjkbQk=CrB7zw1kcq9B47hfKUhXw@mail.gmail.com
Backpatch-through: 17

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/acccaf0d8ed8e4f7523e2afa24e011be4256493a

Modified Files
--------------
src/bin/scripts/reindexdb.c        |  3 +++
src/bin/scripts/t/090_reindexdb.pl | 10 ++++++++++
2 files changed, 13 insertions(+)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: reindexdb: Forbid index-level REINDEX with CONCURRENTLY and mult
@ 2026-10-07 01:40  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 4+ messages in thread

From: Michael Paquier @ 2026-10-07 01:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

reindexdb: Forbid index-level REINDEX with CONCURRENTLY and multiple jobs

reindexdb batches the REINDEX commands of all indexes attached to the
same table into a single multi-statement query when using multiple jobs,
as two steps with query "gen" and "run".

Such a query fails with REINDEX CONCURRENTLY, as this command cannot run
inside a transaction block.  Batching cannot be avoided because the
indexes of one table have to be re-indexed one at a time to avoid
conflicts across jobs.

Let's error out cleanly on the reindexdb side if this combination of
options is used, instead of having the server complain about that.  This
case has not been considered by 47f99a407d.

If there is interest in supporting this combination of options, the code
should be redesigned for this purpose with some better batching, rather
than try to use sets of "gen" and "run" routines.  As currently written,
an index-level reindexdb uses a set of "gen" steps with one final "run"
step, which is nice code-wise.  (Note: I doubt that that this would be
worth the effort.)

Author: Kirill Reshke <reshkekirill@gmail.com>
Discussion: https://postgr.es/m/CALdSSPiEkAmS+n7Ea9XDMrLjkbQk=CrB7zw1kcq9B47hfKUhXw@mail.gmail.com
Backpatch-through: 17

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/869c53ff8fe412b0da066d95419753481412a2a4

Modified Files
--------------
src/bin/scripts/reindexdb.c        |  3 +++
src/bin/scripts/t/090_reindexdb.pl | 10 ++++++++++
2 files changed, 13 insertions(+)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2026-10-07 01:40 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-10-07 01:40 pgsql: reindexdb: Forbid index-level REINDEX with CONCURRENTLY and mult Michael Paquier <michael@paquier.xyz>
2026-10-07 01:40 pgsql: reindexdb: Forbid index-level REINDEX with CONCURRENTLY and mult Michael Paquier <michael@paquier.xyz>
2026-10-07 01:40 pgsql: reindexdb: Forbid index-level REINDEX with CONCURRENTLY and mult Michael Paquier <michael@paquier.xyz>
2026-10-07 01:40 pgsql: reindexdb: Forbid index-level REINDEX with CONCURRENTLY and mult Michael Paquier <michael@paquier.xyz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox