Message style improvements
authorPeter Eisentraut <[email protected]>
Fri, 19 May 2023 16:45:29 +0000 (18:45 +0200)
committerPeter Eisentraut <[email protected]>
Fri, 19 May 2023 16:45:29 +0000 (18:45 +0200)
src/backend/access/transam/xlogfuncs.c
src/bin/pg_basebackup/bbstreamer_zstd.c
src/bin/pg_dump/compress_lz4.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_upgrade/check.c
src/bin/psql/command.c
src/bin/psql/help.c
src/bin/scripts/createuser.c
src/common/compression.c
src/common/rmtree.c
src/interfaces/libpq/fe-connect.c

index 52f827a902dd3dc4031c8cb1c5ff3a6f5da04b61..5044ff064329b48e244e3072cc2f82cf38bad045 100644 (file)
@@ -212,7 +212,8 @@ pg_log_standby_snapshot(PG_FUNCTION_ARGS)
                ereport(ERROR,
                                (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
                                 errmsg("recovery is in progress"),
-                                errhint("pg_log_standby_snapshot() cannot be executed during recovery.")));
+                                errhint("%s cannot be executed during recovery.",
+                                                "pg_log_standby_snapshot()")));
 
        if (!XLogStandbyInfoActive())
                ereport(ERROR,
index fba391e2a0f0c4eb35458ccb44e2511a3936f9af..58e32ca5bb08979cc7fbccdaf1cac16f445741e6 100644 (file)
@@ -113,8 +113,8 @@ bbstreamer_zstd_compressor_new(bbstreamer *next, pg_compress_specification *comp
                                                                         compress->long_distance);
                if (ZSTD_isError(ret))
                {
-                       pg_log_error("could not set compression flag for %s: %s",
-                                                "long", ZSTD_getErrorName(ret));
+                       pg_log_error("could not enable long-distance mode: %s",
+                                                ZSTD_getErrorName(ret));
                        exit(1);
                }
        }
index b869780c0b4aa4133da6a03f9023430169d41af7..8d7b28e51046ccda5f8a68ccda920bf159bf5438 100644 (file)
@@ -224,7 +224,7 @@ WriteDataToArchiveLZ4(ArchiveHandle *AH, CompressorState *cs,
                                                                         data, chunk, NULL);
 
                if (LZ4F_isError(status))
-                       pg_fatal("failed to LZ4 compress data: %s",
+                       pg_fatal("could not compress data: %s",
                                         LZ4F_getErrorName(status));
 
                cs->writeF(AH, state->buffer, status);
@@ -256,14 +256,14 @@ EndCompressorLZ4(ArchiveHandle *AH, CompressorState *cs)
                                                          state->buffer, state->buflen,
                                                          NULL);
        if (LZ4F_isError(status))
-               pg_fatal("failed to end compression: %s",
+               pg_fatal("could not end compression: %s",
                                 LZ4F_getErrorName(status));
 
        cs->writeF(AH, state->buffer, status);
 
        status = LZ4F_freeCompressionContext(state->ctx);
        if (LZ4F_isError(status))
-               pg_fatal("failed to end compression: %s",
+               pg_fatal("could not end compression: %s",
                                 LZ4F_getErrorName(status));
 
        pg_free(state->buffer);
@@ -677,7 +677,7 @@ LZ4Stream_close(CompressFileHandle *CFH)
                {
                        status = LZ4F_compressEnd(state->ctx, state->buffer, state->buflen, NULL);
                        if (LZ4F_isError(status))
-                               pg_fatal("failed to end compression: %s",
+                               pg_fatal("could not end compression: %s",
                                                 LZ4F_getErrorName(status));
                        else if (fwrite(state->buffer, 1, status, state->fp) != status)
                        {
@@ -687,14 +687,14 @@ LZ4Stream_close(CompressFileHandle *CFH)
 
                        status = LZ4F_freeCompressionContext(state->ctx);
                        if (LZ4F_isError(status))
-                               pg_fatal("failed to end compression: %s",
+                               pg_fatal("could not end compression: %s",
                                                 LZ4F_getErrorName(status));
                }
                else
                {
                        status = LZ4F_freeDecompressionContext(state->dtx);
                        if (LZ4F_isError(status))
-                               pg_fatal("failed to end decompression: %s",
+                               pg_fatal("could not end decompression: %s",
                                                 LZ4F_getErrorName(status));
                        pg_free(state->overflowbuf);
                }
index f9cbeb65ab3afa8be925b4d3a33b389c361f8387..f325045f9f04413cdaa5c2aecb4fa271bfe202dc 100644 (file)
@@ -1064,7 +1064,7 @@ help(const char *progname)
        printf(_("  -j, --jobs=NUM               use this many parallel jobs to dump\n"));
        printf(_("  -v, --verbose                verbose mode\n"));
        printf(_("  -V, --version                output version information, then exit\n"));
-       printf(_("  -Z, --compress=METHOD[:LEVEL]\n"
+       printf(_("  -Z, --compress=METHOD[:DETAIL]\n"
                         "                               compress as specified\n"));
        printf(_("  --lock-wait-timeout=TIMEOUT  fail after waiting TIMEOUT for a table lock\n"));
        printf(_("  --no-sync                    do not wait for changes to be written safely to disk\n"));
@@ -1072,10 +1072,10 @@ help(const char *progname)
 
        printf(_("\nOptions controlling the output content:\n"));
        printf(_("  -a, --data-only              dump only the data, not the schema\n"));
-       printf(_("  -b, --large-objects          include large objects in dump\n"
-                        "  --blobs                      (same as --large-objects, deprecated)\n"));
-       printf(_("  -B, --no-large-objects       exclude large objects in dump\n"
-                        "  --no-blobs                   (same as --no-large-objects, deprecated)\n"));
+       printf(_("  -b, --large-objects          include large objects in dump\n"));
+       printf(_("  --blobs                      (same as --large-objects, deprecated)\n"));
+       printf(_("  -B, --no-large-objects       exclude large objects in dump\n"));
+       printf(_("  --no-blobs                   (same as --no-large-objects, deprecated)\n"));
        printf(_("  -c, --clean                  clean (drop) database objects before recreating\n"));
        printf(_("  -C, --create                 include commands to create database in dump\n"));
        printf(_("  -e, --extension=PATTERN      dump the specified extension(s) only\n"));
@@ -1096,8 +1096,8 @@ help(const char *progname)
        printf(_("  --enable-row-security        enable row security (dump only content user has\n"
                         "                               access to)\n"));
        printf(_("  --exclude-table-and-children=PATTERN\n"
-                        "                               do NOT dump the specified table(s),\n"
-                        "                               including child and partition tables\n"));
+                        "                               do NOT dump the specified table(s), including\n"
+                        "                               child and partition tables\n"));
        printf(_("  --exclude-table-data=PATTERN do NOT dump data for the specified table(s)\n"));
        printf(_("  --exclude-table-data-and-children=PATTERN\n"
                         "                               do NOT dump data for the specified table(s),\n"
@@ -1125,8 +1125,8 @@ help(const char *progname)
        printf(_("  --snapshot=SNAPSHOT          use given snapshot for the dump\n"));
        printf(_("  --strict-names               require table and/or schema include patterns to\n"
                         "                               match at least one entity each\n"));
-       printf(_("  --table-and-children=PATTERN dump only the specified table(s),\n"
-                        "                               including child and partition tables\n"));
+       printf(_("  --table-and-children=PATTERN dump only the specified table(s), including\n"
+                        "                               child and partition tables\n"));
        printf(_("  --use-set-session-authorization\n"
                         "                               use SET SESSION AUTHORIZATION commands instead of\n"
                         "                               ALTER OWNER commands to set ownership\n"));
index fea159689e148326f3ff9cedcecd7f24dd76f71b..1ff68c5cc63d25bd9d7c435675003738812effcb 100644 (file)
@@ -1215,7 +1215,7 @@ check_for_aclitem_data_type_usage(ClusterInfo *cluster)
 {
        char            output_path[MAXPGPATH];
 
-       prep_status("Checking for incompatible aclitem data type in user tables");
+       prep_status("Checking for incompatible \"aclitem\" data type in user tables");
 
        snprintf(output_path, sizeof(output_path), "tables_using_aclitem.txt");
 
@@ -1312,7 +1312,7 @@ check_for_pg_role_prefix(ClusterInfo *cluster)
                fclose(script);
                pg_log(PG_REPORT, "fatal");
                pg_fatal("Your installation contains roles starting with \"pg_\".\n"
-                                "\"pg_\" is a reserved prefix for system roles, the cluster\n"
+                                "\"pg_\" is a reserved prefix for system roles.  The cluster\n"
                                 "cannot be upgraded until these roles are renamed.\n"
                                 "A list of roles starting with \"pg_\" is in the file:\n"
                                 "    %s", output_path);
index 607a57715a32ba30a166f667523cf857177cdaa8..95b304aaf6851d1e1862673e90f11209d8d48820 100644 (file)
@@ -4525,7 +4525,7 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
                        popt->topt.expanded_header_exact_width = atoi(value);
                        if (popt->topt.expanded_header_exact_width == 0)
                        {
-                               pg_log_error("\\pset: allowed xheader_width values are full (default), column, page, or a number specifying the exact width.");
+                               pg_log_error("\\pset: allowed xheader_width values are \"%s\" (default), \"%s\", \"%s\", or a number specifying the exact width", "full", "column", "page");
                                return false;
                        }
                }
@@ -4727,11 +4727,11 @@ printPsetInfo(const char *param, printQueryOpt *popt)
        else if (strcmp(param, "xheader_width") == 0)
        {
                if (popt->topt.expanded_header_width_type == PRINT_XHEADER_FULL)
-                       printf(_("Expanded header width is 'full'.\n"));
+                       printf(_("Expanded header width is \"%s\".\n"), "full");
                else if (popt->topt.expanded_header_width_type == PRINT_XHEADER_COLUMN)
-                       printf(_("Expanded header width is 'column'.\n"));
+                       printf(_("Expanded header width is \"%s\".\n"), "column");
                else if (popt->topt.expanded_header_width_type == PRINT_XHEADER_PAGE)
-                       printf(_("Expanded header width is 'page'.\n"));
+                       printf(_("Expanded header width is \"%s\".\n"), "page");
                else if (popt->topt.expanded_header_width_type == PRINT_XHEADER_EXACT_WIDTH)
                        printf(_("Expanded header width is %d.\n"), popt->topt.expanded_header_exact_width);
        }
index ecfb3c099bf5519ea40a786d118e2d40dc98cc3d..c6478ed55917b0bed088f48c709a3612dca024ad 100644 (file)
@@ -410,7 +410,7 @@ helpVariables(unsigned short int pager)
        HELP0("  ENCODING\n"
                  "    current client character set encoding\n");
        HELP0("  ERROR\n"
-                 "    true if last query failed, else false\n");
+                 "    \"true\" if last query failed, else \"false\"\n");
        HELP0("  FETCH_COUNT\n"
                  "    the number of result rows to fetch and display at a time (0 = unlimited)\n");
        HELP0("  HIDE_TABLEAM\n"
@@ -452,7 +452,7 @@ helpVariables(unsigned short int pager)
                  "  SERVER_VERSION_NUM\n"
                  "    server's version (in short string or numeric format)\n");
        HELP0("  SHELL_ERROR\n"
-                 "    true if the last shell command failed, false if it succeeded\n");
+                 "    \"true\" if the last shell command failed, \"false\" if it succeeded\n");
        HELP0("  SHELL_EXIT_CODE\n"
                  "    exit status of the last shell command\n");
        HELP0("  SHOW_ALL_RESULTS\n"
index 3f58759aa2c974c39a17b16dd2cfd031829f76b1..0c7f454be502f1168eb0b85d2ae5754cf9d13e20 100644 (file)
@@ -433,7 +433,7 @@ help(const char *progname)
        printf(_("  -s, --superuser           role will be superuser\n"));
        printf(_("  -S, --no-superuser        role will not be superuser (default)\n"));
        printf(_("  -v, --valid-until=TIMESTAMP\n"
-                        "                            password expiration date for role\n"));
+                        "                            password expiration date and time for role\n"));
        printf(_("  -V, --version             output version information, then exit\n"));
        printf(_("  --interactive             prompt for missing role name and attributes rather\n"
                         "                            than using defaults\n"));
index 35a7cade645cc7d09fde1a858966d3b87a9c57c7..ee937623f0b269a3d8d85f19a0981cadc6a13a6f 100644 (file)
@@ -328,7 +328,7 @@ expect_boolean_value(char *keyword, char *value, pg_compress_specification *resu
                return false;
 
        result->parse_error =
-               psprintf(_("value for compression option \"%s\" must be a boolean"),
+               psprintf(_("value for compression option \"%s\" must be a Boolean value"),
                                 keyword);
        return false;
 }
index a3e536149bed8f240b3b52187236f7e3ea33b6a1..cd99d3f4719b260ec367a7d4dd1e067319f11a35 100644 (file)
@@ -92,7 +92,7 @@ rmtree(const char *path, bool rmtopdir)
                        default:
                                if (unlink(pathbuf) != 0 && errno != ENOENT)
                                {
-                                       pg_log_warning("could not unlink file \"%s\": %m", pathbuf);
+                                       pg_log_warning("could not remove file \"%s\": %m", pathbuf);
                                        result = false;
                                }
                                break;
index c4720927d82fcc49c4191b1a20664b323b5780ae..d44dffdc54e4e8147d7e7823f0981868febf95bd 100644 (file)
@@ -1543,7 +1543,7 @@ connectOptions2(PGconn *conn)
                && strcmp(conn->sslmode, "verify-full") != 0)
        {
                conn->status = CONNECTION_BAD;
-               libpq_append_conn_error(conn, "weak sslmode \"%s\" may not be used with sslrootcert=system (use verify-full)",
+               libpq_append_conn_error(conn, "weak sslmode \"%s\" may not be used with sslrootcert=system (use \"verify-full\")",
                                                                conn->sslmode);
                return false;
        }