Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group