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 C994F329E4C for ; Tue, 14 Sep 2004 08:43:54 +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 33700-06 for ; Tue, 14 Sep 2004 07:43:46 +0000 (GMT) Received: from rusty.kulnet.kuleuven.ac.be (rusty.kulnet.kuleuven.ac.be [134.58.240.42]) by svr1.postgresql.org (Postfix) with ESMTP id ABC5D329C67 for ; Tue, 14 Sep 2004 08:43:46 +0100 (BST) Received: from localhost (localhost [127.0.0.1]) by rusty.kulnet.kuleuven.ac.be (Postfix) with ESMTP id 4B5431D71CA; Tue, 14 Sep 2004 09:43:45 +0200 (CEST) Received: from antonius.kulnet.kuleuven.ac.be (antonius.kulnet.kuleuven.ac.be [134.58.240.73]) by rusty.kulnet.kuleuven.ac.be (Postfix) with ESMTP id 98D061D7216; Tue, 14 Sep 2004 09:43:43 +0200 (CEST) Received: from velox.kulak.ac.be (david.kulak.ac.be [193.190.176.1]) by antonius.kulnet.kuleuven.ac.be (Postfix) with ESMTP id 7C0E54C2C5; Tue, 14 Sep 2004 09:43:43 +0200 (CEST) Received: from kulak.ac.be (pd176092.kulak.ac.be [193.190.176.92]) by velox.kulak.ac.be (Postfix) with ESMTP id DED01F02E; Tue, 14 Sep 2004 09:43:42 +0200 (CEST) Message-ID: <4146A12F.8070105@kulak.ac.be> Date: Tue, 14 Sep 2004 09:43:43 +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: olly@lfix.co.uk Cc: pgsql-admin@postgresql.org Subject: Re: Trigger set to backup to other table NOT FUNCTIONING... References: <414570D2.9090405@kulak.ac.be> <1095138045.21855.44.camel@linda> Content-Type: multipart/alternative; boundary="------------040301010906080305040506" X-Virus-Scanned: by KULeuven Antivirus Cluster X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.0 tagged_above=0.0 required=5.0 tests=HTML_20_30, HTML_MESSAGE, HTML_TITLE_EMPTY X-Spam-Level: * X-Archive-Number: 200409/120 X-Sequence-Number: 14823 --------------040301010906080305040506 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Thank you very much!!! Indeed this was the problem... If I 'd once see you in a pub, I'd buy you a drink!! Joepie. Oliver Elphick wrote: >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. > > > --------------040301010906080305040506 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Thank you very much!!!
Indeed this was the problem...

If I 'd once see you in a pub, I'd buy you a drink!!
Joepie.

Oliver Elphick wrote:
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.

  

--------------040301010906080305040506--