Foreign key to base table with rows in inherited tables

From: mikael(dot)kjellstrom(at)_no_spam_flygtaxi(dot)se (Mikael Kjellstrm)
To: pgsql-sql(at)postgresql(dot)org
Subject: Foreign key to base table with rows in inherited tables
Date: 2001-06-05 08:23:40
Message-ID: Xns90B769BEA7C30mikaelkjellstromnosp@206.221.255.129
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I've declared a foreign key in table FileId referencing the primary key in
Datafile. Datafile in itself does'nt have any rows, but Reservationfile,
inheriting from Datafile has.

I can't insert a row in FileId because no row is found in Datafile: this is
not what I expected.

I've tried suffixing Datafile with an asterisk (even though that shouldn't
be necessary in 7.1), but that's not valid syntax.

I'm running 7.1.release4 on Debian Woody.

Table definitions for clarity:

-- Has no rows of its own
declare Datafile (
datafileNr not null primary key
);
-- This one has rows
declare Reservationfile (
)
inherits(Datafile)
;
declare FileId (
datafileNr not null
references Datafile
);

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Hans-Jürgen Schönig 2001-06-05 09:18:42 Re: Distinct Values
Previous Message Mikael Kjellstrm 2001-06-05 07:51:11 Cluster and primary key