Trigger Function can be created with PL/pgSQL and referenced within a PostgreSQL trigger definition. The term "trigger function" is a simply a way of referring to a function that is intended to be invoked by a trigger. Triggers define operations that are performed when a specific event occurs within the database. A PL/pgSQL trigger function can be referenced by a trigger as the operation to be performed when the trigger's event occurs.
The definition of a trigger and the definition of its associated trigger function are two different things. A trigger is defined with the SQL CREATE TRIGGER command, whereas trigger functions are defined using the SQL CREATE FUNCTION command.
See Triggers for details.
Just simply click -> Trigger Function to open an object
pane for Trigger Function. A right-click displays the popup menu
or using the object pane toolbar below, allowing you to create new, edit and
delete the selected trigger function.
Create Trigger Function
To create a new trigger function
- Select anywhere on the object pane.
- Click the
New Trigger Function from the object pane toolbar.
or - Right-click and select
New Trigger Function from the popup menu.
- Edit trigger function properties on the appropriate tabs of the Trigger Function Designer.
To create a new trigger function with modification as one of the existing trigger function
- Select the trigger function for modifying in the object pane.
- Right-click and select the
Design Trigger Function from the popup menu or simply double-click the trigger function.
or - Click the
Design Trigger Function from the object pane toolbar.
- Modify trigger function properties on the appropriate tabs of the Trigger Function Designer.
- Click
Save As.
To edit the existing trigger function(manage its definition, advanced, etc)
- Select the trigger function for editing in the object pane.
- Right-click and select the
Design Trigger Function from the popup menu or simply double-click the trigger function.
or - Click the
Design Trigger Function from the object pane toolbar.
- Edit trigger function properties on the appropriate tabs of the Trigger Function Designer.
To change the name of the trigger function
- Select the trigger function for editing in the object pane.
- Right-click and select the Rename from the popup menu.
Delete Trigger Function
To delete a trigger function
- Select the trigger function for deleting in the object pane.
- Right-click and select the
Delete Trigger Function from the popup menu.
or - Click the
Delete Trigger Function from the object pane toolbar.
- Confirm deleting in the dialog window.
Achieve Trigger Function Information
To achieve a trigger function information (OID, Parameter, Return Type and DDL, etc)
- Select the trigger function in the object pane.
- Right-click the selected trigger function and choose Trigger Function Information from the popup menu to view the Object Information.
or - Choose View -> Object Information in the main menu.