From: Bart Degryse <Bart.Degryse@indicator.be>
To: pgsql-sql@postgresql.org
Subject: plpgsql and triggers
Date: Thu, 02 Jun 2005 13:57:26 +0200
Message-ID: <s29f1053.094@webaccess.indicator.be> (raw)
I'm looking for a way to use a parameter given to a trigger function as
fieldname. It should be something like
create function f_makeupper() returns trigger as '
begin
NEW.TG_ARGV[0] := upper(NEW.TG_ARGV[0]);
RETURN NEW;
end;
' language 'plpgsql';
create trigger "TRIG_tbltest" before insert on tbltest for each row
execute procedure f_makeupper("fieldname");
I can create both the function and the trigger, but on inserting a new
record I get an error telling me that "record 'new' has no field
'tg_argv'"
What am I doing wrong ?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: Bart.Degryse@indicator.be
Subject: Re: plpgsql and triggers
In-Reply-To: <s29f1053.094@webaccess.indicator.be>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox