Re: Remove an unnecessary errmsg_plural in dependency.c - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Remove an unnecessary errmsg_plural in dependency.c
Date
Msg-id 74ce9862-c723-45fd-d3bb-f4901515320e@enterprisedb.com
Whole thread Raw
In response to Re: Remove an unnecessary errmsg_plural in dependency.c  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: Remove an unnecessary errmsg_plural in dependency.c  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
On 24.03.22 13:48, Bharath Rupireddy wrote:
> Yes, the singular version of the message isn't required at all as
> numReportedClient > 1. Hence I proposed to remove errmsg_plural and
> singular version.

The issue is that n == 1 and n != 1 are not the only cases that 
errmsg_plural() handles.  Some languages have different forms for n == 
1, n == 2, and n >= 5, for example.  So while it is true that in

     errmsg_plural("drop cascades to %d other object",
                   "drop cascades to %d other objects",

the English singular string will never be used, you have to keep the 
errmsg_plural() call so that it can handle variants like the above for 
other languages.

You could write

     errmsg_plural("DUMMY NOT USED %d",
                   "drop cascades to %d other objects",

but I don't think that is better.



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: multithreaded zstd backup compression for client and server
Next
From: Magnus Hagander
Date:
Subject: Re: Estimating HugePages Requirements?