Re: Can't figure out how to use now() in default for tsrange column (PG 9.2)

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Can't figure out how to use now() in default for tsrange column (PG 9.2)
Дата
Msg-id 5017C31702000025000492D3@gw.wicourts.gov
обсуждение исходный текст
Ответ на Re: Can't figure out how to use now() in default for tsrange column (PG 9.2)  (Chris Bartlett <c.bartlett@paradise.net.nz>)
Список pgsql-general
Chris Bartlett <c.bartlett@paradise.net.nz> wrote:

> my column is a timestamp without time zone.

In spite of the fact that this was sort of tangential to you primary
question, I'm a little surprised that nobody responded to this
point.  There are very, very few situations where the semantics of
TIMESTAMP WITHOUT TIME ZONE are really what people want; you should
seriously consider using TIMESTAMP WITH TIME ZONE.  In PostgreSQL
neither one actually stores a time zone; the difference is that WITH
TIME ZONE it represents a particular moment in a continuous stream
of time, while WITHOUT TIME ZONE the value can be interpreted to be
any of various times depending on the time zone of the reader.
WITHOUT TIME ZONE you will see time jump around at daylight saving
time boundaries, and you will tend to have ambiguous times after the
clock has moved backward, where you can't tell what actual moment is
intended.

As you noted, now() is TIMESTAMP WITH TIME ZONE -- it has to be,
because it represents a moment in time.

-Kevin

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

Предыдущее
От: Rajeev rastogi
Дата:
Сообщение: Regarding pgTAP
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Regarding pgTAP