Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Kyotaro Horiguchi
At Thu, 24 Mar 2022 16:00:58 +0100, Alvaro Herrera wrote in > On 2022-Mar-24, Tom Lane wrote: > > > Alvaro Herrera writes: > > > $ git grep 'Plural-Forms' src/backend/po/*.po > > > ru.po:"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : > > > n%10>=2 && n" > > > > Oh, interesting

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Kyotaro Horiguchi
At Thu, 24 Mar 2022 10:19:18 -0400, Tom Lane wrote in > Bharath Rupireddy writes: > > Thanks. I think I get the point - is it dngettext doing things > > differently for different languages? > > Yeah. To be concrete, have a look in ru.po: I wondered why it takes two forms of format string but

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Alvaro Herrera
On 2022-Mar-24, Tom Lane wrote: > Alvaro Herrera writes: > > $ git grep 'Plural-Forms' src/backend/po/*.po > > ru.po:"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 > > && n" > > Oh, interesting: if I'm reading that right, all three Russian > forms are reachable, even with

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Tom Lane
Alvaro Herrera writes: > $ git grep 'Plural-Forms' src/backend/po/*.po > ru.po:"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 > && n" Oh, interesting: if I'm reading that right, all three Russian forms are reachable, even with the knowledge that n > 1. (But isn't the last

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Alvaro Herrera
On 2022-Mar-24, Bharath Rupireddy wrote: > Thanks. I think I get the point - is it dngettext doing things > differently for different languages? Yes. The dngettext() rules are embedded in each translation's catalog file: $ git grep 'Plural-Forms' src/backend/po/*.po de.po:"Plural-Forms: nplural

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Tom Lane
Bharath Rupireddy writes: > Thanks. I think I get the point - is it dngettext doing things > differently for different languages? Yeah. To be concrete, have a look in ru.po: #: catalog/dependency.c:1208 #, c-format msgid "drop cascades to %d other object" msgid_plural "drop cascades to %d other

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Bharath Rupireddy
On Thu, Mar 24, 2022 at 6:35 PM Peter Eisentraut wrote: > > 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 a

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Daniel Gustafsson
> On 24 Mar 2022, at 14:07, Peter Eisentraut > wrote: > > On 24.03.22 06:17, Kyotaro Horiguchi wrote: >> The comment and errmsg_plural don't seem to be consistent. When the >> code was added by c4f2a0458d, it had only singular form and already >> had the comment. After that 8032d76b5 turned it

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Peter Eisentraut
On 24.03.22 06:17, Kyotaro Horiguchi wrote: The comment and errmsg_plural don't seem to be consistent. When the code was added by c4f2a0458d, it had only singular form and already had the comment. After that 8032d76b5 turned it to errmsg_plural ignoring the comment. It seems like a thinko of 8

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Peter Eisentraut
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 l

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Bharath Rupireddy
On Thu, Mar 24, 2022 at 2:34 PM Daniel Gustafsson wrote: > > > On 24 Mar 2022, at 06:17, Kyotaro Horiguchi wrote: > > > The comment and errmsg_plural don't seem to be consistent. When the > > code was added by c4f2a0458d, it had only singular form and already > > had the comment. After that 803

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-24 Thread Daniel Gustafsson
> On 24 Mar 2022, at 06:17, Kyotaro Horiguchi wrote: > The comment and errmsg_plural don't seem to be consistent. When the > code was added by c4f2a0458d, it had only singular form and already > had the comment. After that 8032d76b5 turned it to errmsg_plural > ignoring the comment. It seems l

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-23 Thread Kyotaro Horiguchi
At Wed, 23 Mar 2022 17:39:52 +0100, Peter Eisentraut wrote in > On 23.03.22 17:33, Bharath Rupireddy wrote: > > It looks like the following errmsg_plural in dependency.c is > > unnecessary as numReportedClient > 1 always and numNotReportedClient > > can never be < 0. Therefore plural version of

Re: Remove an unnecessary errmsg_plural in dependency.c

2022-03-23 Thread Peter Eisentraut
On 23.03.22 17:33, Bharath Rupireddy wrote: It looks like the following errmsg_plural in dependency.c is unnecessary as numReportedClient > 1 always and numNotReportedClient can never be < 0. Therefore plural version of the error message is sufficient. Attached a patch to fix it. Some languages