Re: Range-Types in 9.2

Поиск
Список
Период
Сортировка
От Scott Bailey
Тема Re: Range-Types in 9.2
Дата
Msg-id 501D819D.7020506@gmail.com
обсуждение исходный текст
Ответ на Range-Types in 9.2  (Andreas Kretschmer <andreas@a-kretschmer.de>)
Список pgsql-general
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)


В списке pgsql-general по дате отправления:

Предыдущее
От: Menelaos PerdikeasSemantix
Дата:
Сообщение: maximum number of databases and / or schemas in a single database instance
Следующее
От: "Mary F. Masterson"
Дата:
Сообщение: Pgadmin3 v1.14.2 foreign keys