Re: Better alternative for Primary Key then serial??

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pilzner <belisarius23(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Better alternative for Primary Key then serial??
Date: 2007-12-12 15:48:25
Message-ID: 20071212154825.GF7925@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

pilzner wrote:

> Does stuff like this cause any aches and pains to developers out there, or
> do I just need to get in a new mindset??? Also, is there a way to be sure
> the primary key is *ONLY* ever given a value by serial, and not subject to
> updates???

It doesn't. Just do not update the ID -- what use do you have for that
anyway? If you want to prevent it, you can put a trigger to the column,
but IMHO it would be a waste of your time and machine resources.

--
Alvaro Herrera http://www.flickr.com/photos/alvherre/
"Vivir y dejar de vivir son soluciones imaginarias.
La existencia está en otra parte" (Andre Breton)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2007-12-12 15:50:36 Re: How can I insert NULL into column with the type of timestamp?
Previous Message Collin Kidder 2007-12-12 15:46:50 Re: Would it be OK if I put db file on a ext2 filesystem?