Skip site navigation (1) Skip section navigation (2)

Changes for Foreign Keys from 7.0.3 to 7.1beta?

From: Mirko Zeibig <mirko(at)picard(dot)inka(dot)de>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Changes for Foreign Keys from 7.0.3 to 7.1beta?
Date: 2000-12-29 16:16:44
Message-ID: 20001229171644.A2461@picard.inka.de (view raw or flat)
Thread:
Lists: 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


Responses

pgsql-general by date

Next:From: Stephan SzaboDate: 2000-12-29 16:41:00
Subject: Re: Changes for Foreign Keys from 7.0.3 to 7.1beta?
Previous:From: Alfred PerlsteinDate: 2000-12-29 15:46:08
Subject: Re: MySQL and PostgreSQL speed compare

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group