1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-21 05:21:08 +03:00

Make some error strings more generic

It's undesirable to have SQL commands or configuration options in a
translatable error string, so take some of these out.
This commit is contained in:
Alvaro Herrera
2023-10-20 22:52:15 +02:00
parent 41da94fd5c
commit 36a14afc07
3 changed files with 33 additions and 12 deletions

View File

@@ -250,19 +250,22 @@ DefineCollation(ParseState *pstate, List *names, List *parameters, bool if_not_e
if (!collcollate)
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("parameter \"lc_collate\" must be specified")));
errmsg("parameter \"%s\" must be specified",
"lc_collate")));
if (!collctype)
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("parameter \"lc_ctype\" must be specified")));
errmsg("parameter \"%s\" must be specified",
"lc_ctype")));
}
else if (collprovider == COLLPROVIDER_ICU)
{
if (!colliculocale)
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("parameter \"locale\" must be specified")));
errmsg("parameter \"%s\" must be specified",
"locale")));
/*
* During binary upgrade, preserve the locale string. Otherwise,
@@ -416,7 +419,9 @@ AlterCollation(AlterCollationStmt *stmt)
if (collOid == DEFAULT_COLLATION_OID)
ereport(ERROR,
(errmsg("cannot refresh version of default collation"),
errhint("Use ALTER DATABASE ... REFRESH COLLATION VERSION instead.")));
/* translator: %s is an SQL command */
errhint("Use %s instead.",
"ALTER DATABASE ... REFRESH COLLATION VERSION")));
if (!object_ownercheck(CollationRelationId, collOid, GetUserId()))
aclcheck_error(ACLCHECK_NOT_OWNER, OBJECT_COLLATION,