Re: Effecient time ranges in 9.4/9.5?

Поиск
Список
Период
Сортировка
От Karsten Hilbert
Тема Re: Effecient time ranges in 9.4/9.5?
Дата
Msg-id 20151004111812.GB3123@hermes.hilbert.loc
обсуждение исходный текст
Ответ на Re: Effecient time ranges in 9.4/9.5?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Effecient time ranges in 9.4/9.5?
Список pgsql-general
On Fri, Oct 02, 2015 at 10:06:55AM -0400, Tom Lane wrote:

> The problem you'll have in defining timetzrange is that you first need to
> invent a "timetz - timetz" operator, which doesn't exist as a builtin
> function because the behavior seems not well-defined.  What would you do
> with the timezone fields?

You'd

    check whether both TZs are equal,
    if so
        ignore them
    else
        convert both operands to UTC,
    do "time - time",
    return result AT TIME ZONE UTC,
    document that UTC is returned,

such that the user can know to apply "AT TIME ZONE ..."
to the result as needed.

That's not to say anything against the validity of your
other points :-)

Karsten
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346


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

Предыдущее
От: Madovsky
Дата:
Сообщение: Re: Replication with 9.4
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: postgresql doesn't start