Message style improvements

This commit is contained in:
Peter Eisentraut 2023-05-19 18:45:29 +02:00
parent e5f85744ea
commit 8e7912e73d
11 changed files with 31 additions and 30 deletions

View 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,

View 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);
}
}

View 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);
}

View 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"));

View 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);

View 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);
}

View 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"

View 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"));

View 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;
}

View 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;

View 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;
}