Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6F99A4759F2; Wed, 6 Nov 2002 07:47:57 -0500 (EST) Received: from matrix.gatewaynet.com (unknown [217.19.69.50]) by postgresql.org (Postfix) with ESMTP id 37FF7475E18; Wed, 6 Nov 2002 07:47:55 -0500 (EST) Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.11.6/8.11.6) with ESMTP id gA6CrLv05950; Wed, 6 Nov 2002 14:53:21 +0200 Date: Wed, 6 Nov 2002 14:53:21 +0200 (EET) From: Achilleus Mantzios To: pgsql-sql@postgresql.org Cc: pgsql-general@postgresql.org, Subject: Re: [SQL] Problem: Referential Integrity Constraints lost In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/190 X-Sequence-Number: 32611 Also i must that these lost triggers implement the parent table side of the constraint, e.g. CREATE TABLE VslSections( id serial NOT NULL UNIQUE PRIMARY KEY, name varchar(20) NOT NULL UNIQUE); CREATE TABLE MachClasses( id serial NOT NULL UNIQUE PRIMARY KEY, name varchar(20) NOT NULL UNIQUE, vslsecid int4 NOT NULL, FOREIGN KEY (vslsecid) REFERENCES VslSections (id)); Then the triggers created are : 1) CREATE CONSTRAINT TRIGGER "" AFTER INSERT OR UPDATE ON "machclasses" FROM "vslsections" NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE "RI_FKey_check_ins" ('', 'machclasses', 'vslsections', 'UNSPECIFIED', 'vslsecid', 'id'); 2) CREATE CONSTRAINT TRIGGER "" AFTER DELETE ON "vslsections" FROM "machclasses" NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE "RI_FKey_noaction_del" ('', 'machclasses', 'vslsections', 'UNSPECIFIED', 'vslsecid', 'id'); 3) CREATE CONSTRAINT TRIGGER "" AFTER UPDATE ON "vslsections" FROM "machclasses" NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE "RI_FKey_noaction_upd" ('', 'machclasses', 'vslsections', 'UNSPECIFIED', 'vslsecid', 'id'); The *LOST* triggers are 2 and 3. ================================================================== Achilleus Mantzios S/W Engineer IT dept Dynacom Tankers Mngmt Nikis 4, Glyfada Athens 16610 Greece tel: +30-10-8981112 fax: +30-10-8981877 email: achill@matrix.gatewaynet.com mantzios@softlab.ece.ntua.gr