X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 14293D1C514 for ; Fri, 8 Aug 2003 08:18:08 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 98806-04 for ; Fri, 8 Aug 2003 05:16:41 -0300 (ADT) Received: from neptune.adelis.net (neptune.adelis.net [195.115.171.102]) by svr1.postgresql.org (Postfix) with ESMTP id 068FFD1C4CA for ; Fri, 8 Aug 2003 05:17:56 -0300 (ADT) Received: from icqmail.com (ben.adelis.net [195.115.171.16]) by neptune.adelis.net (Postfix) with ESMTP id DEC66794A6 for ; Fri, 8 Aug 2003 10:05:46 +0200 (CEST) Message-ID: <3F335BC7.7070800@icqmail.com> Date: Fri, 08 Aug 2003 10:13:59 +0200 From: BenLaKnet User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.2.1) Gecko/20030225 X-Accept-Language: fr, en-us, en, ja MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: [pg-sql] - Problem with duplicate table (PostgreSQL 7.2.3 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/69 X-Sequence-Number: 14685 I have to duplicate a table to save different instances of datas. Structure de la table "spectacle" -------------------------------------------------------- */ CREATE TABLE "spectacle" ( id_spectacle SERIAL, "id_membre_adherent" INTEGER NOT NULL, "id_genre_festival" INTEGER, "id_festival" INTEGER, "nom" VARCHAR(255), "compagnie_interprete" VARCHAR(255), "vitaculture" INTEGER NOT NULL, "regionales" INTEGER NOT NULL, "presentation" TEXT, "genre_precision" VARCHAR(255), "duree" VARCHAR(255), "photo1" VARCHAR(255), "photo1_credit" VARCHAR(255), "photo2" VARCHAR(255), "photo2_credit" VARCHAR(255), "salle" TEXT, "tarifs" TEXT, "id_traitement" INTEGER DEFAULT 1, "distribution" TEXT, "type_public" VARCHAR(255), PRIMARY KEY("id_spectacle"), FOREIGN KEY ("id_festival") REFERENCES "festival"("id_festival") ON DELETE RESTRICT ON UPDATE RESTRICT NOT DEFERRABLE, FOREIGN KEY ("id_genre_festival") REFERENCES "genre_festival"("id_genre_festival") ON DELETE RESTRICT ON UPDATE RESTRICT NOT DEFERRABLE, FOREIGN KEY ("id_membre_adherent") REFERENCES "membre_adherent"("id_membre_adherent") ON DELETE CASCADE ON UPDATE RESTRICT NOT DEFERRABLE, FOREIGN KEY ("id_traitement") REFERENCES "traitement"("id_traitement") ON DELETE RESTRICT ON UPDATE RESTRICT NOT DEFERRABLE ) WITH OIDS; CREATE INDEX "adherant_spectacle_fk" ON "spectacle" USING btree ("id_membre_adherent"); CREATE INDEX "genre_spectacle_fk" ON "spectacle" USING btree ("id_genre_festival"); CREATE INDEX "spectacle_au_festival_fk" ON "spectacle" USING btree ("id_festival"); When I duplicate this code in an other table named spectacle_v without Foreygn key ... all is running. But when I try to delete a spectacle_membre, linked value in spectacle are correctly deleted, but I have an error for spectacle_v which is not linked : (ERROR: referential integrity violation - key in membre_adherent still referenced from spectacle_v ) I do not understand this message error, because any foreign key is referenced with this table.