Re: [psycopg] Using infinite values with DateTimeTZRange

Поиск
Список
Период
Сортировка
От Jonathan Rogers
Тема Re: [psycopg] Using infinite values with DateTimeTZRange
Дата
Msg-id c5cdbfa7-d640-4640-d9f1-0ec3ca25d773@emphasys-software.com
обсуждение исходный текст
Ответ на [psycopg] Using infinite values with DateTimeTZRange  ("Fennell, Felix W." <felnne@bas.ac.uk>)
Список psycopg
On 08/20/2017 10:23 AM, Fennell, Felix W. wrote:
> Hi,
>
> Apologies if this isn’t the right place to ask questions like this but I am having difficulty storing ‘infinite’
datesusing the DateTimeTZRange object. 
>
> I have a Postgres database with a ‘tstzrange’ column (named validity) and I’d like to store a value in this similar
to‘[“2010-01-01 10:00:00 +01”, infinity]’. 

While it is not an error to use 'infinity' or '-infinity' in a
tstzrange, since those are acceptable timestamptz values, that is not
the normal way to represent a range which extends infinitely in one
direction. The normal way to represent a range with an infinite upper or
lower bound is to omit the bound, as in '["2010-01-01 10:00:00 +01",]'.

Read the manual for more detail:

https://www.postgresql.org/docs/current/static/rangetypes.html#RANGETYPES-INFINITE

--
Jonathan Rogers
Socialserve.com by Emphasys Software
jrogers@emphasys-software.com


Вложения

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

Предыдущее
От: Aryeh Leib Taurog
Дата:
Сообщение: [psycopg] pgcopy 1.3.0 release announcement
Следующее
От: "Fennell, Felix W."
Дата:
Сообщение: Re: [psycopg] Using infinite values with DateTimeTZRange