Re: timestamp fields and order by?

Поиск
Список
Период
Сортировка
От Steve Wampler
Тема Re: timestamp fields and order by?
Дата
Msg-id 4B44F92E.1040605@noao.edu
обсуждение исходный текст
Ответ на Re: timestamp fields and order by?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: timestamp fields and order by?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane wrote:
> Your example looks like what's being called is current_timestamp(3),
> or else something on the client side is rounding it off to 3 digits.
> The bare function will give whatever resolution the operating system
> supplies, down to microseconds at best (the limit of the POSIX API for
> this).

Ah - right.  I was assuming the client application was inserting using 'now()'
for the time_stamp field but reviewing the source shows it's building
the timestamp itself.  It's old code.

> Even so, though, I think it would be quite foolish to design an
> application around the assumption that the timestamps of successive
> insertions will be distinguishable.  Put in a serial column.

I'll do that.  I was a bit surprised to see that the sort wasn't
stable, however.  Was that intentional for performance, or just
not considered worth the effort?  (I know I'm better off with the
serial column in my case - just mildly curious).

--
Steve Wampler -- swampler@noao.edu
The gods that smiled on your birth are now laughing out loud.

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

Предыдущее
От: Tim Uckun
Дата:
Сообщение: Re: PostgreSQL Write Performance
Следующее
От: Tom Lane
Дата:
Сообщение: Re: timestamp fields and order by?