Re: question about postgresql time intervals - Mailing list pgsql-general

From Tom Lane
Subject Re: question about postgresql time intervals
Date
Msg-id 11084.1142471591@sss.pgh.pa.us
Whole thread Raw
In response to Re: question about postgresql time intervals  (Michael Glaesemann <grzm@myrealbox.com>)
Responses Re: question about postgresql time intervals  (Michael Glaesemann <grzm@myrealbox.com>)
Re: question about postgresql time intervals  (Linda <lgray@unitrends.com>)
List pgsql-general
Michael Glaesemann <grzm@myrealbox.com> writes:
> On Mar 15, 2006, at 23:39 , Linda wrote:
>> According to the SQL standard, shouldn't this work?
>>
>> select '506:47:04'::interval day to second ;

> No one has implemented this in PostgreSQL yet.

It depends on what you define as "work".  8.1 says

regression=# select '506:47:04'::interval day to second ;
 interval
-----------
 506:47:04
(1 row)

8.0 and before say

regression=# select '506:47:04'::interval day to second ;
     interval
------------------
 21 days 02:47:04
(1 row)

because before 8.1 we didn't distinguish intervals of "1 day" and "24 hours"
as being different.  But the syntax has been accepted for a long time,
at least back to 7.0.

If there's some specific functionality you're after, you should say what
it is rather than expecting us to guess what you mean.

            regards, tom lane

pgsql-general by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Remote Sync
Next
From: "Junaili Lie"
Date:
Subject: Re: What's a good default encoding?