Re: BUG #12872: Inconsistent processing of interval values - Mailing list pgsql-bugs

From Ján Máté
Subject Re: BUG #12872: Inconsistent processing of interval values
Date
Msg-id 0F7378F0-7279-4903-ADE5-2474C2A76674@inf-it.com
Whole thread Raw
In response to Re: BUG #12872: Inconsistent processing of interval values  (Bruce Momjian <bruce@momjian.us>)
List pgsql-bugs
Hi Bruce,

> On 17 Mar 2015, at 20:45, Bruce Momjian <bruce@momjian.us> wrote:
>
> On Mon, Mar 16, 2015 at 11:03:52PM +0000, jan.mate@inf-it.com wrote:
>> works, but:
>>
>> testdb=> SELECT (now()-' +5 days -12 hours -1 second +1 day'::interval) AS
>> tstz;
>> ERROR:  invalid input syntax for type interval: " +5 days -12 hours -1
>> second +1 day"
>> LINE 1: SELECT (now()-' +5 days -12 hours -1 second +1 day'::interva...
>>
>> generates an error. Yes, I understand that writing '+5 days +1 day' is
>> "stupid" but it conforms the syntax in the documentation.
>
> Well, I think we have always had that restriction, and you are the first
> person to mention it.  Are you thinking we should document this
> limitation?

yes, document it or allow to use the same unit multiple times. The documentation
fix looks as the easier solution ...


JM


pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pg_upgrade failure on Windows Server
Next
From: m8r-444fqh@mailinator.com
Date:
Subject: BUG #12877: Altitude not respected in order by and group by