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

Commit20e1cc8

Browse files
committed
Rework some error strings for REINDEX CONCURRENTLY with system catalogs
This makes the whole user experience more consistent when bumping intofailures, and more in line with the rewording done via508300e.Author: Michael PaquierReviewed-by: Álvaro HerreraDiscussion:https://postgr.es/m/20190514153252.GA22168@alvherre.pgsql
1 parent252f9a2 commit20e1cc8

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

‎src/backend/commands/indexcmds.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2499,7 +2499,7 @@ ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind,
24992499
if (objectKind==REINDEX_OBJECT_SYSTEM&&concurrent)
25002500
ereport(ERROR,
25012501
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2502-
errmsg("concurrent reindexofsystem catalogsis not supported")));
2502+
errmsg("cannot reindex system catalogsconcurrently")));
25032503

25042504
/*
25052505
* Get OID of object to reindex, being the database currently being used
@@ -2613,7 +2613,7 @@ ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind,
26132613
if (!concurrent_warning)
26142614
ereport(WARNING,
26152615
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2616-
errmsg("concurrent reindexis not supported for catalog relations, skipping all")));
2616+
errmsg("cannot reindexsystem catalogs concurrently, skipping all")));
26172617
concurrent_warning= true;
26182618
continue;
26192619
}
@@ -2764,11 +2764,10 @@ ReindexRelationConcurrently(Oid relationOid, int options)
27642764

27652765
MemoryContextSwitchTo(oldcontext);
27662766

2767-
/* A system catalog cannot be reindexed concurrently */
27682767
if (IsCatalogRelationOid(relationOid))
27692768
ereport(ERROR,
27702769
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2771-
errmsg("cannot reindexasystemcatalog concurrently")));
2770+
errmsg("cannot reindex systemcatalogs concurrently")));
27722771

27732772
/* Open relation to get its indexes */
27742773
heapRelation=table_open(relationOid,ShareUpdateExclusiveLock);
@@ -2858,11 +2857,10 @@ ReindexRelationConcurrently(Oid relationOid, int options)
28582857
{
28592858
OidheapId=IndexGetRelation(relationOid, false);
28602859

2861-
/* A system catalog cannot be reindexed concurrently */
28622860
if (IsCatalogRelationOid(heapId))
28632861
ereport(ERROR,
28642862
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2865-
errmsg("cannot reindexasystemcatalog concurrently")));
2863+
errmsg("cannot reindex systemcatalogs concurrently")));
28662864

28672865
/* Save the list of relation OIDs in private context */
28682866
oldcontext=MemoryContextSwitchTo(private_context);

‎src/test/regress/expected/create_index.out

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,19 +2093,19 @@ REINDEX TABLE CONCURRENTLY concur_reindex_tab;
20932093
ERROR: REINDEX CONCURRENTLY cannot run inside a transaction block
20942094
COMMIT;
20952095
REINDEX TABLE CONCURRENTLY pg_class; -- no catalog relation
2096-
ERROR: cannot reindexasystemcatalog concurrently
2096+
ERROR: cannot reindex systemcatalogs concurrently
20972097
REINDEX INDEX CONCURRENTLY pg_class_oid_index; -- no catalog index
2098-
ERROR: cannot reindexasystemcatalog concurrently
2098+
ERROR: cannot reindex systemcatalogs concurrently
20992099
-- These are the toast table and index of pg_authid.
21002100
REINDEX TABLE CONCURRENTLY pg_toast.pg_toast_1260; -- no catalog toast table
2101-
ERROR: cannot reindexasystemcatalog concurrently
2101+
ERROR: cannot reindex systemcatalogs concurrently
21022102
REINDEX INDEX CONCURRENTLY pg_toast.pg_toast_1260_index; -- no catalog toast index
2103-
ERROR: cannot reindexasystemcatalog concurrently
2103+
ERROR: cannot reindex systemcatalogs concurrently
21042104
REINDEX SYSTEM CONCURRENTLY postgres; -- not allowed for SYSTEM
2105-
ERROR:concurrent reindexofsystem catalogsis not supported
2105+
ERROR:cannot reindex system catalogsconcurrently
21062106
-- Warns about catalog relations
21072107
REINDEX SCHEMA CONCURRENTLY pg_catalog;
2108-
WARNING:concurrent reindexis not supported for catalog relations, skipping all
2108+
WARNING:cannot reindexsystem catalogs concurrently, skipping all
21092109
-- Check the relation status, there should not be invalid indexes
21102110
\d concur_reindex_tab
21112111
Table "public.concur_reindex_tab"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp