From: | Noah Misch <noah(at)leadboat(dot)com> |
---|---|
To: | Bruce Momjian <bruce(at)momjian(dot)us> |
Cc: | neverov(dot)max(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org |
Subject: | Re: BUG #16939: Plural interval for negative singular |
Date: | 2021-04-25 11:57:26 |
Message-ID: | 20210425115726.GA2353095@rfd.leadboat.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
On Tue, Mar 23, 2021 at 12:03:36PM -0400, Bruce Momjian wrote:
> On Tue, Mar 23, 2021 at 05:21:30AM +0000, PG Bug reporting form wrote:
> > postgres=# set intervalstyle='postgres';
> > SET
> > postgres=# select interval '-1 year -1 day';
> > interval
> > ------------------
> > -1 years -1 days
> > (1 row)
> >
> > Expected output:
> > -1 year -1 day
> >
> > The code
> > (https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/datetime.c#L4193)
> > pluralizes a time unit if the value is not 1, should check both -1 and 1.
From the first several links at
https://www.google.com/search?q=negative+one+singular+plural the choice is a
matter of dispute among English grammar commentators. Singular "-1" is
popular, and plural "-1" is also popular.
> Wow, interesting. Seems there were a few places in the code that
> handled this properly, and several that didn't. The attached patch
> fixes these and updates the regression tests. I will apply this for PG
> 14 in the next few days. This is too likely to break something to
> backpatch. Thanks for the report.
Let's not change from one popular spelling to another when doing so creates a
compatibility hazard. That is to say, I think PostgreSQL would be better with
this patch reverted.
If we did want to standardize on singular for -1, EVALUATE_MESSAGE_PLURAL()
would be a key bit of code to change.
From | Date | Subject | |
---|---|---|---|
Next Message | Mats Kindahl | 2021-04-26 08:55:57 | Re: Bug in handling default privileges inside extension update scripts |
Previous Message | Tom Lane | 2021-04-24 14:54:08 | Re: BUG #16980: invalid memory alloc request size |