Ask a Question
Report a Bug
This page in other versions:
Warning: This documentation is for a pre-release version of pgAdmin 4
Use the Rule dialog to define or modify a rule for a specified table or view.
A PostgreSQL rule allows you to define an additional action that will be
performed when a SELECT, INSERT, UPDATE, or DELETE is performed against a table.
The Rule dialog organizes the development of a rule through the General,
Definition, Condition, Commands tabs. The SQL tab displays the SQL code
generated by dialog selections.
Use the fields in the General tab to identify the rule:
Click the Definition tab to continue.
Use the fields in the Definition tab to write parameters:
Click the Condition tab to continue.
Specify a SQL conditional expression that returns a boolean value in the editor.
Click the Commands tab to continue.
Provide a command in the editor that defines the action performed by the rule.
Click the SQL tab to continue.
Your entries in the Rule dialog generate a SQL command (see an example below).
Use the SQL tab for review; revisit or switch tabs to make any changes to the
The following is an example of the sql command generated by user selections in
the Rule dialog:
The example sends a notification when an UPDATE executes against a table.