trigger parameters, what am I doing wrong ?? - Mailing list pgsql-sql

From Marcin Krawczyk
Subject trigger parameters, what am I doing wrong ??
Date
Msg-id 95f6bf9b0810090011w12b9d97p76bc81f5106e028f@mail.gmail.com
Whole thread Raw
Responses Re: trigger parameters, what am I doing wrong ??
List pgsql-sql
<div dir="ltr">Hi guys. I'm trying to pass a parameter to trigger procedure but it's not working and I have no idea why
sinceit looks pretty ok. Here's what I do :<br /><br />CREATE OR REPLACE FUNCTION test_proc()<br />   RETURNS "trigger"
AS<br/>$BODY$<br />DECLARE<br />chk     boolean;<br />par    integer := TG_ARGV[0];<br /><br />BEGIN<br />RAISE NOTICE
'TG_ARGV= %, TG_NARGS = %, par = %', TG_ARGV[0], TG_NARGS, par;<br /><br />-- [...] some computations<br /><br />RETURN
NEW;<br/>END;<br /><br />$BODY$<br />  LANGUAGE 'plpgsql' VOLATILE;<br /><br />CREATE TRIGGER jks_test_proc_tg<br /> 
AFTERUPDATE<br />  ON test_table<br />  FOR EACH ROW<br />  EXECUTE PROCEDURE test_proc(42);<br /><br />And here's what
RAISENOTICE looks like : NOTICE:  TG_ARGV = <NULL>, TG_NARGS = 0, par = <NULL><br /><br />What's wrong with
it?? I'm running 8.1.4<br /><br />regards<br />mk<br /></div> 

pgsql-sql by date:

Previous
From: "Dirk Jagdmann"
Date:
Subject: Re: Insert a space between each character
Next
From: "Sabin Coanda"
Date:
Subject: Re: 100% CPU at concurent access