Re: Time intervals in select statement

From: Luke McFarlane <luke(at)fisheye(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Time intervals in select statement
Date: 2004-10-19 07:22:11
Message-ID: 4174C0A3.9040301@fisheye.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)fisheye(dot)com(dot)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
>
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Theodore Petrosky 2004-10-19 11:39:12 Re: Mac OS X make check errors...
Previous Message Tom Lane 2004-10-19 07:16:35 Re: Time intervals in select statement