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: (view raw or whole thread)
Lists: pgsql-novice

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?

Auch Hunger ist Krieg.
	- Willy Brandt


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-2015 The PostgreSQL Global Development Group