Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
41.7. PL/Perl Event Triggers
Prev UpChapter 41. PL/Perl - Perl Procedural LanguageHome Next

41.7. PL/Perl Event Triggers

PL/Perl can be used to write event trigger functions. In an event trigger function, the hash reference$_TD contains information about the current trigger event.$_TD is a global variable, which gets a separate local value for each invocation of the trigger. The fields of the$_TD hash reference are:

$_TD->{event}

The name of the event the trigger is fired for.

$_TD->{tag}

The command tag for which the trigger is fired.

The return value of the trigger procedure is ignored.

Here is an example of an event trigger function, illustrating some of the above:

CREATE OR REPLACE FUNCTION perlsnitch() RETURNS event_trigger AS $$  elog(NOTICE, "perlsnitch: " . $_TD->{event} . " " . $_TD->{tag} . " ");$$ LANGUAGE plperl;CREATE EVENT TRIGGER perl_a_snitch    ON ddl_command_start    EXECUTE PROCEDURE perlsnitch();


Prev Home Next
41.6. PL/Perl Triggers Up 41.8. PL/Perl Under the Hood
pdfepub
Go to Postgres Pro Standard 9.6
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp