1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-07 19:06:32 +03:00

Message wording improvements

This commit is contained in:
Peter Eisentraut
2023-07-10 10:46:54 +02:00
parent 9b286858e3
commit e53a611523
20 changed files with 53 additions and 48 deletions

View File

@@ -1989,7 +1989,7 @@ partitioned_table_reloptions(Datum reloptions, bool validate)
ereport(ERROR,
errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("cannot specify storage parameters for a partitioned table"),
errhint("Specify storage parameters for its leaf partitions, instead."));
errhint("Specify storage parameters for its leaf partitions instead."));
return NULL;
}

View File

@@ -126,8 +126,8 @@ bbsink_zstd_begin_backup(bbsink *sink)
if (ZSTD_isError(ret))
ereport(ERROR,
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("could not set compression flag for %s: %s",
"long", ZSTD_getErrorName(ret)));
errmsg("could not enable long-distance mode: %s",
ZSTD_getErrorName(ret)));
}
/*

View File

@@ -1703,8 +1703,8 @@ CopyReadAttributesText(CopyFromState cstate)
ereport(ERROR,
(errcode(ERRCODE_BAD_COPY_FILE_FORMAT),
errmsg("unexpected DEFAULT in COPY data"),
errdetail("Column \"%s\" has no DEFAULT value.",
errmsg("unexpected default marker in COPY data"),
errdetail("Column \"%s\" has no default value.",
NameStr(att->attname))));
}
}
@@ -1918,8 +1918,8 @@ endfield:
ereport(ERROR,
(errcode(ERRCODE_BAD_COPY_FILE_FORMAT),
errmsg("unexpected DEFAULT in COPY data"),
errdetail("Column \"%s\" has no DEFAULT value.",
errmsg("unexpected default marker in COPY data"),
errdetail("Column \"%s\" has no default value.",
NameStr(att->attname))));
}
}

View File

@@ -10912,7 +10912,7 @@ ATExecAlterConstraint(Relation rel, AlterTableCmd *cmd, bool recurse,
ancestorname && ancestortable ?
errdetail("Constraint \"%s\" is derived from constraint \"%s\" of relation \"%s\".",
cmdcon->conname, ancestorname, ancestortable) : 0,
errhint("You may alter the constraint it derives from, instead.")));
errhint("You may alter the constraint it derives from instead.")));
}
/*
@@ -13861,7 +13861,7 @@ ATExecChangeOwner(Oid relationOid, Oid newOwnerId, bool recursing, LOCKMODE lock
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("cannot change owner of index \"%s\"",
NameStr(tuple_class->relname)),
errhint("Change the ownership of the index's table, instead.")));
errhint("Change the ownership of the index's table instead.")));
/* quick hack to exit via the no-op path */
newOwnerId = tuple_class->relowner;
}
@@ -13873,7 +13873,7 @@ ATExecChangeOwner(Oid relationOid, Oid newOwnerId, bool recursing, LOCKMODE lock
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("cannot change owner of index \"%s\"",
NameStr(tuple_class->relname)),
errhint("Change the ownership of the index's table, instead.")));
errhint("Change the ownership of the index's table instead.")));
break;
case RELKIND_SEQUENCE:
if (!recursing &&

View File

@@ -312,7 +312,7 @@ auth_failed(Port *port, int status, const char *logdetail)
break;
}
cdetail = psprintf(_("Connection matched %s line %d: \"%s\""),
cdetail = psprintf(_("Connection matched file \"%s\" line %d: \"%s\""),
port->hba->sourcefile, port->hba->linenumber,
port->hba->rawline);
if (logdetail)

View File

@@ -196,7 +196,7 @@ libpqrcv_connect(const char *conninfo, bool logical, bool must_use_password,
(errcode(ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED),
errmsg("password is required"),
errdetail("Non-superuser cannot connect if the server does not request a password."),
errhint("Target server's authentication method must be changed. or set password_required=false in the subscription attributes.")));
errhint("Target server's authentication method must be changed, or set password_required=false in the subscription parameters.")));
}
if (logical)

View File

@@ -1113,7 +1113,7 @@ CreateReplicationSlot(CreateReplicationSlotCmd *cmd)
if (!XactReadOnly)
ereport(ERROR,
/*- translator: %s is a CREATE_REPLICATION_SLOT statement */
(errmsg("%s must be called in a read only transaction",
(errmsg("%s must be called in a read-only transaction",
"CREATE_REPLICATION_SLOT ... (SNAPSHOT 'use')")));
if (FirstSnapshotSet)

View File

@@ -3825,7 +3825,9 @@ TerminateOtherDBBackends(Oid databaseId)
if (superuser_arg(proc->roleId) && !superuser())
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("must be a superuser to terminate superuser process")));
errmsg("permission denied to terminate process"),
errdetail("Only roles with the %s attribute may terminate processes of roles with the %s attribute.",
"SUPERUSER", "SUPERUSER")));
/* Users can signal backends they have role membership in. */
if (!has_privs_of_role(GetUserId(), proc->roleId) &&

View File

@@ -2527,7 +2527,7 @@ errdetail_recovery_conflict(void)
errdetail("User query might have needed to see row versions that must be removed.");
break;
case PROCSIG_RECOVERY_CONFLICT_LOGICALSLOT:
errdetail("User was using a logical slot that must be invalidated.");
errdetail("User was using a logical replication slot that must be invalidated.");
break;
case PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK:
errdetail("User transaction caused buffer deadlock with recovery.");

View File

@@ -950,6 +950,7 @@ standard_ProcessUtility(PlannedStmt *pstmt,
if (!has_privs_of_role(GetUserId(), ROLE_PG_CHECKPOINT))
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
/* translator: %s is name of a SQL command, eg CHECKPOINT */
errmsg("permission denied to execute %s command",
"CHECKPOINT"),
errdetail("Only roles with privileges of the \"%s\" role may execute this command.",

View File

@@ -171,13 +171,13 @@ hex_fail \\x{hexdigit}{0,1}
<xnq,xq,xvq>{unicode}*{unicodefail} {
jsonpath_yyerror(NULL, escontext,
"invalid unicode sequence");
"invalid Unicode escape sequence");
yyterminate();
}
<xnq,xq,xvq>{hex_fail} {
jsonpath_yyerror(NULL, escontext,
"invalid hex character sequence");
"invalid hexadecimal character sequence");
yyterminate();
}
@@ -198,7 +198,7 @@ hex_fail \\x{hexdigit}{0,1}
<xq,xvq><<EOF>> {
jsonpath_yyerror(NULL, escontext,
"unexpected end of quoted string");
"unterminated quoted string");
yyterminate();
}
@@ -554,7 +554,7 @@ parsejsonpath(const char *str, int len, struct Node *escontext)
jsonpath_scanner_init(str, len);
if (jsonpath_yyparse((void *) &parseresult, escontext) != 0)
jsonpath_yyerror(NULL, escontext, "bogus input"); /* shouldn't happen */
jsonpath_yyerror(NULL, escontext, "invalid input"); /* shouldn't happen */
jsonpath_scanner_finish();
@@ -611,7 +611,7 @@ addUnicodeChar(int ch, struct Node *escontext)
else if (!pg_unicode_to_server_noerror(ch, (unsigned char *) cbuf))
ereturn(escontext, false,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("could not convert unicode to server encoding")));
errmsg("could not convert Unicode to server encoding")));
addstring(false, cbuf, strlen(cbuf));
}
return true;

View File

@@ -2870,7 +2870,8 @@ icu_validate_locale(const char *loc_str)
ereport(elevel,
(errmsg("could not get language from ICU locale \"%s\": %s",
loc_str, u_errorName(status)),
errhint("To disable ICU locale validation, set parameter icu_validation_level to DISABLED.")));
errhint("To disable ICU locale validation, set the parameter \"%s\" to \"%s\".",
"icu_validation_level", "disabled")));
return;
}
@@ -2898,7 +2899,8 @@ icu_validate_locale(const char *loc_str)
ereport(elevel,
(errmsg("ICU locale \"%s\" has unknown language \"%s\"",
loc_str, lang),
errhint("To disable ICU locale validation, set parameter icu_validation_level to DISABLED.")));
errhint("To disable ICU locale validation, set the parameter \"%s\" to \"%s\".",
"icu_validation_level", "disabled")));
/* check that it can be opened */
collator = pg_ucol_open(loc_str);

View File

@@ -1002,10 +1002,10 @@ struct config_bool ConfigureNamesBool[] =
},
{
{"enable_presorted_aggregate", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("Enables the planner's ability to produce plans which "
gettext_noop("Enables the planner's ability to produce plans that "
"provide presorted input for ORDER BY / DISTINCT aggregate "
"functions."),
gettext_noop("Allows the query planner to build plans which provide "
gettext_noop("Allows the query planner to build plans that provide "
"presorted input for aggregate functions with an ORDER BY / "
"DISTINCT clause. When disabled, implicit sorts are always "
"performed during execution."),
@@ -4909,8 +4909,8 @@ struct config_enum ConfigureNamesEnum[] =
{"debug_parallel_query", PGC_USERSET, DEVELOPER_OPTIONS,
gettext_noop("Forces the planner's use parallel query nodes."),
gettext_noop("This can be useful for testing the parallel query infrastructure "
"by forcing the planner to generate plans which contains nodes "
"which perform tuple communication between workers and the main process."),
"by forcing the planner to generate plans that contain nodes "
"that perform tuple communication between workers and the main process."),
GUC_NOT_IN_SAMPLE | GUC_EXPLAIN
},
&debug_parallel_query,