X-Original-To: pgsql-admin@postgresql.org Received: from localhost.localdomain (50-126-125.leased.cust.tie.cl [200.50.126.125]) by postgresql.org (Postfix) with ESMTP id 9200C476356 for ; Tue, 18 Mar 2003 11:29:02 -0500 (EST) Received: from localhost.localdomain (lautaro [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.5) with ESMTP id h2IGWt3m001278 for ; Tue, 18 Mar 2003 12:32:55 -0400 Received: (from apache@localhost) by localhost.localdomain (8.12.8/8.12.5/Submit) id h2IGWsEd001276; Tue, 18 Mar 2003 12:32:54 -0400 X-Authentication-Warning: localhost.localdomain: apache set sender to mario_soto@compuall.cl using -f Received: from 192.168.1.100 (SquirrelMail authenticated user mario_soto) by www.compuall.cl with HTTP; Tue, 18 Mar 2003 12:32:54 -0400 (CLT) Message-ID: <2132.192.168.1.100.1048005174.squirrel@www.compuall.cl> Date: Tue, 18 Mar 2003 12:32:54 -0400 (CLT) Subject: PROBLEM WITH FOREIGN KEY From: "Mario Alberto Soto Cordones" To: X-Priority: 1 Importance: High X-Mailer: SquirrelMail (version 1.2.10) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200303/287 X-Sequence-Number: 7927 hi. i have a big problem... i have created a 2 table cumacar and cumaasi, the structure is CUMACAR cuidcar char(2) cucodcar numeric(2) cudescar varchar(35) cuempcar numeric(2) primary key (cucodcar, cuempcar) CUMAASI cucodasi numeric 3 cudesasi varchar 60 cucarasi numeric 2 cuempasi numeric 2 primary key (cucarasi, cucodasi, cuempasi) i try create a foreing key and say: Error - /var/www/html/phpPgAdmin/sql.php -- Line: 112 PostgreSQL ha dicho: ERROR: cumaasi_fk_cumacar referential integrity violation - key referenced from cumaasi not found in cumacar Your query: ALTER TABLE cumaasi ADD CONSTRAINT cumaasi_fk_cumacar FOREIGN KEY(cucarasi, cuempasi) REFERENCES cumacar (cucodcar, cuempcar) PLEASE HELP ME sorry for my englis... i live in chile... thank you