]> git.ipfire.org Git - thirdparty/postgresql.git/commit
reindexdb: Skip reindexing temporary tables and indexes.
authorFujii Masao <fujii@postgresql.org>
Mon, 30 Sep 2024 02:13:55 +0000 (11:13 +0900)
committerFujii Masao <fujii@postgresql.org>
Mon, 30 Sep 2024 02:16:15 +0000 (11:16 +0900)
commit653ce5b8b79cffb163216cd53fec78d260d992b8
tree674136c4a59a53d8f9e56789e76963a100833a14
parent4c922821e12e5a7526dac9049a4c8af861375103
reindexdb: Skip reindexing temporary tables and indexes.

Reindexing temp tables or indexes of other sessions is not allowed.
However, reindexdb in parallel mode previously listed them as
the objects to process, leading to failures.

This commit ensures reindexdb in parallel mode skips temporary tables
and indexes by adding a condition based on the relpersistence column
in pg_class to the object listing queries, preventing these issues.

Note that this commit does not affect reindexdb when temporary tables
or indexes are explicitly specified using the -t or -j options;
reindexdb in that case still does not skip them and can cause an error.

Back-patch to v13 where parallel mode was introduced in reindexdb.

Author: Fujii Masao
Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/5f37ee56-14fb-44fe-9150-9eb97e10538b@oss.nttdata.com
src/bin/scripts/reindexdb.c