X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1C85A5E3632 for ; Thu, 26 Aug 2004 18:12:20 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 20759-06 for ; Thu, 26 Aug 2004 21:12:17 +0000 (GMT) Received: from postfix4-1.free.fr (postfix4-1.free.fr [213.228.0.62]) by svr1.postgresql.org (Postfix) with ESMTP id CF4815E46D4 for ; Thu, 26 Aug 2004 18:12:15 -0300 (ADT) Received: from [192.168.0.15] (lns-th2-11-82-64-164-115.adsl.proxad.net [82.64.164.115]) by postfix4-1.free.fr (Postfix) with ESMTP id 3522417ED23 for ; Thu, 26 Aug 2004 23:12:17 +0200 (CEST) Message-ID: <412E5230.5050603@free.fr> Date: Thu, 26 Aug 2004 23:12:16 +0200 From: Patrice OLIVER User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Pb with insert statement Content-Type: multipart/mixed; boundary="------------010600030107060801030505" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.9 tagged_above=0.0 required=5.0 tests=FROM_ENDS_IN_NUMS, MAILTO_TO_SPAM_ADDR X-Spam-Level: * X-Archive-Number: 200408/293 X-Sequence-Number: 18790 This is a multi-part message in MIME format. --------------010600030107060801030505 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To try to solve my precedent problem (PB with stored procedure), I made this : Table "structure.categtype" Column | Type | Modifiers ---------+----------+----------- catcode | varchar(5) | not null catlib | varchar(35) | Indexes: "pk_categtype" primary key, btree (catcode) Table "structure.types" Column | Type | Modifiers ---------+----------+----------- typcode | varchar(5) | not null catcode | varchar(5) | not null typlib | varchar(50) | Indexes: "pk_type" primary key, btree (typcode, catcode) "type_categorie_fk" btree (catcode) Foreign-key constraints: "fk_type_classe_categtyp" FOREIGN KEY (catcode) REFERENCES structure.categtype(catcode) ON UPDATE RESTRICT ON DELETE RESTRICT Table "structure.uv" Column | Type | Modifiers ----------+----------------------+-------------------------------- uvnum | varchar(5) | not null typcode | varchar(5 | not null catcode | varchar(5) | not null default 'UV'::codeart uvnumnat | numeric(5,0) | uvnom | varchar(50) | uvcycle | character varying(2) | uvvaleur | numeric(5,2) | Indexes: "pk_uv" primary key, btree (uvnum) Foreign-key constraints: "fk_uv_caracteri_type" FOREIGN KEY (typcode, catcode) REFERENCES structure.t ypes(typcode, catcode) ON UPDATE RESTRICT ON DELETE RESTRICT When I try to insert values in structure.uv like this : INSERT INTO structure.uv VALUES ('SGBD','DUVC','UV',0,'BASE DE DONNEES','B2',.5); I get the following message : ERROR: insert or update on table "uv" violates foreign key constraint "fk_uv_caracteri_type" DETAIL: Key (typcode,catcode)=(DUVC,UV) is not present in table "types". Here the related values of structure.types table : typcode | catcode | typlib ---------+---------+---------------------------------------------------------------- UVC | UV | UV+de+cours DUVC | UV | Demi-UV+de+cours UVTP | UV | UV+de+TP DUVTP | UV | Demi-UV+de+TP UVTC | UV | UV+de+TP-Cours DUVTC | UV | Demi-UV+de+TP-Cours Anyone has an idea ? Regards, Patrice --------------010600030107060801030505 Content-Type: text/x-vcard; charset=utf-8; name="oliverp21.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="oliverp21.vcf" begin:vcard fn:Patrice OLIVER n:OLIVER;Patrice email;internet:oliverp21@free.fr x-mozilla-html:FALSE version:2.1 end:vcard --------------010600030107060801030505--