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 E3EED329C63 for ; Tue, 14 Sep 2004 06:01:01 +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 85690-08 for ; Tue, 14 Sep 2004 05:00:56 +0000 (GMT) Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by svr1.postgresql.org (Postfix) with ESMTP id 62321329C65 for ; Tue, 14 Sep 2004 06:00:53 +0100 (BST) Received: from lfix.demon.co.uk ([80.177.205.209] helo=cerberus.lfix.co.uk) by anchor-post-30.mail.demon.net with esmtp (Exim 3.35 #1) id 1C75Qv-000K65-0U; Tue, 14 Sep 2004 05:00:49 +0000 Received: from linda.lfix.co.uk ([192.168.1.1]) by cerberus.lfix.co.uk with esmtp (Exim 4.34) id 1C75Qr-00068s-PO; Tue, 14 Sep 2004 06:00:45 +0100 Subject: Re: Trigger set to backup to other table NOT FUNCTIONING... From: Oliver Elphick Reply-To: olly@lfix.co.uk To: Joepie Platteau Cc: pgsql-admin@postgresql.org In-Reply-To: <414570D2.9090405@kulak.ac.be> References: <414570D2.9090405@kulak.ac.be> Content-Type: text/plain Organization: LFIX Limited Message-Id: <1095138045.21855.44.camel@linda> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 14 Sep 2004 06:00:45 +0100 Content-Transfer-Encoding: 7bit X-LFIX-MailScanner: Found to be clean X-MailScanner-From: olly@lfix.co.uk X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/118 X-Sequence-Number: 14821 On Mon, 2004-09-13 at 11:05, Joepie Platteau wrote: > 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, ... > CREATE FUNCTION public.f100() RETURNS trigger AS ' > BEGIN > INSERT INTO "T-Alumni-backup" VALUES (NEW.Id_Persoon, NEW.SteunendLid, ^^^^^^^^^^ ... > > I get this error : > Record "new" has no field "id_persoon" (#7) You created it with the column names double quoted so they are really mixed case. However, you are accessing it without the double quotes, so that the name is folded to lower case. Therefore the names don't match. > Also I want to have the name of the person who deleted or changed the > record in my BackUp (undo) table... CURRENT_USER will give you the user id; if that's what you mean. -- Oliver Elphick olly@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA ======================================== "But without faith it is impossible to please him; for he that cometh to God must believe that he is, and that he is a rewarder of them that diligently seek him." Hebrews 11:6