Re: Time intervals in select statement - Mailing list pgsql-bugs

From Luke McFarlane
Subject Re: Time intervals in select statement
Date
Msg-id 4174C0A3.9040301@fisheye.com.au
Whole thread Raw
In response to Re: Time intervals in select statement  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Time intervals in select statement
List pgsql-bugs
Tom

Yes, that does indeed work.

It's interesting why addition assumes one operand is interval while
subtraction assumes it is timestamp? It should at least be consistent, IMHO.

Cheers
Luke

Tom Lane wrote:

>Luke McFarlane <luke@fisheye.com.au> writes:
>
>
>>SELECT create_time, create_time - '8 days 16:49:22.600601' FROM foo;
>>
>>
>
>
>
>>ERROR:  invalid input syntax for type timestamp: "8 days 16:49:22.600601"
>>
>>
>
>Cast the constant to interval explicitly.
>
>            regards, tom lane
>
>

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Time intervals in select statement
Next
From: Theodore Petrosky
Date:
Subject: Re: Mac OS X make check errors...