From: scott.marlowe <scott.marlowe@ihs.com>
To: Zhidian Du <duzhidian@hotmail.com>
Cc: pgsql-php@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Parent table has not oid?
Date: Tue, 12 Nov 2002 10:12:39 -0700 (MST)
Message-ID: <Pine.LNX.4.33.0211121011440.24725-100000@css120.ihs.com> (raw)
In-Reply-To: <8821.1036936224@sss.pgh.pa.us>
On Sun, 10 Nov 2002, Tom Lane wrote:
> "Zhidian Du" <duzhidian@hotmail.com> writes:
> > CREATE TABLE Link (
> > Protein_ID oid
> > CONSTRAINT one
> > REFERENCES Protein (oid)
> > ON DELETE CASCADE,
> > Link varchar(128)
> > );
> > When I insert a record into this child table, it says
> > "ERROR: constraint one: table protein does not have an attribute oid"
>
> How old is your Postgres?
>
> IIRC, this was made to work in 7.2 or thereabouts.
>
> Note that using OID as a foreign key is not really a good idea, because
> it's problematic to dump and restore. You'd be better off with a serial
> column as primary key.
Yeah, I found that out the hardway and spent a couple days rewriting an
app that had used OIDs in a way it really shouldn't have.
The only time I use OIDs now is to get rid of duplicate rows by hand or
such like that.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: scott.marlowe@ihs.com, duzhidian@hotmail.com, pgsql-php@postgresql.org
Subject: Re: [SQL] Parent table has not oid?
In-Reply-To: <Pine.LNX.4.33.0211121011440.24725-100000@css120.ihs.com>
References: <8821.1036936224@sss.pgh.pa.us> <Pine.LNX.4.33.0211121011440.24725-100000@css120.ihs.com>
* 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