From b62a3fa1cc66ab0d3356c0262b743909d2066504 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Fri, 20 Oct 2023 22:52:15 +0200 Subject: 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. --- src/backend/commands/collationcmds.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/backend/commands/collationcmds.c') diff --git a/src/backend/commands/collationcmds.c b/src/backend/commands/collationcmds.c index efb8b4d289f..4088481b9c7 100644 --- a/src/backend/commands/collationcmds.c +++ b/src/backend/commands/collationcmds.c @@ -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, -- cgit v1.2.3