From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Camila Rocha <camilarrocha@hotmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: oid and oidvector
Date: Mon, 15 Apr 2002 16:36:57 -0400
Message-ID: <26386.1018903017@sss.pgh.pa.us> (raw)
In-Reply-To: <200204151913.g3FJDTi10516@candle.pha.pa.us>
References: <200204151913.g3FJDTi10516@candle.pha.pa.us>
Bruce Momjian <pgman@candle.pha.pa.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, pgman@candle.pha.pa.us, camilarrocha@hotmail.com
Subject: Re: oid and oidvector
In-Reply-To: <26386.1018903017@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox