Re: Some leftovers of recent message cleanup? - Mailing list pgsql-hackers

From Kyotaro Horiguchi
Subject Re: Some leftovers of recent message cleanup?
Date
Msg-id 20210820.115308.1975041494585968830.horikyota.ntt@gmail.com
Whole thread Raw
In response to Re: Some leftovers of recent message cleanup?  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Responses Re: Some leftovers of recent message cleanup?
List pgsql-hackers
At Thu, 19 Aug 2021 20:29:42 +0900, Fujii Masao <masao.fujii@oss.nttdata.com> wrote in 
> On 2021/08/19 17:03, Kyotaro Horiguchi wrote:
> > Hello.
> > While I was examining message translation for PG14, I found some
> > messages that would need to be fixed.
> > 0001 is a fix for perhaps-leftovers of the recent message cleanups
> > related to "positive integer"(fd90f6ba7a).
> 
> There are still other many messages using "positive" and "negative"
> keywords.
> We should also fix them at all?

I'm not sure, or no if anything. My main point here is not to avoid
use of such kind of words, but reducing variations of the effectively
the same message from the view of translator burden. The two messages
in 0001 are in that category. I noticed those messages accidentally. I
don't think they are the only instance of such divergence, but I'm not
going to do a comprehensive examination of such divergences.. (Or do I
need to check that more comprehensively?)

> BTW, we discussed this before at [1] and concluded that at first
> we should focus on the fix of the ambiguous "non-negative" and
> let "positive" and "negative" keywords as they are.
> 
> [1]
> https://www.postgresql.org/message-id/CALj2ACV7KDM8R=SrDbxvxT5yMDi+BMWVVV_UwmmHiii1pumr8Q@mail.gmail.com

Understood. I agree that point and 0003 is worthless as I anticipated.
I misunderstood that "positive" were included in the do-not-use list.

> > 0002 is a fix for a maybe-mistake in message convention of a recent
> > fix in ECPG of linked-connection (about trailing period and
> > lower-cased commad names)
> 
> LGTM.

Thanks.  So I excluded 0003 and added a fix for regression tests
affected by 0001.  (I'm a bit surprised that 0002 doesn't break
regression tests.)

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center
From a1336831633e1ca8cae17d36829fab8272c9a7fe Mon Sep 17 00:00:00 2001
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Date: Thu, 19 Aug 2021 16:53:24 +0900
Subject: [PATCH v2 1/2] Merge diverged messages

fd90f6ba7a forgot to fix other identical messages to the messages it
fixed. Fix them to reduce translator burden.
---
 src/backend/parser/parse_utilcmd.c         | 2 +-
 src/backend/utils/adt/tsquery.c            | 2 +-
 src/test/regress/expected/alter_table.out  | 2 +-
 src/test/regress/expected/create_table.out | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c
index 675e400839..3b656f2f13 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -4035,7 +4035,7 @@ transformPartitionBound(ParseState *pstate, Relation parent,
         if (spec->modulus <= 0)
             ereport(ERROR,
                     (errcode(ERRCODE_INVALID_TABLE_DEFINITION),
-                     errmsg("modulus for hash partition must be a positive integer")));
+                     errmsg("modulus for hash partition must be an integer greater than zero")));
 
         Assert(spec->remainder >= 0);
 
diff --git a/src/backend/utils/adt/tsquery.c b/src/backend/utils/adt/tsquery.c
index b2ca0d2f8a..ded919b39b 100644
--- a/src/backend/utils/adt/tsquery.c
+++ b/src/backend/utils/adt/tsquery.c
@@ -196,7 +196,7 @@ parse_phrase_operator(TSQueryParserState pstate, int16 *distance)
                 else if (errno == ERANGE || l < 0 || l > MAXENTRYPOS)
                     ereport(ERROR,
                             (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-                             errmsg("distance in phrase operator should not be greater than %d",
+                             errmsg("distance in phrase operator must be an integer value between zero and %d
inclusive",
                                     MAXENTRYPOS)));
                 else
                 {
diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out
index 8dcb00ac67..22091119c8 100644
--- a/src/test/regress/expected/alter_table.out
+++ b/src/test/regress/expected/alter_table.out
@@ -4107,7 +4107,7 @@ ALTER TABLE hash_parted ATTACH PARTITION hpart_5 FOR VALUES WITH (MODULUS 4, REM
 -- check that the table being attach is with valid modulus and remainder value
 CREATE TABLE fail_part(LIKE hash_parted);
 ALTER TABLE hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODULUS 0, REMAINDER 1);
-ERROR:  modulus for hash partition must be a positive integer
+ERROR:  modulus for hash partition must be an integer greater than zero
 ALTER TABLE hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODULUS 8, REMAINDER 8);
 ERROR:  remainder for hash partition must be less than modulus
 ALTER TABLE hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODULUS 3, REMAINDER 2);
diff --git a/src/test/regress/expected/create_table.out b/src/test/regress/expected/create_table.out
index 96bf426d98..f4e559a1a3 100644
--- a/src/test/regress/expected/create_table.out
+++ b/src/test/regress/expected/create_table.out
@@ -934,7 +934,7 @@ LINE 1: ...LE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODU...
                                                              ^
 -- modulus must be greater than zero
 CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 0, REMAINDER 1);
-ERROR:  modulus for hash partition must be a positive integer
+ERROR:  modulus for hash partition must be an integer greater than zero
 -- remainder must be greater than or equal to zero and less than modulus
 CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 8);
 ERROR:  remainder for hash partition must be less than modulus
-- 
2.27.0

From f5097bd47cb42f9eed34ade79f7434366fbdd0ee Mon Sep 17 00:00:00 2001
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Date: Thu, 19 Aug 2021 16:53:54 +0900
Subject: [PATCH v2 2/2] Message cleanup.

---
 src/interfaces/ecpg/preproc/ecpg.header | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/interfaces/ecpg/preproc/ecpg.header b/src/interfaces/ecpg/preproc/ecpg.header
index efb2fb3a38..df58f1535c 100644
--- a/src/interfaces/ecpg/preproc/ecpg.header
+++ b/src/interfaces/ecpg/preproc/ecpg.header
@@ -596,7 +596,7 @@ check_declared_list(const char *name)
         {
             if (connection)
             if (connection && strcmp(ptr->connection, connection) != 0)
-                mmerror(PARSE_ERROR, ET_WARNING, "connection %s is overwritten with %s by declare statement %s.",
connection,ptr->connection, name);
 
+                mmerror(PARSE_ERROR, ET_WARNING, "connection %s is overwritten with %s by DECLARE statement %s",
connection,ptr->connection, name);
 
             connection = mm_strdup(ptr -> connection);
             return true;
         }
-- 
2.27.0


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Support reset of Shared objects statistics in "pg_stat_reset" function
Next
From: Corey Huinker
Date:
Subject: Nitpick/question: Use of aliases for global variables in functions