Interval - incorrect grammar form

From: pinker <pinker(at)onet(dot)eu>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Interval - incorrect grammar form
Date: 2015-07-16 07:56:02
Message-ID: 1437033362097-5858132.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2015-07-16 18:27:51 Re: BUG #13503: json_to_hstore does not works with backslash-quote in json value
Previous Message kolmyk 2015-07-16 06:44:20 BUG #13503: json_to_hstore does not works with backslash-quote in json value