timestamp as primary key? - Mailing list pgsql-general

From Joe Kramer
Subject timestamp as primary key?
Date
Msg-id b4c00a110610190413q1559c2ffubc90d3c5d6679021@mail.gmail.com
Whole thread Raw
Responses Re: timestamp as primary key?
Re: timestamp as primary key?
List pgsql-general
Hello,

I have table for online chat system that keep messages sent between users.

CREATE TABLE chat_message
(
  message_time timestamp without time zone NOT NULL DEFAULT now(),
  message_body text,
  user_id_from bigint,
  user_id_to bigint,
  CONSTRAINT chat_message_pkey PRIMARY KEY (message_time)
)
WITHOUT OIDS;

I don't want to add int primary key because I don't ever need to find
messages by unique id.

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.


Thanks.

pgsql-general by date:

Previous
From: "Rodrigo Sakai"
Date:
Subject: Interval referential integrity
Next
From: Tomasz Ostrowski
Date:
Subject: Re: timestamp as primary key?