pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Inconsistencies in error messages
4+ messages / 3 participants
[nested] [flat]

* Inconsistencies in error messages
@ 2022-09-14 10:01  Ekaterina Kiryanova <e.kiryanova@postgrespro.ru>
  0 siblings, 1 reply; 4+ messages in thread

From: Ekaterina Kiryanova @ 2022-09-14 10:01 UTC (permalink / raw)
  To: pgsql-hackers@lists.postgresql.org

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.c
index 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.c
index 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.c
index 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.out
index 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.sql
index 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


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Inconsistencies in error messages
@ 2022-09-14 10:25  John Naylor <john.naylor@enterprisedb.com>
  parent: Ekaterina Kiryanova <e.kiryanova@postgrespro.ru>
  0 siblings, 2 replies; 4+ messages in thread

From: John Naylor @ 2022-09-14 10:25 UTC (permalink / raw)
  To: Ekaterina Kiryanova <e.kiryanova@postgrespro.ru>; +Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

On Wed, Sep 14, 2022 at 5:01 PM Ekaterina Kiryanova
<e.kiryanova@postgrespro.ru> wrote:
>
> Hi,
>
> When translating error messages, Alexander Lakhin
> (<exclusion@gmail.com>) noticed some inconsistencies so I prepared a
> small patch to fix those.

+1

This one

- 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",

is a grammar error so worth backpatching, but the rest are cosmetic.

Will commit this way unless there are objections.

-- 
John Naylor
EDB: http://www.enterprisedb.com





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Inconsistencies in error messages
@ 2022-09-14 10:42  Alvaro Herrera <alvherre@alvh.no-ip.org>
  parent: John Naylor <john.naylor@enterprisedb.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Alvaro Herrera @ 2022-09-14 10:42 UTC (permalink / raw)
  To: John Naylor <john.naylor@enterprisedb.com>; +Cc: Ekaterina Kiryanova <e.kiryanova@postgrespro.ru>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

On 2022-Sep-14, John Naylor wrote:

> This one
> 
> + errmsg("background worker \"%s\": background workers without shared
> memory access are not supported",
> 
> is a grammar error so worth backpatching, but the rest are cosmetic.
> 
> Will commit this way unless there are objections.

+1

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"I dream about dreams about dreams", sang the nightingale
under the pale moon (Sandman)





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Inconsistencies in error messages
@ 2022-09-16 02:48  John Naylor <john.naylor@enterprisedb.com>
  parent: John Naylor <john.naylor@enterprisedb.com>
  1 sibling, 0 replies; 4+ messages in thread

From: John Naylor @ 2022-09-16 02:48 UTC (permalink / raw)
  To: Ekaterina Kiryanova <e.kiryanova@postgrespro.ru>; +Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

On Wed, Sep 14, 2022 at 5:25 PM John Naylor
<john.naylor@enterprisedb.com> wrote:
> Will commit this way unless there are objections.

I forgot to mention yesterday, but this is done.

-- 
John Naylor
EDB: http://www.enterprisedb.com





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2022-09-16 02:48 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-09-14 10:01 Inconsistencies in error messages Ekaterina Kiryanova <e.kiryanova@postgrespro.ru>
2022-09-14 10:25 ` John Naylor <john.naylor@enterprisedb.com>
2022-09-14 10:42   ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2022-09-16 02:48   ` John Naylor <john.naylor@enterprisedb.com>

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