Re: Utility of OIDs in postgres - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Utility of OIDs in postgres
Date
Msg-id 20070503070040.GB14495@svana.org
Whole thread Raw
In response to Re: Utility of OIDs in postgres  (Brent Wood <b.wood@niwa.co.nz>)
List pgsql-general
On Thu, May 03, 2007 at 10:58:38AM +1200, Brent Wood wrote:
> As oid is unique across all tables (in fact all database objects), but
> serial is unique within a table, there are odd cases like this where
> using an oid in each table ensures an automatic unique key in the view.
> So oids can be useful.

As pointed out already, this isn't true. However, for the case you
provide you can also use tableoid which uniquely identifies the table.
Thus the combination of a serial primary and table oid is unique across
a single DB.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: C functions under windows
Next
From: Alban Hertroys
Date:
Subject: Re: Update violating constraint