Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit77f1546

Browse files
committed
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 asthe objects to process, leading to failures.This commit ensures reindexdb in parallel mode skips temporary tablesand indexes by adding a condition based on the relpersistence columnin pg_class to the object listing queries, preventing these issues.Note that this commit does not affect reindexdb when temporary tablesor 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 MasaoReviewed-by: Michael PaquierDiscussion:https://postgr.es/m/5f37ee56-14fb-44fe-9150-9eb97e10538b@oss.nttdata.com
1 parentda99df1 commit77f1546

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎src/bin/scripts/reindexdb.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,8 @@ get_parallel_object_list(PGconn *conn, ReindexType type,
649649
" AND c.relkind IN ("
650650
CppAsString2(RELKIND_RELATION) ", "
651651
CppAsString2(RELKIND_MATVIEW)")\n"
652+
" AND c.relpersistence != "
653+
CppAsString2(RELPERSISTENCE_TEMP)"\n"
652654
" ORDER BY c.relpages DESC;");
653655
break;
654656

@@ -671,6 +673,8 @@ get_parallel_object_list(PGconn *conn, ReindexType type,
671673
" WHERE c.relkind IN ("
672674
CppAsString2(RELKIND_RELATION) ", "
673675
CppAsString2(RELKIND_MATVIEW)")\n"
676+
" AND c.relpersistence != "
677+
CppAsString2(RELPERSISTENCE_TEMP)"\n"
674678
" AND ns.nspname IN (");
675679

676680
for (cell=user_list->head;cell;cell=cell->next)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp