Interval - incorrect grammar form - Mailing list pgsql-bugs

From pinker
Subject Interval - incorrect grammar form
Date
Msg-id 1437033362097-5858132.post@n5.nabble.com
Whole thread Raw
Responses Re: Interval - incorrect grammar form
List 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.

pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #13502: parser misconstrues table alias
Next
From: kolmyk@hotmail.com
Date:
Subject: BUG #13503: json_to_hstore does not works with backslash-quote in json value