Re: BUG #12872: Inconsistent processing of interval values

From: Ján Máté <jan(dot)mate(at)inf-it(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #12872: Inconsistent processing of interval values
Date: 2015-03-17 22:09:30
Message-ID: 0F7378F0-7279-4903-ADE5-2474C2A76674@inf-it.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Bruce,

> On 17 Mar 2015, at 20:45, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>
> On Mon, Mar 16, 2015 at 11:03:52PM +0000, jan(dot)mate(at)inf-it(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2015-03-18 00:57:30 Re: pg_upgrade failure on Windows Server
Previous Message Asif Naeem 2015-03-17 20:15:07 Re: pg_upgrade failure on Windows Server