Defining PostgreSQL Event Triggers

The following properties are applicable to a PostgreSQL Event Trigger object.

Tab

Section

Property

Description

Additional Information

 

 

Name

Specifies the name of the event trigger

 

 

 

Generate

Specifies whether a SQL statement for the table is generated during forward engineering

 

General

General Options

Event Type

Specifies the type of the event to be executed

ddl_command_start: Indicates that the event occurs just before executing a CREATE, ALTER, DROP, SECURITY LABEL, COMMENT, GRANT, or REVOKE command.

ddl_command_end: Indicates that the event occurs just after the execution of the same set of commands.

table_rewrite: Indicates that the event occurs just before some actions of the ALTER TABLE and ALTER TYPE commands rewrite a table.

sql_drop: Indicates that the event occurs just before the ddl_command_end event trigger for any operation that drops database objects.

When Clause

Specifies the condition on when to trigger the event

 

Execute Type

Specifies the method to execute the trigger's actions

Function: Indicates a user-defined function to execute the trigger.

Procedure: Indicates the event trigger syntax treats a PROCEDURE as equivalent to a FUNCTION, but it must still be a function, not a procedure.

Function

Specifies a function that takes no arguments and returns the type event_trigger.

 

  1. (Optional) Click the Comment tab and enter any comments you want to associate with the object.
  2. (Optional) Click the UDP tab to work with user-defined properties for the object.
  3. (Optional) Click the Notes tab to view and edit user notes.
  4. (Optional) Click the Extended Notes tab to view or edit user notes.
  5. Click Close.

    The event trigger is defined, and the PostgreSQL Event Trigger Editor closes.

For more information, refer to PostgreSQL documentation.