pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: pinker <pinker@onet.eu>
To: pgsql-bugs@postgresql.org
Subject: Interval -  incorrect grammar form
Date: Thu, 16 Jul 2015 00:56:02 -0700 (MST)
Message-ID: <1437033362097-5858132.post@n5.nabble.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Hi,
I've noticed that interval is shown incorrectly (in plural form) when date
is negative:

select age(timestamp '2015-09-01',timestamp '2017-10-02');
gives:
"-2 years -1 *mons* -1 days"

This mistake isn't present when date is positive
select age(now(),'2015-06-07');

"1 *mon* 9 days 11:53:37.567851"

It applies to versions: 
"PostgreSQL 9.4.1 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.1.2
20080704 (Red Hat 4.1.2-55), 64-bit"
and 
"PostgreSQL 8.4.17 on i486-pc-linux-gnu, compiled by GCC gcc-4.4.real
(Debian 4.4.5-8) 4.4.5, 32-bit"



--
View this message in context: http://postgresql.nabble.com/Interval-incorrect-grammar-form-tp5858132.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (3+ messages)  latest in thread

Message-ID: <1437033362097-5858132.post@n5.nabble.com>
Permalink:  ../1437033362097-5858132.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1437033362097-5858132.post@n5.nabble.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: pinker@onet.eu
  Subject: Re: Interval -  incorrect grammar form
  In-Reply-To: <1437033362097-5858132.post@n5.nabble.com>
  References: <1437033362097-5858132.post@n5.nabble.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