From: Ekaterina Kiryanova <e.kiryanova@postgrespro.ru>
To: pgsql-hackers@lists.postgresql.org
Subject: Inconsistencies in error messages
Date: Wed, 14 Sep 2022 13:01:24 +0300
Message-ID: <eed5cec0-a542-53da-6a5e-7789c6ed9817@postgrespro.ru> (raw)
In-Reply-To: <CAA4eK1LgOmTmVnqkyqRTuO1LSmeS-0fK9hRGc5_3n5NgU3KhGw@mail.gmail.com>
References: <CAD21AoAHxHRMcYmDN6XkReHi5o8eCF10O+Q2kKJgunzMv1T6zg@mail.gmail.com>
<20220728.162932.298327366551709856.horikyota.ntt@gmail.com>
<CAD21AoASYjmCrgiK6RJrubb50Q3zO_8MtfouBArq3KyZN21B=Q@mail.gmail.com>
<20220823.115330.639235572548174752.horikyota.ntt@gmail.com>
<CAD21AoCtuUkgOg35vs_Qahfy14phFixvfXjmxbvjZZpuvVEkig@mail.gmail.com>
<CAA4eK1LgOmTmVnqkyqRTuO1LSmeS-0fK9hRGc5_3n5NgU3KhGw@mail.gmail.com>
Hi,
When translating error messages, Alexander Lakhin
(<exclusion@gmail.com>) noticed some inconsistencies so I prepared a
small patch to fix those.
Please see attached.
--
Ekaterina Kiryanova
Technical Writer
Postgres Professional
the Russian PostgreSQL Company
Attachments:
[text/x-patch] v1-fix-inconsistencies-errmsgs.patch (4.2K, ../eed5cec0-a542-53da-6a5e-7789c6ed9817@postgrespro.ru/2-v1-fix-inconsistencies-errmsgs.patch)
download | inline diff:diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.cindex 1024d51dca..27cc5f0e65 100644--- a/src/backend/commands/subscriptioncmds.c+++ b/src/backend/commands/subscriptioncmds.c@@ -1187,7 +1187,7 @@ AlterSubscription(ParseState *pstate, AlterSubscriptionStmt *stmt,
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("ALTER SUBSCRIPTION with refresh and copy_data is not allowed when two_phase is enabled"),
- errhint("Use ALTER SUBSCRIPTION ...SET PUBLICATION with refresh = false, or with copy_data = false"+ errhint("Use ALTER SUBSCRIPTION ... SET PUBLICATION with refresh = false, or with copy_data = false"
", or use DROP/CREATE SUBSCRIPTION.")));
PreventInTransactionBlock(isTopLevel, "ALTER SUBSCRIPTION with refresh");
@@ -1239,7 +1239,7 @@ AlterSubscription(ParseState *pstate, AlterSubscriptionStmt *stmt,
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("ALTER SUBSCRIPTION with refresh and copy_data is not allowed when two_phase is enabled"),
- errhint("Use ALTER SUBSCRIPTION ...SET PUBLICATION with refresh = false, or with copy_data = false"+ errhint("Use ALTER SUBSCRIPTION ... SET PUBLICATION with refresh = false, or with copy_data = false"
", or use DROP/CREATE SUBSCRIPTION.")));
PreventInTransactionBlock(isTopLevel, "ALTER SUBSCRIPTION with refresh");
diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.cindex 40601aefd9..8dd7d64630 100644--- a/src/backend/postmaster/bgworker.c+++ b/src/backend/postmaster/bgworker.c@@ -663,7 +663,7 @@ SanityCheckBackgroundWorker(BackgroundWorker *worker, int elevel)
{
ereport(elevel,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("background worker \"%s\": background worker without shared memory access are not supported",+ errmsg("background worker \"%s\": background workers without shared memory access are not supported",
worker->bgw_name)));
return false;
}
diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.cindex 29ae27e5e3..d02fd83c0a 100644--- a/src/backend/rewrite/rewriteHandler.c+++ b/src/backend/rewrite/rewriteHandler.c@@ -578,7 +578,7 @@ rewriteRuleAction(Query *parsetree,
if (sub_action->hasModifyingCTE && rule_action != sub_action)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("INSERT...SELECT rule actions are not supported for queries having data-modifying statements in WITH")));+ errmsg("INSERT ... SELECT rule actions are not supported for queries having data-modifying statements in WITH")));
}
/*
diff --git a/src/test/regress/expected/with.out b/src/test/regress/expected/with.outindex 30dd900e11..7f2e32d8b0 100644--- a/src/test/regress/expected/with.out+++ b/src/test/regress/expected/with.out@@ -2515,14 +2515,14 @@ SELECT * FROM bug6051_2;
3
(3 rows)
--- check INSERT...SELECT rule actions are disallowed on commands+-- check INSERT ... SELECT rule actions are disallowed on commands
-- that have modifyingCTEs
CREATE OR REPLACE RULE bug6051_ins AS ON INSERT TO bug6051 DO INSTEAD
INSERT INTO bug6051_2
SELECT NEW.i;
WITH t1 AS ( DELETE FROM bug6051 RETURNING * )
INSERT INTO bug6051 SELECT * FROM t1;
-ERROR: INSERT...SELECT rule actions are not supported for queries having data-modifying statements in WITH+ERROR: INSERT ... SELECT rule actions are not supported for queries having data-modifying statements in WITH
-- silly example to verify that hasModifyingCTE flag is propagated
CREATE TEMP TABLE bug6051_3 AS
SELECT a FROM generate_series(11,13) AS a;
diff --git a/src/test/regress/sql/with.sql b/src/test/regress/sql/with.sqlindex 5c52561a8a..0f5730797f 100644--- a/src/test/regress/sql/with.sql+++ b/src/test/regress/sql/with.sql@@ -1169,7 +1169,7 @@ INSERT INTO bug6051 SELECT * FROM t1;
SELECT * FROM bug6051;
SELECT * FROM bug6051_2;
--- check INSERT...SELECT rule actions are disallowed on commands+-- check INSERT ... SELECT rule actions are disallowed on commands
-- that have modifyingCTEs
CREATE OR REPLACE RULE bug6051_ins AS ON INSERT TO bug6051 DO INSTEAD
INSERT INTO bug6051_2
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: e.kiryanova@postgrespro.ru, pgsql-hackers@lists.postgresql.org
Subject: Re: Inconsistencies in error messages
In-Reply-To: <eed5cec0-a542-53da-6a5e-7789c6ed9817@postgrespro.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox