X-Original-To: pgsql-admin@postgresql.org Received: from gsy_sbs_1.cisx.com (unknown [213.133.202.58]) by postgresql.org (Postfix) with ESMTP id BAA08475EBB for ; Tue, 18 Mar 2003 11:46:53 -0500 (EST) Received: from DEMOLITION ([192.168.100.22]) by gsy_sbs_1.cisx.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id HFQCN6Q3; Tue, 18 Mar 2003 16:39:56 -0000 Message-ID: <007201c2ed6e$825e7890$1664a8c0@DEMOLITION> From: "Donald Fraser" To: "[ADMIN]" , "Mario Alberto Soto Cordones" References: <2132.192.168.1.100.1048005174.squirrel@www.compuall.cl> Subject: Re: PROBLEM WITH FOREIGN KEY Date: Tue, 18 Mar 2003 16:50:35 -0000 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_006F_01C2ED6E.7F5C8330" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Archive-Number: 200303/288 X-Sequence-Number: 7928 This is a multi-part message in MIME format. ------=_NextPart_000_006F_01C2ED6E.7F5C8330 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable >> PostgreSQL ha dicho: ERROR: cumaasi_fk_cumacar referential integrity vio= lation - key referenced from cumaasi not found in cumacar The message is telling you that it cannot create the constraint because dat= a in the two tables causes a referential integrity violation. That is there is data in a record for table CUMAASI for columns cucarasi an= d cuempasi that cannot be matched to a record for table CUMACAR for columns= cucodcar and cuempcar. Regards Donald Fraser ----- Original Message -----=20 From: Mario Alberto Soto Cordones=20 To: pgsql-admin@postgresql.org=20 Sent: Tuesday, March 18, 2003 4:32 PM Subject: [ADMIN] PROBLEM WITH FOREIGN KEY 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 ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html ------=_NextPart_000_006F_01C2ED6E.7F5C8330 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
>> PostgreSQL ha dicho: ERROR: cumaasi_fk_cumacar referential=20 integrity violation - key referenced from cumaasi not found in cumacar
 
The message is telling you that it cannot = create=20 the constraint because data in the two tables causes a referential integrit= y=20 violation.
That is there is data in a record for tabl= e CUMAASI for columns cucarasi and cue= mpasi=20 that cannot be matched to a record for table CUMACAR for columns cucod= car=20 and cuempcar.
 
Regards
Donald Fraser
----- Original Message -----
Fro= m:=20 = Mario=20 Alberto Soto Cordones
Sent: Tuesday, March 18, 2003 4:32= =20 PM
Subject: [ADMIN] PROBLEM WITH FORE= IGN=20 KEY

hi.

i have a big problem...=

i=20 have created a 2 table cumacar and cumaasi,

the structure=20 is

CUMACAR

cuidcar   char(2)
cucodcar =20 numeric(2)
cudescar  varchar(35)
cuempcar =20 numeric(2)
primary key (cucodcar,=20 cuempcar)


CUMAASI

cucodasi  numeric =20 3
cudesasi  varchar  60
cucarasi  numeric =20 2
cuempasi  numeric  2
primary key (cucarasi, cucodasi,= =20 cuempasi)

i try create a foreing key and say:

Error -=20 /var/www/html/phpPgAdmin/sql.php -- Line: 112
PostgreSQL ha dicho: ERR= OR:=20 cumaasi_fk_cumacar referential integrity
violation - key referenced fr= om=20 cumaasi not found in cumacar
Your query:
ALTER TABLE cumaasi
ADD= =20 CONSTRAINT cumaasi_fk_cumacar
FOREIGN KEY(cucarasi,=20 cuempasi)
REFERENCES
cumacar (cucodcar, cuempcar)


PLEASE= HELP=20 ME

sorry for my englis... i live in chile...

thank=20 you











----------------------= -----(end=20 of broadcast)---------------------------
TIP 5: Have you checked our= =20 extensive FAQ?

http://www.postgres= ql.org/docs/faqs/FAQ.html
------=_NextPart_000_006F_01C2ED6E.7F5C8330--