Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
46.7. Event Trigger Functions in PL/Tcl
Prev UpChapter 46. PL/Tcl — Tcl Procedural LanguageHome Next

46.7. Event Trigger Functions in PL/Tcl

Event trigger functions can be written in PL/Tcl.Postgres Pro requires that a function that is to be called as an event trigger must be declared as a function with no arguments and a return type ofevent_trigger.

The information from the trigger manager is passed to the function body in the following variables:

$TG_event

The name of the event the trigger is fired for.

$TG_tag

The command tag for which the trigger is fired.

The return value of the trigger function is ignored.

Here's a little example event trigger function that simply raises aNOTICE message each time a supported command is executed:

CREATE OR REPLACE FUNCTION tclsnitch() RETURNS event_trigger AS $$  elog NOTICE "tclsnitch: $TG_event $TG_tag"$$ LANGUAGE pltcl;CREATE EVENT TRIGGER tcl_a_snitch ON ddl_command_start EXECUTE FUNCTION tclsnitch();


Prev Up Next
46.6. Trigger Functions in PL/Tcl Home 46.8. Error Handling in PL/Tcl
pdfepub
Go to Postgres Pro Enterprise 14
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp