pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Camila Rocha <camilarrocha@hotmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: oid and oidvector
Date: Mon, 15 Apr 2002 16:39:42 -0400 (EDT)
Message-ID: <200204152039.g3FKdhL21970@candle.pha.pa.us> (raw)
In-Reply-To: <26386.1018903017@sss.pgh.pa.us>

Tom Lane wrote:
> 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.

Oh, oh, TODO has:

	* Allow oid to act as a foreign key

So I should mark the item as completed?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



view thread (5+ messages)  latest in thread

Message-ID: <200204152039.g3FKdhL21970@candle.pha.pa.us>
Permalink:  ../200204152039.g3FKdhL21970@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200204152039.g3FKdhL21970@candle.pha.pa.us

 · 

reply

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: pgman@candle.pha.pa.us, tgl@sss.pgh.pa.us, camilarrocha@hotmail.com
  Subject: Re: oid and oidvector
  In-Reply-To: <200204152039.g3FKdhL21970@candle.pha.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