event-trigger-table-rewrite-example.md 330 字节
Newer Older
K
KyleZhang 已提交
1 2 3 4 5 6 7 8 9 10 11
## 40.5. A Table Rewrite Event Trigger Example

 Thanks to the `table_rewrite` event, it is possible to implement a table rewriting policy only allowing the rewrite in maintenance windows.

 Here's an example implementing such a policy.

```
CREATE OR REPLACE FUNCTION no_rewrite()
 RETURNS event_trigger
 LANGUAGE plpgsql AS
$$