Re: Picking out the most recent row using a time stamp column

Поиск
Список
Период
Сортировка
От Florian Weimer
Тема Re: Picking out the most recent row using a time stamp column
Дата
Msg-id 87r5auwm79.fsf@mid.deneb.enyo.de
обсуждение исходный текст
Ответ на Re: Picking out the most recent row using a time stamp column  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-performance
* Kevin Grittner:

> Dave Crooke <dcrooke@gmail.com> wrote:
>
>> create table data
>>    (id_key int,
>>     time_stamp timestamp without time zone,
>>     value double precision);
>>
>> create unique index data_idx on data (id_key, time_stamp);
>
>> I need to find the most recent value for each distinct value of
>> id_key.
>
> Well, unless you use timestamp WITH time zone, you might not be able
> to do that at all.  There are very few places where timestamp
> WITHOUT time zone actually makes sense.

I don't think PostgreSQL keeps track of actual time zone values, just
as it doesn't keep track of the character encoding of TEXT columns.
Unless suppressed with WITHOUT TIME ZONE, PostgreSQL makes up some
time zone on demand.  This makes TIMESTAMP WITH TIME ZONE not that
useful, and it's often to use TIMESTAMP WITHOUT TIME ZONE with times
in UTC.

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

Предыдущее
От: Dave Johansen
Дата:
Сообщение: Re: Picking out the most recent row using a time stamp column
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Picking out the most recent row using a time stamp column