Changes for Foreign Keys from 7.0.3 to 7.1beta? - Mailing list pgsql-general

From Mirko Zeibig
Subject Changes for Foreign Keys from 7.0.3 to 7.1beta?
Date
Msg-id 20001229171644.A2461@picard.inka.de
Whole thread Raw
Responses Re: Changes for Foreign Keys from 7.0.3 to 7.1beta?
List pgsql-general
Hello,
the following script is a simplified excerpt from a database for a
content-management-system:
--- snip ---
\connect template1 postgres
drop database test;
create database test;
\connect test postgres

create table LNG (
   LNG_ID               char(2),
   LNG_NAME             varchar(30),
   primary key (LNG_ID)
)
;

create table OBJ (
   OBJ_ID               integer     not null,
   OBJ_LNG_ID           char(2) constraint FK_OBJ_LNG_ID
                            references LNG(LNG_ID),
   OBJ_CONT             text,
   primary key (OBJ_ID,OBJ_LNG_ID)
)
;

create table RSC (
   RSC_ID               serial,
   RSC_OBJ_ID           integer constraint FK_RSC_OBJ_ID
                               references OBJ(OBJ_ID)
                          on update cascade
                          on delete cascade,
   primary key (RSC_ID)
)
;
--- snap ---

Resources for a page are collected in table RSC, language-dependancy is
resolved by combining OBJ_LNG_ID and OBJ_ID.
Now run in 7.0.3 (RedHat 7.0-RPMs) this script will do without problems,
however with 7.1beta (CVS updated on 12-28-2000) I get:
ERROR:  UNIQUE constraint matching given keys for referenced table "obj" not
found
Do I have to have a UNIQUE index for OBJ_ID then? Well, I do not see the
point why this has to be.

Any hints?

Best Regards
Mirko


pgsql-general by date:

Previous
From: Alfred Perlstein
Date:
Subject: Re: MySQL and PostgreSQL speed compare
Next
From: "Jarmo Paavilainen"
Date:
Subject: SV: MySQL and PostgreSQL speed compare