Re: Creating foreign key constraint to child table?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Allan Engelhardt <allane(at)cybaea(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Creating foreign key constraint to child table?
Date: 2001-08-05 19:20:11
Message-ID: Pine.BSF.4.21.0108051218300.25692-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Sun, 5 Aug 2001, Allan Engelhardt wrote:

> test=# create table baz(bar integer, constraint fk_bar foreign key (bar) references foo(id));
> NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
> CREATE
>
> but this is not exactly what I want: I need to ensure that baz.bar is
> a bar and not just any foo.
>

Not that this is related to what you asked about precisely (I saw the
response you made), but the query above also doesn't do what you think
it does right now. It currently makes a reference to only foo, not
any subchildren of foo.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Allan Engelhardt 2001-08-05 19:55:48 Re: Creating foreign key constraint to child table?
Previous Message Allan Engelhardt 2001-08-05 13:03:05 Re: Creating foreign key constraint to child table?