By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,710 Members | 1,887 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,710 IT Pros & Developers. It's quick & easy.

Pass parameters to a TCL function

P: n/a
Hello list,

I have a tcl trigger function called audit_log(varchar, bpchar), if I
write a trigger in a table

CREATE TRIGGER tg_test
AFTER INSERT OR UPDATE OR DELETE
ON xtable
FOR EACH ROW
EXECUTE PROCEDURE audit_log('xtable','internal');

it gives this error:

ERROR: CreateTrigger: function audit_log() does not exist

I also tried to make a kinda wrapper plpgsql trigger to call the
audit_log function but didn't work, any idea what's wrong?, how do I
pass parameters to a trigger function?

Thanks in advance,

Josue Maldonado.

Nov 11 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

I'm sorry, found my mistake, the way I'm calling the function is wrong
it should be "audit_log" ('xtable','internal'), it works.

Thanks
Josué Maldonado wrote:
Hello list,

I have a tcl trigger function called audit_log(varchar, bpchar), if I
write a trigger in a table

CREATE TRIGGER tg_test
AFTER INSERT OR UPDATE OR DELETE
ON xtable
FOR EACH ROW
EXECUTE PROCEDURE audit_log('xtable','internal');

it gives this error:

ERROR: CreateTrigger: function audit_log() does not exist

I also tried to make a kinda wrapper plpgsql trigger to call the
audit_log function but didn't work, any idea what's wrong?, how do I
pass parameters to a trigger function?

Thanks in advance,

Josue Maldonado.


Nov 11 '05 #2

P: n/a


Josué Maldonado wrote:
I'm sorry, found my mistake, the way I'm calling the function is wrong
it should be "audit_log" ('xtable','internal'), it works.
Hmmm, that should not work. The function should be declared taking no
arguments and you yet find the arguments from the CREATE TRIGGER in the
Tcl list $args and $1-$n.
Jan

Thanks
Josué Maldonado wrote:
Hello list,

I have a tcl trigger function called audit_log(varchar, bpchar), if I
write a trigger in a table

CREATE TRIGGER tg_test
AFTER INSERT OR UPDATE OR DELETE
ON xtable
FOR EACH ROW
EXECUTE PROCEDURE audit_log('xtable','internal');

it gives this error:

ERROR: CreateTrigger: function audit_log() does not exist

I also tried to make a kinda wrapper plpgsql trigger to call the
audit_log function but didn't work, any idea what's wrong?, how do I
pass parameters to a trigger function?

Thanks in advance,

Josue Maldonado.

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)


--
#================================================= =====================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================= = Ja******@Yahoo.com #
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 11 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.