]> granicus.if.org Git - postgresql/commitdiff
Rework some error strings for REINDEX CONCURRENTLY with system catalogs
authorMichael Paquier <michael@paquier.xyz>
Thu, 20 Jun 2019 04:28:12 +0000 (13:28 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 20 Jun 2019 04:28:12 +0000 (13:28 +0900)
This makes the whole user experience more consistent when bumping into
failures, and more in line with the rewording done via 508300e.

Author: Michael Paquier
Reviewed-by: Álvaro Herrera
Discussion: https://postgr.es/m/20190514153252.GA22168@alvherre.pgsql

src/backend/commands/indexcmds.c
src/test/regress/expected/create_index.out

index d05d2fd3d5c5d56335346d2d98ee6f99ed488acc..a3cbeff95008beddf88b7390ad4932fe37c116eb 100644 (file)
@@ -2499,7 +2499,7 @@ ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind,
        if (objectKind == REINDEX_OBJECT_SYSTEM && concurrent)
                ereport(ERROR,
                                (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                                errmsg("concurrent reindex of system catalogs is not supported")));
+                                errmsg("cannot reindex system catalogs concurrently")));
 
        /*
         * Get OID of object to reindex, being the database currently being used
@@ -2613,7 +2613,7 @@ ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind,
                        if (!concurrent_warning)
                                ereport(WARNING,
                                                (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                                                errmsg("concurrent reindex is not supported for catalog relations, skipping all")));
+                                                errmsg("cannot reindex system catalogs concurrently, skipping all")));
                        concurrent_warning = true;
                        continue;
                }
@@ -2764,11 +2764,10 @@ ReindexRelationConcurrently(Oid relationOid, int options)
 
                                MemoryContextSwitchTo(oldcontext);
 
-                               /* A system catalog cannot be reindexed concurrently */
                                if (IsCatalogRelationOid(relationOid))
                                        ereport(ERROR,
                                                        (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                                                        errmsg("cannot reindex a system catalog concurrently")));
+                                                        errmsg("cannot reindex system catalogs concurrently")));
 
                                /* Open relation to get its indexes */
                                heapRelation = table_open(relationOid, ShareUpdateExclusiveLock);
@@ -2858,11 +2857,10 @@ ReindexRelationConcurrently(Oid relationOid, int options)
                        {
                                Oid                     heapId = IndexGetRelation(relationOid, false);
 
-                               /* A system catalog cannot be reindexed concurrently */
                                if (IsCatalogRelationOid(heapId))
                                        ereport(ERROR,
                                                        (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                                                        errmsg("cannot reindex a system catalog concurrently")));
+                                                        errmsg("cannot reindex system catalogs concurrently")));
 
                                /* Save the list of relation OIDs in private context */
                                oldcontext = MemoryContextSwitchTo(private_context);
index c30e6738ba525b4a5144185c59dbdb1f79f0a509..5305b53cac94a06722c7f94b2fd0f3ec1e090f97 100644 (file)
@@ -2093,19 +2093,19 @@ REINDEX TABLE CONCURRENTLY concur_reindex_tab;
 ERROR:  REINDEX CONCURRENTLY cannot run inside a transaction block
 COMMIT;
 REINDEX TABLE CONCURRENTLY pg_class; -- no catalog relation
-ERROR:  cannot reindex a system catalog concurrently
+ERROR:  cannot reindex system catalogs concurrently
 REINDEX INDEX CONCURRENTLY pg_class_oid_index; -- no catalog index
-ERROR:  cannot reindex a system catalog concurrently
+ERROR:  cannot reindex system catalogs concurrently
 -- These are the toast table and index of pg_authid.
 REINDEX TABLE CONCURRENTLY pg_toast.pg_toast_1260; -- no catalog toast table
-ERROR:  cannot reindex a system catalog concurrently
+ERROR:  cannot reindex system catalogs concurrently
 REINDEX INDEX CONCURRENTLY pg_toast.pg_toast_1260_index; -- no catalog toast index
-ERROR:  cannot reindex a system catalog concurrently
+ERROR:  cannot reindex system catalogs concurrently
 REINDEX SYSTEM CONCURRENTLY postgres; -- not allowed for SYSTEM
-ERROR:  concurrent reindex of system catalogs is not supported
+ERROR:  cannot reindex system catalogs concurrently
 -- Warns about catalog relations
 REINDEX SCHEMA CONCURRENTLY pg_catalog;
-WARNING:  concurrent reindex is not supported for catalog relations, skipping all
+WARNING:  cannot reindex system catalogs concurrently, skipping all
 -- Check the relation status, there should not be invalid indexes
 \d concur_reindex_tab
          Table "public.concur_reindex_tab"