Re: [HACKERS] Re: PRIMARY KEY & INHERITANCE (fwd) - Mailing list pgsql-general

From Stephan Szabo
Subject Re: [HACKERS] Re: PRIMARY KEY & INHERITANCE (fwd)
Date
Msg-id Pine.BSF.4.10.10007190721390.65474-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: [HACKERS] Re: PRIMARY KEY & INHERITANCE (fwd)  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
Of course I had to be half asleep when I wrote the second paragraph of my
response, since I totally missed he was using a serial.  The rest still
applies though...

As an aside to Chris, what interactions do you expect between the OO stuff
you've been working on and foreign key references?  I'm going to have to
muck around with the trigger code to move to storing oids of tables and
attributes rather than names, so I thought it might make sense to at least
think about possible future interactions.

On Tue, 18 Jul 2000, Stephan Szabo wrote:
>
> If you don't specify a set of target columns for the reference, it goes to
> the primary key of the table (if one exists).  If one doesn't we error out
> as shown below.  You can make the reference by saying:
> advert_id int4 not null references advert(id)
> in the definition of table work.
>
> Of course, in this case, I don't even see a primary key being defined on
> either picture or advert, so it's not really the inheritance thing unless
> he also made an index somewhere else (not using unique or primary key on
> the table).
>
> In 7.1, the ability to reference columns that are not constrained to be
> unique will probably go away, but you can also make the index on
> advert(id) to make it happy in that case.


pgsql-general by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Postgres + PHP question: username in pg_connect?
Next
From: Tom Lane
Date:
Subject: Re: tcl/tk interface on Digital Unix