Foreign key referencing subclasses.

From: Johannes Grødem <johs(at)copyleft(dot)no>
To: pgsql-sql(at)postgresql(dot)org
Subject: Foreign key referencing subclasses.
Date: 2001-03-22 14:18:47
Message-ID: 20010322151847.A26189@unity.copyleft.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2001-03-22 14:42:12 Re: how to build this string ?
Previous Message juerg.rietmann 2001-03-22 14:05:51 how to build this string ?