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

Reference to Inherited Table

From: Thorsten Haude <postgresql(at)thorstenhau(dot)de>
To: PostgreSQL Novice ML <pgsql-novice(at)postgresql(dot)org>
Subject: Reference to Inherited Table
Date: 2002-03-23 12:37:51
Message-ID: 20020323123751.GA923@eumel.yoo.net (view raw or flat)
Thread:
Lists: pgsql-novice
Hi,

I want to reference an inherited table:
- - - Schnipp - - -
create table parent
(
    id  serial,
    primary key(id)
);

create table child
(
    thing integer
) inherits (parent);

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

Is there a way to do it or do I have to reference parent?

tia,
Thorsten
-- 
Auch Hunger ist Krieg.
	- Willy Brandt

Responses

pgsql-novice by date

Next:From: Richard A LoughDate: 2002-03-23 15:40:32
Subject: Re: Estimating Database Disk Space
Previous:From: John TaylorDate: 2002-03-22 19:41:58
Subject: Re: Visio ODBC winnt Linux question

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