pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: Bruce Momjian <bruce@momjian.us>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: neverov.max@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16939: Plural interval for negative singular
Date: Thu, 29 Apr 2021 20:15:01 -0700
Message-ID: <20210430031501.GA2591558@rfd.leadboat.com> (raw)
In-Reply-To: <20210430010004.GA23068@momjian.us>
References: <20210425115726.GA2353095@rfd.leadboat.com>
	<20210426163116.GR7629@momjian.us>
	<2266336.1619455534@sss.pgh.pa.us>
	<20210426165435.GT7629@momjian.us>
	<2267469.1619456564@sss.pgh.pa.us>
	<20210426170616.GV7629@momjian.us>
	<20210427061329.GB2435607@rfd.leadboat.com>
	<20210427201019.GY7629@momjian.us>
	<20210428054415.GA2493304@rfd.leadboat.com>
	<20210430010004.GA23068@momjian.us>

On Thu, Apr 29, 2021 at 09:00:04PM -0400, Bruce Momjian wrote:
> On Tue, Apr 27, 2021 at 10:44:15PM -0700, Noah Misch wrote:
> > On Tue, Apr 27, 2021 at 04:10:19PM -0400, Bruce Momjian wrote:
> > > 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.
> 
> OK, first, I never realized that saying -1 plural was valid.  Second,
> the two places you showed are actually using abs() properly since
> negative values are shown with an "ago" suffix, not a negative sign:
> 
> 	SET intervalstyle = postgres_verbose;
> 
> 	SELECT '2020-01-01 01:03:00'::timestamptz - '2020-01-01 02:02:01'::timestamptz;
> 	      ?column?
> 	---------------------
> 	 @ 59 mins 1 sec ago
> 	(1 row)

Nice.  The legendary consistency of PostgreSQL remains intact.

> Attached is a patch which reverts 9ee7d533da and 5da9868ed9, and adds a
> comment about the "ago" usage.

Looks good.





view thread (20+ messages)  latest in thread

Message-ID: <20210430031501.GA2591558@rfd.leadboat.com>
Permalink:  ../20210430031501.GA2591558@rfd.leadboat.com/
Also on:    postgresql.org/message-id/20210430031501.GA2591558@rfd.leadboat.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noah@leadboat.com, bruce@momjian.us, tgl@sss.pgh.pa.us, neverov.max@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #16939: Plural interval for negative singular
  In-Reply-To: <20210430031501.GA2591558@rfd.leadboat.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox