Slony-I 2.2.10 Documentation | ||||
---|---|---|---|---|
Prev | Fast Backward | Chapter 8. Schema schemadoc | Fast Forward | Next |
8.44. deny_truncate()
Function Properties
Language: PLPGSQL
Return Type: trigger
trigger function run when a replicated table receives a TRUNCATE requestdeclare r_role text; begin -- Ignore this call if session_replication_role = 'local' select into r_role setting from pg_catalog.pg_settings where name = 'session_replication_role'; if r_role = 'local' then return NULL; end if; raise exception 'truncation of replicated table forbidden on subscriber node'; end