Re: Utility of OIDs in postgres

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Brent Wood <b(dot)wood(at)niwa(dot)co(dot)nz>
Cc: Richard Huxton <dev(at)archonet(dot)com>, Jasbinder Singh Bali <jsbali(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Utility of OIDs in postgres
Date: 2007-05-03 07:00:40
Message-ID: 20070503070040.GB14495@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2007-05-03 08:13:07 Re: Update violating constraint
Previous Message Magnus Hagander 2007-05-03 05:46:58 Re: C functions under windows