Slony-I 2.2.10 Documentation
Prev | Fast Backward | Chapter 8. Schema schemadoc | Fast Forward | Next

# 8.56. dropset(p_set_id integer)

Function Properties

Language: PLPGSQL

Return Type: bigint

Process DROP_SET event to drop replication of set set_id. This involves: - Removing log and deny access triggers - Removing all traces of the set configuration, including sequences, tables, subscribers, syncs, and the set itself

    declare
    	v_origin			int4;
    begin
    	-- ----
    	-- Grab the central configuration lock
    	-- ----
    	lock table sl_config_lock;

    	-- ----
    	-- Check that the set exists and originates here
    	-- ----
    	select set_origin into v_origin from sl_set
    			where set_id = p_set_id;
    	if not found then
    		raise exception 'Slony-I: set % not found', p_set_id;
    	end if;
    	if v_origin != getLocalNodeId('_schemadoc') then
    		raise exception 'Slony-I: set % does not originate on local node',
    				p_set_id;
    	end if;

    	-- ----
    	-- Call the internal drop set functionality and generate the event
    	-- ----
    	perform dropSet_int(p_set_id);
    	return  createEvent('_schemadoc', 'DROP_SET',
    			p_set_id::text);
    end;

Prev | Home | Next
droppath_int(p_pa_client integer, p_pa_server integer) | Up | dropset_int(p_set_id integer)