deny_truncate()

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 request

    	declare
    		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

Prev | Home | Next
ddlscript_complete_int() | Up | determineattkindunique(p_idx_name text, p_tab_fqname name)