Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQyfR-0002yD-2h for pgsql-translators@arkaria.postgresql.org; Wed, 15 May 2019 18:30:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hQyfO-00010E-Vd for pgsql-translators@arkaria.postgresql.org; Wed, 15 May 2019 18:30:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQyfO-000106-Ch for pgsql-translators@lists.postgresql.org; Wed, 15 May 2019 18:30:14 +0000 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQyfJ-0002zN-Op for pgsql-translators@lists.postgresql.org; Wed, 15 May 2019 18:30:12 +0000 Received: by mail-qt1-x842.google.com with SMTP id z19so783953qtz.13 for ; Wed, 15 May 2019 11:30:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=f8Y24jWKBxadwexg2YfaP4FueXspPQIsaxIAZnF334I=; b=lamNik2zMU+GBzztii4c+gXJ62JnLLmQMG+IueClO81WWCw1A0njpQzc54cdXS9dll g9z47+RKKbO4kLO+wfYEnyzcBNaoWCTI03o7e10hOplev5GEdzHnn+lZfod6bjIuwL9N 1KRNuYkZ5vkE8SGtF3W6HLI2WrUclQuNW63Cl3e8uM4D1r/Xz8dDJPzKYxCER59b0S/3 uz4cOySdSn394A2QH1aXamUVebltIUYuXENDwGe0WhkX9aJP/R+gGXm/HOdRVyUZkiCd S5PdjBa59vHAfMQwDRYW6YVvHWMpZi01L9yTLYSCeRSkaLn7u0Chvb3Gg1y4CKwKVVrB sGhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=f8Y24jWKBxadwexg2YfaP4FueXspPQIsaxIAZnF334I=; b=TvMhhLzr9VYNM0jSknGyofjTOFfwZ4BVqHowAD59DHZXPWOkzwNgSk2BjdMMU0THmS pmilPbL7wDG9pPOFeN7mlfcB5K6gK/bFTbjzdVGBkmfQ33mQwwqa9WX37RzE1HdyMLub l5PY+oRtir5Xmx3SpvcMrWFC17KohubbVmZdYPXmnfDix/bcFBSufisSAPOc3VV5ypqL EguoKO2+EhRLS0wvTnakaoFyDCXpsQz4hbJTAE6OvjlYywbKrKWLpUpMC/OtQwrmdLXk bb0HCd77Lr5QHW0bSDFRUH0C3xjQCdcV/yd07fOHJiYUDJkFxy6QFIOkDfIcFjGIpDwW tCKA== X-Gm-Message-State: APjAAAUCLdrbRQa1qAqYl7UZt5GqhXFnucz/h0ZEJe9IY53Gx6HPYPyD vN9NxUrkC6rjO6wA2zboypvgCw== X-Google-Smtp-Source: APXvYqyd2T34d9cz41uun1DQ3t4Yl/hqEkXURVB5XKlMouIeJFhV509uVggA6UUTEX01GUqduD4ShA== X-Received: by 2002:aed:3596:: with SMTP id c22mr37864166qte.365.1557945008703; Wed, 15 May 2019 11:30:08 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id t30sm1868155qtc.80.2019.05.15.11.30.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 May 2019 11:30:07 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id A33DE120C22; Wed, 15 May 2019 14:30:05 -0400 (-04) Date: Wed, 15 May 2019 14:30:05 -0400 From: Alvaro Herrera To: pgsql-hackers@lists.postgresql.org Cc: pgsql-translators@lists.postgresql.org Subject: more message fixes Message-ID: <20190515183005.GA26486@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="3MwIy2ne0vdjdPXF" Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit Here's a bunch of message fixes in the postgres.po module. Please comment if anything seems amiss. This is not a final patch, since regression output has not been adjusted; I only verified that the backend still compiles cleanly. Some of the changes are going from this style of message: You need an unconditional ON DELETE DO INSTEAD rule with a RETURNING clause. to this: You need an unconditional %s rule with a RETURNING clause. where the ON DELETE DO INSTEAD part is inserted at execution time, and can be things like ON UPDATE DO INSTEAD of ON INSERT DO INSTEAD. If the reduced string context causes inappropriate changes for any language, I suppose we shouldn't make this kind of change, but I hope not. I'm also changing "ucnv_fromUChars failed: %s" to this: "%s failed: %s", "ucnv_fromUChars" so it essentially reduces the number of translated strings, because we already have "%s failed: %s" in other parts of the backend. I think this is not an issue. Alternatively, we could just remove that message from translation altogether, and have it emit the English version always, by changing it from errmsg() to errmsg_internal(). The bulk of the changes are much less interesting that those. I'm proposing changes in a lot of files: src/backend/commands/copy.c | 6 +++--- src/backend/commands/publicationcmds.c | 2 +- src/backend/commands/subscriptioncmds.c | 32 ++++++++++++++++++++------------ src/backend/commands/tablecmds.c | 9 +++++---- src/backend/parser/analyze.c | 2 +- src/backend/parser/parse_oper.c | 1 + src/backend/postmaster/postmaster.c | 7 ++++--- src/backend/replication/basebackup.c | 17 +++++++---------- src/backend/replication/walsender.c | 20 ++++++++++---------- src/backend/rewrite/rewriteHandler.c | 19 +++++++++++++------ src/backend/utils/adt/jsonpath.c | 3 ++- src/backend/utils/adt/jsonpath_exec.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 10 +++++----- src/backend/utils/adt/pg_locale.c | 10 ++++++---- src/backend/utils/adt/regexp.c | 14 ++++++++++---- 15 files changed, 89 insertions(+), 65 deletions(-) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --3MwIy2ne0vdjdPXF Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="messages.patch" diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index c39218f8dbb..6ffc3a62f67 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -2793,7 +2793,7 @@ CopyFrom(CopyState cstate) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot perform FREEZE on a partitioned table"))); + errmsg("cannot perform COPY FREEZE on a partitioned table"))); } /* @@ -2808,13 +2808,13 @@ CopyFrom(CopyState cstate) if (!ThereAreNoPriorRegisteredSnapshots() || !ThereAreNoReadyPortals()) ereport(ERROR, (errcode(ERRCODE_INVALID_TRANSACTION_STATE), - errmsg("cannot perform FREEZE because of prior transaction activity"))); + errmsg("cannot perform COPY FREEZE because of prior transaction activity"))); if (cstate->rel->rd_createSubid != GetCurrentSubTransactionId() && cstate->rel->rd_newRelfilenodeSubid != GetCurrentSubTransactionId()) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - errmsg("cannot perform FREEZE because the table was not created or truncated in the current subtransaction"))); + errmsg("cannot perform COPY FREEZE because the table was not created or truncated in the current subtransaction"))); ti_options |= TABLE_INSERT_FROZEN; } diff --git a/src/backend/commands/publicationcmds.c b/src/backend/commands/publicationcmds.c index 4d48be0b92e..0d32f2d6e34 100644 --- a/src/backend/commands/publicationcmds.c +++ b/src/backend/commands/publicationcmds.c @@ -129,7 +129,7 @@ parse_publication_options(List *options, else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("unrecognized publication parameter: %s", defel->defname))); + errmsg("unrecognized publication parameter: \"%s\"", defel->defname))); } } diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c index a60a15193a4..b1793b196f2 100644 --- a/src/backend/commands/subscriptioncmds.c +++ b/src/backend/commands/subscriptioncmds.c @@ -185,7 +185,7 @@ parse_subscription_options(List *options, bool *connect, bool *enabled_given, else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("unrecognized subscription parameter: %s", defel->defname))); + errmsg("unrecognized subscription parameter: \"%s\"", defel->defname))); } /* @@ -198,17 +198,20 @@ parse_subscription_options(List *options, bool *connect, bool *enabled_given, if (enabled && *enabled_given && *enabled) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("connect = false and enabled = true are mutually exclusive options"))); + errmsg("%s and %s are mutually exclusive options", + "connect = false", "enabled = true"))); if (create_slot && create_slot_given && *create_slot) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("connect = false and create_slot = true are mutually exclusive options"))); + errmsg("%s and %s are mutually exclusive options", + "connect = false", "create_slot = true"))); if (copy_data && copy_data_given && *copy_data) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("connect = false and copy_data = true are mutually exclusive options"))); + errmsg("%s and %s are mutually exclusive options", + "connect = false", "copy_data = true"))); /* Change the defaults of other options. */ *enabled = false; @@ -225,22 +228,27 @@ parse_subscription_options(List *options, bool *connect, bool *enabled_given, if (enabled && *enabled_given && *enabled) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("slot_name = NONE and enabled = true are mutually exclusive options"))); + errmsg("%s and %s are mutually exclusive options", + "slot_name = NONE", "enable = true"))); if (create_slot && create_slot_given && *create_slot) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("slot_name = NONE and create_slot = true are mutually exclusive options"))); + errmsg("%s and %s are mutually exclusive options", + "slot_name = NONE", "create_slot = true"))); if (enabled && !*enabled_given && *enabled) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("subscription with slot_name = NONE must also set enabled = false"))); + errmsg("subscription with %s must also set %s", + "slot_name = NONE", "enabled = false"))); if (create_slot && !create_slot_given && *create_slot) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("subscription with slot_name = NONE must also set create_slot = false"))); + errmsg("subscription with %s must also set %s", + "slot_name = NONE", "create_slot = false" + ))); } } @@ -487,9 +495,8 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel) } else ereport(WARNING, - (errmsg("tables were not subscribed, you will have to run " - "ALTER SUBSCRIPTION ... REFRESH PUBLICATION to " - "subscribe the tables"))); + (errmsg("tables were not subscribed, you will have to run %s to subscribe the tables", + "ALTER SUBSCRIPTION ... REFRESH PUBLICATION"))); table_close(rel, RowExclusiveLock); @@ -673,7 +680,8 @@ AlterSubscription(AlterSubscriptionStmt *stmt) if (sub->enabled && !slotname) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("cannot set slot_name = NONE for enabled subscription"))); + errmsg("cannot set %s for enabled subscription", + "slot_name = NONE"))); if (slotname) values[Anum_pg_subscription_subslotname - 1] = diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index baeb13e6a0c..85210f13d8d 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -10231,6 +10231,7 @@ ATPrepAlterColumnType(List **wqueue, if (!is_expr) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), + /* XXX "named" ?? */ errmsg("cannot alter type of column named in partition key"))); else ereport(ERROR, @@ -15116,14 +15117,14 @@ ComputePartitionAttrs(ParseState *pstate, Relation rel, List *partParams, AttrNu if (strategy == PARTITION_STRATEGY_HASH) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), - errmsg("data type %s has no default hash operator class", - format_type_be(atttype)), + errmsg("data type %s has no default operator class for access method \"%s\"", + format_type_be(atttype), "hash"), errhint("You must specify a hash operator class or define a default hash operator class for the data type."))); else ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), - errmsg("data type %s has no default btree operator class", - format_type_be(atttype)), + errmsg("data type %s has no default operator class for access method \"%s\"", + format_type_be(atttype), "btree"), errhint("You must specify a btree operator class or define a default btree operator class for the data type."))); } diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 400558b552b..bd6f3c80445 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -2599,7 +2599,7 @@ transformCreateTableAsStmt(ParseState *pstate, CreateTableAsStmt *stmt) if (stmt->into->rel->relpersistence == RELPERSISTENCE_UNLOGGED) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("materialized views cannot be UNLOGGED"))); + errmsg("materialized views cannot be unlogged"))); /* * At runtime, we'll need a copy of the parsed-but-not-rewritten Query diff --git a/src/backend/parser/parse_oper.c b/src/backend/parser/parse_oper.c index 24f0d5c08c5..2d79c972d7a 100644 --- a/src/backend/parser/parse_oper.c +++ b/src/backend/parser/parse_oper.c @@ -724,6 +724,7 @@ op_error(ParseState *pstate, List *op, char oprkind, errmsg("operator does not exist: %s", op_signature_string(op, oprkind, arg1, arg2)), (!arg1 || !arg2) ? + /* XXX errhint_plural? */ errhint("No operator matches the given name and argument type. " "You might need to add an explicit type cast.") : errhint("No operator matches the given name and argument types. " diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 71ffb1345b6..aee506cc6f7 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -2028,7 +2028,7 @@ retry1: continue; ereport(COMMERROR, (errcode_for_socket_access(), - errmsg("failed to send GSSAPI negotiation response: %m)"))); + errmsg("failed to send GSSAPI negotiation response: %m"))); return STATUS_ERROR; /* close the connection */ } @@ -2651,11 +2651,12 @@ SIGHUP_handler(SIGNAL_ARGS) /* Reload authentication config files too */ if (!load_hba()) ereport(LOG, - (errmsg("pg_hba.conf was not reloaded"))); + /* translator: %s is a configuration file */ + (errmsg("%s was not reloaded", "pg_hba.conf"))); if (!load_ident()) ereport(LOG, - (errmsg("pg_ident.conf was not reloaded"))); + (errmsg("%s was not reloaded", "pg_ident.conf"))); #ifdef USE_SSL /* Reload SSL configuration as well */ diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c index 36dcb287540..03169577e54 100644 --- a/src/backend/replication/basebackup.c +++ b/src/backend/replication/basebackup.c @@ -1439,6 +1439,7 @@ sendFile(const char *readfilename, const char *tarfilename, struct stat *statbuf if (verify_checksum && (cnt % BLCKSZ != 0)) { + /* XXX is it okay to use %d for BlockNumber everywhere? */ ereport(WARNING, (errmsg("cannot verify checksum in file \"%s\", block " "%d: read buffer size %d and page size %d " @@ -1516,16 +1517,13 @@ sendFile(const char *readfilename, const char *tarfilename, struct stat *statbuf if (checksum_failures <= 5) ereport(WARNING, - (errmsg("checksum verification failed in " - "file \"%s\", block %d: calculated " - "%X but expected %X", + (errmsg("checksum verification failed in file \"%s\", block %d: calculated %X but expected %X", readfilename, blkno, checksum, phdr->pd_checksum))); if (checksum_failures == 5) ereport(WARNING, - (errmsg("further checksum verification " - "failures in file \"%s\" will not " - "be reported", readfilename))); + (errmsg("further checksum verification failures in file \"%s\" will not be reported", + readfilename))); } } block_retry = false; @@ -1581,8 +1579,8 @@ sendFile(const char *readfilename, const char *tarfilename, struct stat *statbuf if (checksum_failures > 1) { ereport(WARNING, - (errmsg("file \"%s\" has a total of %d checksum verification " - "failures", readfilename, checksum_failures))); + (errmsg("file \"%s\" has a total of %d checksum verification failures", + readfilename, checksum_failures))); pgstat_report_checksum_failures_in_db(dboid, checksum_failures); } @@ -1617,8 +1615,7 @@ _tarWriteHeader(const char *filename, const char *linktarget, break; case TAR_SYMLINK_TOO_LONG: ereport(ERROR, - (errmsg("symbolic link target too long for tar format: " - "file name \"%s\", target \"%s\"", + (errmsg("symbolic link target too long for tar format: file name \"%s\", target \"%s\"", filename, linktarget))); break; default: diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index 440b6aac4bc..eb379658562 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -903,8 +903,8 @@ CreateReplicationSlot(CreateReplicationSlotCmd *cmd) { if (IsTransactionBlock()) ereport(ERROR, - (errmsg("CREATE_REPLICATION_SLOT ... EXPORT_SNAPSHOT " - "must not be called inside a transaction"))); + (errmsg("%s must not be called inside a transaction", + "CREATE_REPLICATION_SLOT ... EXPORT_SNAPSHOT"))); need_full_snapshot = true; } @@ -912,23 +912,23 @@ CreateReplicationSlot(CreateReplicationSlotCmd *cmd) { if (!IsTransactionBlock()) ereport(ERROR, - (errmsg("CREATE_REPLICATION_SLOT ... USE_SNAPSHOT " - "must be called inside a transaction"))); + (errmsg("%s must be called inside a transaction", + "CREATE_REPLICATION_SLOT ... USE_SNAPSHOT"))); if (XactIsoLevel != XACT_REPEATABLE_READ) ereport(ERROR, - (errmsg("CREATE_REPLICATION_SLOT ... USE_SNAPSHOT " - "must be called in REPEATABLE READ isolation mode transaction"))); + (errmsg("%s must be called in REPEATABLE READ isolation mode transaction", + "CREATE_REPLICATION_SLOT ... USE_SNAPSHOT"))); if (FirstSnapshotSet) ereport(ERROR, - (errmsg("CREATE_REPLICATION_SLOT ... USE_SNAPSHOT " - "must be called before any query"))); + (errmsg("%s must be called before any query", + "CREATE_REPLICATION_SLOT ... USE_SNAPSHOT"))); if (IsSubTransaction()) ereport(ERROR, - (errmsg("CREATE_REPLICATION_SLOT ... USE_SNAPSHOT " - "must not be called in a subtransaction"))); + (errmsg("%s must not be called in a subtransaction", + "CREATE_REPLICATION_SLOT ... USE_SNAPSHOT"))); need_full_snapshot = true; } diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c index 39080776b04..6a8679c6c3f 100644 --- a/src/backend/rewrite/rewriteHandler.c +++ b/src/backend/rewrite/rewriteHandler.c @@ -3741,23 +3741,30 @@ RewriteQuery(Query *parsetree, List *rewrite_events) case CMD_INSERT: ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot perform INSERT RETURNING on relation \"%s\"", + errmsg("cannot perform %s on relation \"%s\"", + "INSERT RETURNING", RelationGetRelationName(rt_entry_relation)), - errhint("You need an unconditional ON INSERT DO INSTEAD rule with a RETURNING clause."))); + /*- translator: %s is SQL such as ON INSERT DO INSTEAD */ + errhint("You need an unconditional %s rule with a RETURNING clause.", + "ON INSERT DO INSTEAD"))); break; case CMD_UPDATE: ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot perform UPDATE RETURNING on relation \"%s\"", + errmsg("cannot perform %s on relation \"%s\"", + "UPDATE RETURNING", RelationGetRelationName(rt_entry_relation)), - errhint("You need an unconditional ON UPDATE DO INSTEAD rule with a RETURNING clause."))); + errhint("You need an unconditional %s rule with a RETURNING clause.", + "ON UPDATE DO INSTEAD"))); break; case CMD_DELETE: ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot perform DELETE RETURNING on relation \"%s\"", + errmsg("cannot perform %s on relation \"%s\"", + "DELETE RETURNING", RelationGetRelationName(rt_entry_relation)), - errhint("You need an unconditional ON DELETE DO INSTEAD rule with a RETURNING clause."))); + errhint("You need an unconditional %s rule with a RETURNING clause.", + "ON DELETE DO INSTEAD"))); break; default: elog(ERROR, "unrecognized commandType: %d", diff --git a/src/backend/utils/adt/jsonpath.c b/src/backend/utils/adt/jsonpath.c index d53d6d33113..b7f0b4a35e3 100644 --- a/src/backend/utils/adt/jsonpath.c +++ b/src/backend/utils/adt/jsonpath.c @@ -179,7 +179,8 @@ jsonPathFromCstring(char *in, int len) if (!jsonpath) ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), - errmsg("invalid input syntax for jsonpath: \"%s\"", in))); + errmsg("invalid input syntax for type %s: \"%s\"", "jsonpath", + in))); flattenJsonPathParseItem(&buf, jsonpath->expr, 0, false); diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c index 2789ed2371f..b6d6a243e52 100644 --- a/src/backend/utils/adt/jsonpath_exec.c +++ b/src/backend/utils/adt/jsonpath_exec.c @@ -1934,7 +1934,7 @@ getJsonPathVariable(JsonPathExecContext *cxt, JsonPathItem *variable, { ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), - errmsg("cannot find jsonpath variable \"%s\"", + errmsg("could not find jsonpath variable \"%s\"", pnstrdup(varName, varNameLength)))); } diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index 6ab7c5c9c64..84d4f297a89 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -539,7 +539,7 @@ addUnicodeChar(int ch) { ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), - errmsg("invalid input syntax for type jsonpath"), + errmsg("invalid input syntax for type %s", "jsonpath"), errdetail("Unicode escape values cannot be used for code " "point values above 007F when the server encoding " "is not UTF8."))); @@ -555,7 +555,7 @@ addUnicode(int ch, int *hi_surrogate) if (*hi_surrogate != -1) ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), - errmsg("invalid input syntax for type jsonpath"), + errmsg("invalid input syntax for type %s", "jsonpath"), errdetail("Unicode high surrogate must not follow " "a high surrogate."))); *hi_surrogate = (ch & 0x3ff) << 10; @@ -566,7 +566,7 @@ addUnicode(int ch, int *hi_surrogate) if (*hi_surrogate == -1) ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), - errmsg("invalid input syntax for type jsonpath"), + errmsg("invalid input syntax for type %s", "jsonpath"), errdetail("Unicode low surrogate must follow a high " "surrogate."))); ch = 0x10000 + *hi_surrogate + (ch & 0x3ff); @@ -576,7 +576,7 @@ addUnicode(int ch, int *hi_surrogate) { ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), - errmsg("invalid input syntax for type jsonpath"), + errmsg("invalid input syntax for type %s", "jsonpath"), errdetail("Unicode low surrogate must follow a high " "surrogate."))); } @@ -618,7 +618,7 @@ parseUnicode(char *s, int l) { ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), - errmsg("invalid input syntax for type jsonpath"), + errmsg("invalid input syntax for type %s", "jsonpath"), errdetail("Unicode low surrogate must follow a high " "surrogate."))); } diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c index da6e2cb5848..2376bda497b 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -1603,7 +1603,7 @@ icu_to_uchar(UChar **buff_uchar, const char *buff, size_t nbytes) buff, nbytes, &status); if (U_FAILURE(status) && status != U_BUFFER_OVERFLOW_ERROR) ereport(ERROR, - (errmsg("ucnv_toUChars failed: %s", u_errorName(status)))); + (errmsg("%s failed: %s", "ucnv_toUChars", u_errorName(status)))); *buff_uchar = palloc((len_uchar + 1) * sizeof(**buff_uchar)); @@ -1612,7 +1612,7 @@ icu_to_uchar(UChar **buff_uchar, const char *buff, size_t nbytes) buff, nbytes, &status); if (U_FAILURE(status)) ereport(ERROR, - (errmsg("ucnv_toUChars failed: %s", u_errorName(status)))); + (errmsg("%s failed: %s", "ucnv_toUChars", u_errorName(status)))); return len_uchar; } @@ -1641,7 +1641,8 @@ icu_from_uchar(char **result, const UChar *buff_uchar, int32_t len_uchar) buff_uchar, len_uchar, &status); if (U_FAILURE(status) && status != U_BUFFER_OVERFLOW_ERROR) ereport(ERROR, - (errmsg("ucnv_fromUChars failed: %s", u_errorName(status)))); + (errmsg("%s failed: %s", "ucnv_fromUChars", + u_errorName(status)))); *result = palloc(len_result + 1); @@ -1650,7 +1651,8 @@ icu_from_uchar(char **result, const UChar *buff_uchar, int32_t len_uchar) buff_uchar, len_uchar, &status); if (U_FAILURE(status)) ereport(ERROR, - (errmsg("ucnv_fromUChars failed: %s", u_errorName(status)))); + (errmsg("%s failed: %s", "ucnv_fromUChars", + u_errorName(status)))); return len_result; } diff --git a/src/backend/utils/adt/regexp.c b/src/backend/utils/adt/regexp.c index da13a875eb0..dbc8263d486 100644 --- a/src/backend/utils/adt/regexp.c +++ b/src/backend/utils/adt/regexp.c @@ -423,7 +423,7 @@ parse_re_flags(pg_re_flags *flags, text *opts) default: ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("invalid regexp option: \"%c\"", + errmsg("invalid regular expression option: \"%c\"", opt_p[i]))); break; } @@ -863,7 +863,9 @@ regexp_match(PG_FUNCTION_ARGS) if (re_flags.glob) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("regexp_match does not support the global option"), + /* translator: %s is a SQL function name */ + errmsg("%s does not support the \"global\" option", + "regexp_match()"), errhint("Use the regexp_matches function instead."))); matchctx = setup_regexp_matches(orig_str, pattern, &re_flags, @@ -1241,7 +1243,9 @@ regexp_split_to_table(PG_FUNCTION_ARGS) if (re_flags.glob) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("regexp_split_to_table does not support the global option"))); + /* translator: %s is a SQL function name */ + errmsg("%s does not support the \"global\" option", + "regexp_split_to_table()"))); /* But we find all the matches anyway */ re_flags.glob = true; @@ -1294,7 +1298,9 @@ regexp_split_to_array(PG_FUNCTION_ARGS) if (re_flags.glob) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("regexp_split_to_array does not support the global option"))); + /* translator: %s is a SQL function name */ + errmsg("%s does not support the \"global\" option", + "regexp_split_to_array()"))); /* But we find all the matches anyway */ re_flags.glob = true; --3MwIy2ne0vdjdPXF--