RE: OID as Primary Key

From: "Jonas Bengtsson" <jonas(dot)b(at)home(dot)se>
To: <pgsql-general(at)postgresql(dot)org>
Subject: RE: OID as Primary Key
Date: 2001-03-22 17:17:27
Message-ID: NEBBLNLDOLDEJIKDPCBOMEDNCDAA.jonas.b@home.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Why doesn't PostgreSQL has the same feature as MySQL (auto_increment) when
dealing with PK? In nearly every relation I use a SERIAL.
In PHP with MySQL you just use mysql_insert_id() instead of double queries.

I have to admit that I like PostgreSQL a lot more than MySQL. Is there any
good, objective, comparison between these to available? I'm mostly
interested in the performance.

/Jonas B

-----Original Message-----
From: Stephan Szabo [mailto:sszabo(at)megazone23(dot)bigpanda(dot)com]
Sent: Thursday, March 22, 2001 6:09 PM
To: Jonas Bengtsson
Cc: pgsql-general(at)postgresql(dot)org
Subject: RE: [GENERAL] OID as Primary Key

You can create indexes on them. It's specifically
a limitation in the fk related code. IIRC, there
were a couple of places in the triggers that
would fail on execution if you tried to reference
oid, so it now fails on creation rather than
execution of constraints. There are a bunch
of things that need to get done to those triggers
anyway, so possibly for 7.2.

On Thu, 22 Mar 2001, Jonas Bengtsson wrote:

> But why doesn't PostgreSQL complain when a create a unique index on oid? I
> think it is quite confusing..

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2001-03-22 17:18:51 Re: creating a trigger to write to a different table
Previous Message Richard Huxton 2001-03-22 17:12:59 Re: Foreign keys/unique values and views