Re: timestamp fields and order by?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steve Wampler <swampler(at)noao(dot)edu>
Cc: Postgres-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: timestamp fields and order by?
Date: 2010-01-06 20:46:39
Message-ID: 26079.1262810799@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Steve Wampler <swampler(at)noao(dot)edu> writes:
> It appears as though the timestamp resolution is now low
> enough that it cannot keep up with the speed at which
> items can be inserted.

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).

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.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Uckun 2010-01-06 20:46:51 Re: PostgreSQL Write Performance
Previous Message Tom Lane 2010-01-06 20:29:05 Re: FM format modifier does not remove leading zero from year