X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3B697329C63 for ; Mon, 13 Sep 2004 11:05:15 +0100 (BST) 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 24939-01 for ; Mon, 13 Sep 2004 10:05:09 +0000 (GMT) Received: from spoetnik.kulnet.kuleuven.ac.be (spoetnik.kulnet.kuleuven.ac.be [134.58.240.46]) by svr1.postgresql.org (Postfix) with ESMTP id 1C1F6329DB3 for ; Mon, 13 Sep 2004 11:05:09 +0100 (BST) Received: from localhost (localhost [127.0.0.1]) by spoetnik.kulnet.kuleuven.ac.be (Postfix) with ESMTP id A0CC733EAD for ; Mon, 13 Sep 2004 12:05:07 +0200 (CEST) Received: from antonius.kulnet.kuleuven.ac.be (antonius.kulnet.kuleuven.ac.be [134.58.240.73]) by spoetnik.kulnet.kuleuven.ac.be (Postfix) with ESMTP id 0D94F33E80 for ; Mon, 13 Sep 2004 12:05:06 +0200 (CEST) Received: from velox.kulak.ac.be (ns.kulak.ac.be [193.190.176.1]) by antonius.kulnet.kuleuven.ac.be (Postfix) with ESMTP id F19874C0D1 for ; Mon, 13 Sep 2004 12:05:05 +0200 (CEST) Received: from kulak.ac.be (pd176092.kulak.ac.be [193.190.176.92]) by velox.kulak.ac.be (Postfix) with ESMTP id 8455BF02E for ; Mon, 13 Sep 2004 12:05:05 +0200 (CEST) Message-ID: <414570D2.9090405@kulak.ac.be> Date: Mon, 13 Sep 2004 12:05:06 +0200 From: Joepie Platteau User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: nl, en-us, en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Trigger set to backup to other table NOT FUNCTIONING... Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by KULeuven Antivirus Cluster X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200409/114 X-Sequence-Number: 14817 Hi, I have a problem with my trigger... : my tables : CREATE TABLE public."T-Alumni" ( "Id_Persoon" int8 DEFAULT nextval('"T-Alumni_Id_Persoon_seq"'::text) NOT NULL, "SteunendLid" bool, "Betaald" bool, "Stamnr" int4, "Alumninr" int4, "Acjaar" varchar(50), "Studiejaar" varchar(50), CONSTRAINT "T-Alumni_pkey" PRIMARY KEY ("Id_Persoon") ) WITH OIDS; CREATE TABLE public."T-Alumni-backup" ( "Id_Persoon" int8 NOT NULL, "SteunendLid" bool, "Betaald" bool, "Stamnr" int4, "Alumninr" int4, "Acjaar" varchar(50), "Studiejaar" varchar(50) ) WITH OIDS; i have a table (T-Alumni) and BEFORE a record changes or is being deleted, I want to copy this record to a UNDO_table (T-Alumni-backup). I tried like this : CREATE FUNCTION public.f100() RETURNS trigger AS ' BEGIN INSERT INTO "T-Alumni-backup" VALUES (NEW.Id_Persoon, NEW.SteunendLid, NEW.Betaald, NEW.Stamnr, NEW.Alumninr, NEW.Acjaar, NEW.Studiejaar); RETURN NEW; END; ' LANGUAGE 'plpgsql' VOLATILE; CREATE TRIGGER t100t BEFORE DELETE OR UPDATE ON public."T-Alumni" FOR EACH ROW EXECUTE PROCEDURE f100(); I get this error : Record "new" has no field "id_persoon" (#7) Also I want to have the name of the person who deleted or changed the record in my BackUp (undo) table... Can someone tell me how to solve this problem? Thanx! Joepie.