Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group