Unify some more messages
authorÁlvaro Herrera <alvherre@kurilemu.de>
Mon, 8 Dec 2025 18:23:38 +0000 (19:23 +0100)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Mon, 8 Dec 2025 18:25:36 +0000 (19:25 +0100)
No backpatch here because of message wording changes.

Author: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Discussion: https://postgr.es/m/202512081537.ahw5gwoencou@alvherre.pgsql

src/backend/commands/matview.c
src/backend/postmaster/checkpointer.c
src/test/regress/expected/matview.out
src/test/regress/expected/stats.out

index ef7c0d624f13978d2ab8935589fc2830a7cf6d84..a5c579ce112730d18547e57f18b3a62e5436f154 100644 (file)
@@ -210,8 +210,8 @@ RefreshMatViewByOid(Oid matviewOid, bool is_create, bool skipData,
    if (concurrent && skipData)
        ereport(ERROR,
                (errcode(ERRCODE_SYNTAX_ERROR),
-                errmsg("%s and %s options cannot be used together",
-                       "CONCURRENTLY", "WITH NO DATA")));
+                errmsg("%s options %s and %s cannot be used together",
+                       "REFRESH", "CONCURRENTLY", "WITH NO DATA")));
 
    /*
     * Check that everything is correct for a refresh. Problems at this point
index fa4d7438442cf0e4ec65eac3213dddbc522c0086..afb3d6d86308fd1389cd9c97c70c797624125447 100644 (file)
@@ -1019,7 +1019,8 @@ ExecCheckpoint(ParseState *pstate, CheckPointStmt *stmt)
            else if (strcmp(mode, "fast") != 0)
                ereport(ERROR,
                        (errcode(ERRCODE_SYNTAX_ERROR),
-                        errmsg("unrecognized MODE option \"%s\"", mode),
+                        errmsg("unrecognized value for %s option \"%s\": \"%s\"",
+                               "CHECKPOINT", "mode", mode),
                         parser_errposition(pstate, opt->location)));
        }
        else if (strcmp(opt->defname, "flush_unlogged") == 0)
index d2b7c88657d102534c2afeb2193529a1eb16c6f9..0355720dfc6f47bc9d9f166a2021ee5389d7d484 100644 (file)
@@ -294,7 +294,7 @@ DROP MATERIALIZED VIEW IF EXISTS no_such_mv;
 NOTICE:  materialized view "no_such_mv" does not exist, skipping
 -- make sure invalid combination of options is prohibited
 REFRESH MATERIALIZED VIEW CONCURRENTLY mvtest_tvmm WITH NO DATA;
-ERROR:  CONCURRENTLY and WITH NO DATA options cannot be used together
+ERROR:  REFRESH options CONCURRENTLY and WITH NO DATA cannot be used together
 -- no tuple locks on materialized views
 SELECT * FROM mvtest_tvvm FOR SHARE;
 ERROR:  cannot lock rows in materialized view "mvtest_tvvm"
index 67e1860e984f1399587f39e0e382d86c9965d431..cd00f35bf7a04058c388ded0e721b495d49e02fa 100644 (file)
@@ -965,7 +965,7 @@ ERROR:  unrecognized CHECKPOINT option "wrong"
 LINE 1: CHECKPOINT (WRONG);
                     ^
 CHECKPOINT (MODE WRONG);
-ERROR:  unrecognized MODE option "wrong"
+ERROR:  unrecognized value for CHECKPOINT option "mode": "wrong"
 LINE 1: CHECKPOINT (MODE WRONG);
                     ^
 CHECKPOINT (MODE FAST, FLUSH_UNLOGGED FALSE);