Search Postgresql Archives

Re: Range-Types in 9.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/03/2012 08:06 AM, Andreas Kretschmer wrote:

Hi all,
great feature, but i can't find a TIMERANGE, i want to store time-ranges, for
instance [10:00:00,16:00:00), how can i do that?



Regards, Andreas

Time ranges could be more complicated than you realize. You'd have problems if you wanted to create a range that extends beyond midnight. Say for example, you need a range from 10 PM to 4 AM. We realize it as being 4AM the following day, But if you tried to enter it into a time range, it would throw an exception for having an upper bound smaller than the lower bounds.

You might have to use something like int4range to represent minutes or seconds of the day and add some helper functions. So for minutes you'd represent 10 PM to 4 AM as [1320, 1680)


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux