Defining PostgreSQL Table Triggers

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

Tab

Section

Property

Description

Additional Properties

 

 

Name

Specifies the name of the trigger

 

 

 

Insert

Specifies whether the trigger is executed on INSERT

 

 

 

Update

Specifies whether the trigger is executed on UPDATE

 

 

 

Delete

Specifies whether the trigger is executed on DELETE

 

 

 

Truncate

Specifies whether the trigger is executed on TRUNCATE

 

 

 

Fire

Specifies when the table trigger is executed

After: Indicates that the trigger is executed after the occurrence of the trigger event

Before: Indicates that the trigger is executed before the occurrence of the trigger event

Instead Of: Specifies an alternative action to take in place of a standard operation (such as INSERT, UPDATE, or DELETE) on a view

 

 

Replace

Select this check box if you want the trigger DDL that is generated during Forward Engineering to replace any occurrence of an identically named trigger

 

 

 

Generate

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

 

General

 

 

 

 

 

 

 

 

 

 

Constraint Trigger

Indicates that the trigger is a constraint trigger. You can adjust the timing of trigger firing by setting constraints.

 

 

Referenced Table Name

Specifies the name of another table that the constraint references

 

 

Deferrable

Indicates whether the constraint can be deferred

Deferrable: Indicates whether the constraint can be deferred

Not Deferrable: Indicates whether the constraint cannot be deferred

 

Immediate Deferred Type

Specifies the default time to check the constraint

Initially Immediate: Specifies the default time to check the constraint in case of an immediate constraint. It checks after each statement.

Initially Deferred: Specifies the default time to check the constraint in case of a deferrable constraint. It is checked only at the end of the transaction

 

Old Table

Specifies the name of the old table

 

 

New Table

Specifies the name for the new table

 

 

Scope

Specifies the scope of the trigger

Statement: Indicates that the trigger fires for each qualified statement

Row: Indicates that the trigger fires for each qualified row

 

When Clause

Specifies the condition on when to trigger

 

 

Execute Type

Specifies the type of event on which the trigger will be fired

Function: Indicates that the trigger calls a trigger function. Trigger functions specifically design for use with triggers and must return a type of TRIGGER.

Procedure: Indicates that the trigger calls a stored procedure. Unlike functions, stored procedures manage transactions and do not necessarily return a value.

 

Function

Specifies the function executed when the trigger fires, declared to take no arguments and return type trigger. Select a function from the drop-down list or click New icon in property editors to create a new object to create a new one.

 

Update Columns

 

Column

Specifies a list of columns. It indicates that the trigger fires only if the UPDATE command mentions at least one of the listed columns as a target.

 

  1. Work with the other tabs in the editor to access additional design features, for example:
    • Define the code type in the Code tab.
    • View expanded code in the Expanded tab.
  2. (Optional) Click the Comment tab and enter any comments you want to associate with the object.
  3. (Optional) Click the UDP tab to work with user-defined properties for the object.
  4. (Optional) Click the Notes tab to view and edit user notes.
  5. Click Close.

    The trigger is defined and the PostgreSQL Table Trigger Editor closes.

For more information on trigger properties, refer to PostgreSQL documentation.