Re: Remove an unnecessary errmsg_plural in dependency.c

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Remove an unnecessary errmsg_plural in dependency.c
Date: 2022-03-24 13:05:27
Message-ID: 74ce9862-c723-45fd-d3bb-f4901515320e@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2022-03-24 13:07:26 Re: Estimating HugePages Requirements?
Previous Message Robert Haas 2022-03-24 13:00:05 Re: multithreaded zstd backup compression for client and server