| From: | Noah Misch <noah(at)leadboat(dot)com> | 
|---|---|
| To: | Bruce Momjian <bruce(at)momjian(dot)us> | 
| Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-28 05:44:15 | 
| Message-ID: | 20210428054415.GA2493304@rfd.leadboat.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-bugs | 
On Tue, Apr 27, 2021 at 04:10:19PM -0400, Bruce Momjian wrote:
> On Mon, Apr 26, 2021 at 11:13:29PM -0700, Noah Misch wrote:
> > On Mon, Apr 26, 2021 at 01:06:16PM -0400, Bruce Momjian wrote:
> > > On Mon, Apr 26, 2021 at 01:02:44PM -0400, Tom Lane wrote:
> > > > Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > > > > On Mon, Apr 26, 2021 at 12:45:34PM -0400, Tom Lane wrote:
> > > > >> I agree with Noah's opinion that we should stick to the historical
> > > > >> behavior in the interval I/O functions.  There is not enough solidity
> > > > >> in the "this is grammatically wrong" argument to justify taking any
> > > > >> risk of application breakage, and it seems like there is some risk of
> > > > >> that there.
> > > > 
> > > > > Are you saying we should revert the patch and leave the plurals
> > > > > inconsistent in different places?  We were already expressing -1 as
> > > > > singular in most of the places I saw.
> > 
> > Which places did you find?  I used the following to check for code like you
> > were adding, but it probably missed things:
> > 
> > $ git grep '"s"' 5da9868^ | grep abs
> > 5da9868^:src/backend/utils/adt/datetime.c:						(abs(sec) != 1 || fsec != 0) ? "s" : "");
> > 5da9868^:src/interfaces/ecpg/pgtypeslib/interval.c:						(abs(sec) != 1 || fsec != 0) ? "s" : "");
> 
> Yes, I found the same like you did.  Are you saying we should remove the
> abs() calls here so we are consistent?
No, I advise just reverting 5da9868.  The output funcs should keep doing what
they did in v13, inconsistency and all.
I was asking the above question to see which of singular or plural was more
common before $SUBJECT's commit.  I count two examples of singular and seven
examples of plural (one in EVALUATE_MESSAGE_PLURAL(), six modified in commit
5da9868).  Given that, ...
On Mon, Apr 26, 2021 at 01:06:16PM -0400, Bruce Momjian wrote:
> Well, we should then add a comment that this is inconsistent but should
> not be changed.
... adding comments to the two places that use abs() to achieve singular "-1"
sounds fine.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Kieran McCusker | 2021-04-28 10:52:47 | ogr_fdw missing from /pub/repos/yum/13/fedora/fedora-34-x86_64/ | 
| Previous Message | Thomas Munro | 2021-04-28 05:43:27 | Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch |