CREATE_EVENT_TRIGGER man page on Mageia

Man page or keyword search:  
man Server   17783 pages
apropos Keyword Search (all sections)
Output format
Mageia logo
[printable version]

CREATE EVENT TRIGGER(7) PostgreSQL 9.3.2 Documentation CREATE EVENT TRIGGER(7)

NAME
       CREATE_EVENT_TRIGGER - define a new event trigger

SYNOPSIS
       CREATE EVENT TRIGGER name
	 ON event
	 [ WHEN filter_variable IN (filter_value [, ... ]) [ AND ... ] ]
	 EXECUTE PROCEDURE function_name()

DESCRIPTION
       CREATE EVENT TRIGGER creates a new event trigger. Whenever the
       designated event occurs and the WHEN condition associated with the
       trigger, if any, is satisfied, the trigger function will be executed.
       For a general introduction to event triggers, see Chapter 37, Event
       Triggers, in the documentation. The user who creates an event trigger
       becomes its owner.

PARAMETERS
       name
	   The name to give the new trigger. This name must be unique within
	   the database.

       event
	   The name of the event that triggers a call to the given function.
	   See Section 37.1, “Overview of Event Trigger Behavior”, in the
	   documentation for more information on event names.

       filter_variable
	   The name of a variable used to filter events. This makes it
	   possible to restrict the firing of the trigger to a subset of the
	   cases in which it is supported. Currently the only supported
	   filter_variable is TAG.

       filter_value
	   A list of values for the associated filter_variable for which the
	   trigger should fire. For TAG, this means a list of command tags
	   (e.g.  'DROP FUNCTION').

       function_name
	   A user-supplied function that is declared as taking no argument and
	   returning type event_trigger.

NOTES
       Only superusers can create event triggers.

       Event triggers are disabled in single-user mode (see postgres(1)). If
       an erroneous event trigger disables the database so much that you can't
       even drop the trigger, restart in single-user mode and you'll be able
       to do that.

EXAMPLES
       Forbid the execution of any DDL command:

	   CREATE OR REPLACE FUNCTION abort_any_command()
	     RETURNS event_trigger
	    LANGUAGE plpgsql
	     AS $$
	   BEGIN
	     RAISE EXCEPTION 'command % is disabled', tg_tag;
	   END;
	   $$;

	   CREATE EVENT TRIGGER abort_ddl ON ddl_command_start
	      EXECUTE PROCEDURE abort_any_command();

COMPATIBILITY
       There is no CREATE EVENT TRIGGER statement in the SQL standard.

SEE ALSO
       ALTER EVENT TRIGGER (ALTER_EVENT_TRIGGER(7)), DROP EVENT TRIGGER
       (DROP_EVENT_TRIGGER(7)), CREATE FUNCTION (CREATE_FUNCTION(7))

PostgreSQL 9.3.2		     2013	       CREATE EVENT TRIGGER(7)
[top]

List of man pages available for Mageia

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net