Re: timestamp as primary key?

From: Tomasz Ostrowski <tometzky(at)batory(dot)org(dot)pl>
To: Joe Kramer <cckramer(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: timestamp as primary key?
Date: 2006-10-19 11:27:15
Message-ID: 20061019112713.GA12073@batory.org.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 19 Oct 2006, Joe Kramer wrote:

> Question: is it okay to use timestamp as primary key, or there is
> possibility of collision? (Meaning two processes may INSERT into table
> within same millisecond.) It is a web application.

If your insert fail you can always try again after some random short
time. Just do that several times and if it fails, say, 5 times
show an error to a user (sugest him to try a lottery - he'll surely
win ;-) ).

Regards
Tometzky
--
...although Eating Honey was a very good thing to do, there was a
moment just before you began to eat it which was better than when you
were...
Winnie the Pooh

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Bauer 2006-10-19 11:57:56 Overload after some minutes, please help!
Previous Message Joe Kramer 2006-10-19 11:13:31 timestamp as primary key?