Re: [SQL] Foreign key referencing subclasses.

2001-03-23 Thread Johannes Grødem
>> CREATE TABLE resource_record( >> rrid SERIAL >> -- etc. >> ); > There is no primary key for this table. Just write PRIMARY KEY after > SERIAL. There is. I accidentally left it out in the post. > CREATE INDEX soa_record_pkey ON soa_record ( rrid ); > You could also state the referenced f

Re: [SQL] Foreign key referencing subclasses.

2001-03-22 Thread Stephan Szabo
On Thu, 22 Mar 2001, [iso-8859-1] Johannes Grødem wrote: > 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. Unique/primary key doesn't inherit to subclasses.

Re: [SQL] Foreign key referencing subclasses.

2001-03-22 Thread Christof Glaser
Hi Johannes, On Thursday, 22. March 2001 15:18, Johannes Grødem wrote: > 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: > > CR

[SQL] Foreign key referencing subclasses.

2001-03-22 Thread Johannes Grødem
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( -- b