Foreign key referencing subclasses. - Mailing list pgsql-sql

From Johannes Grødem
Subject Foreign key referencing subclasses.
Date
Msg-id 20010322151847.A26189@unity.copyleft.no
Whole thread Raw
Responses Re: Foreign key referencing subclasses.  (Christof Glaser <gcg@gl.aser.de>)
Re: Foreign key referencing subclasses.  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-sql
Hi,

it seems I can't have a foreign key that references some subclass.  Postgres
says it can't figure out what its primary key is.  The primary key is defined
in the superclass.

I have something like this:

CREATE TABLE resource_record( rrid SERIAL -- etc.
);

CREATE TABLE soa_record( -- blah, blah
) INHERITS(resource_record);

CREATE TABLE domain( -- ... soaid REFERENCES soa_record  -- *
);


* = This doesn't work. I can reference resource_record here, but I can not   reference soa_record that way. Referencing
resource_record*doesn't work   either.
 

-- 
johs


pgsql-sql by date:

Previous
From: "Richard Huxton"
Date:
Subject: Re: creating "job numbers"
Next
From: Antti Linno
Date:
Subject: Birthday search.