Online Documentation for SQL Manager for PostgreSQL

Editing trigger definition


Use the Trigger tab of Trigger Editor to create/edit a table trigger and specify its properties.

 

Name

Enter a name for the new trigger, or modify the name of the trigger being edited.

 

CheckBox Enabled

Enables/disables the trigger immediately after it is created.

 

For table or view

The drop-down list of tables and views allows you to select the table on which the trigger is executed.

 

Trigger Editor - Editing trigger definition

 

Constraint

Check this option to create a constraint trigger with adjusted timing of firing. A constraint trigger can only be of After Row type.

 

CheckBox Referenced table

Select the table for the trigger.

 

CheckBox Deferrable

This option controls whether the trigger can be deferred. Set this option to fire the trigger at the end of the containing transaction, otherwise it's fired at the end of the statement causing the triggering event.

 

Check time

This option specifies the default timing of the trigger: deferred trigger can be fired immediately or can be deferred.

 

Type

Select the trigger behaviour type:

RadioButton Before

Specifies that the trigger is fired before the event.

RadioButton After

Specifies that the trigger is fired after the event.

 

For each

This specifies whether the trigger procedure should be fired once for every row affected by the trigger event, or just once per SQL statement.

 

On event

Specify the data modification statements that activate the trigger when it is tried against this table: Insert, Update, Delete or Truncate (ON TRUNCATE is supported only from PostgreSQL version 8.4). At least one option must be specified.

 

Updated columns

From this drop-down list you can select the columns that will be updated.

 

Condition

Define statement for WHEN condition of the trigger.

 

Function

A user-supplied function that is declared as taking no arguments and returning type trigger, which is executed when the trigger fires. You can use already existing function or create new one.

 

Arguments

This area allows you to specify an optional list of arguments to be provided to the function when the trigger is executed. The arguments are literal string constants. Simple names and numeric constants may be written here, too, but they will all be converted to strings.

 

Trigger Editor - Editing trigger definition - Arguments

 

 

Set the arguments by right-clicking in the list and selecting iconPlus Add argument from the context menu (or by pressing the corresponding button). After the argument is added, set its value in the Argument Value field. To delete the existing argument, select iconMinus Delete argument from the context menu (or press the corresponding button).

To change the arguments order, use the Move Up / Move Down context menu items or the btnMoveUp btnMoveDown buttons.

 

 

The Definition area below specifies the trigger conditions and actions that determine whether the tried DML statements cause the trigger actions to be performed. The trigger actions take effect when the DML operation is performed.