Re: Reference to Inherited Table

From: Chris <csmith(at)squiz(dot)net>
To: Thorsten Haude <postgresql(at)thorstenhau(dot)de>, PostgreSQL Novice ML <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Reference to Inherited Table
Date: 2002-03-24 22:52:05
Message-ID: 5.1.0.14.0.20020325094919.027bf4e0@cooee.cybersydney.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

>create table third
>(
> stuff integer references child
>);
>- - - Schnapp - - -
>But get an error:
>ERROR: PRIMARY KEY for referenced table "child" not found

Try
create table third(
stuff integer references child(thing)
);

You could do what you were trying to do if in the child table you have a
field called 'stuff', but since you don't, you have to reference it
specifically.

-----------------
Chris Smith
http://www.squiz.net/

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Masakazu Ichimura 2002-03-25 09:16:35 Can I see a content of function
Previous Message Tom Lane 2002-03-23 17:08:51 Re: Estimating Database Disk Space