Re: oid and oidvector

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Camila Rocha <camilarrocha(at)hotmail(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: oid and oidvector
Date: 2002-04-15 20:36:57
Message-ID: 26386.1018903017@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> No, you can't use oid as a foreign key. You must use a PRIMARY column.

Oh?

regression=# create table foo(f1 int);
CREATE
regression=# create unique index fooi on foo(oid);
CREATE
regression=# create table bar (ref oid references foo(oid));
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
CREATE
regression=#

I agree with the advice *not* to do this, but that doesn't mean it can't
be done.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 2002-04-15 20:39:42 Re: oid and oidvector
Previous Message Travis Hoyt 2002-04-15 20:17:10 Re: MAX(column1),MAX(column2),...