Rule¶
Defines a rewrite rule on a table or view (CREATE RULE)
Properties¶
| Property | Type | Required | Description |
|---|---|---|---|
name |
string |
yes | The rule name, unique within its table or view. |
event |
SELECT | INSERT | UPDATE | DELETE |
yes | Event. |
condition |
string |
— | The WHERE expression that decides whether the rule applies. |
instead |
boolean |
— | Run the commands instead of the original one (DO INSTEAD); the default is DO ALSO. |
commands |
array of string |
— | The commands the rule runs; absent for NOTHING. Minimum items: 1. |
enabled |
ORIGIN | REPLICA | ALWAYS | DISABLED |
— | When the rule fires (ALTER TABLE ... RULE). ORIGIN, the default, fires it in a normal session; REPLICA only when session_replication_role is replica; ALWAYS in both; DISABLED never. |
comment |
string |
— | Comment. |
No other properties are accepted.
Source: schemata/rule.yml · Resolved JSON Schema: rule.json