dropset_int(p_set_id integer)

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

# 8.57. dropset_int(p_set_id integer)

Function Properties

Language: PLPGSQL

Return Type: integer

    declare
    	v_tab_row			record;
    begin
    	-- ----
    	-- Grab the central configuration lock
    	-- ----
    	lock table sl_config_lock;

    	-- ----
    	-- Restore all tables original triggers and rules and remove
    	-- our replication stuff.
    	-- ----
    	for v_tab_row in select tab_id from sl_table
    			where tab_set = p_set_id
    			order by tab_id
    	loop
    		perform alterTableDropTriggers(v_tab_row.tab_id);
    	end loop;

    	-- ----
    	-- Remove all traces of the set configuration
    	-- ----
    	delete from sl_sequence
    			where seq_set = p_set_id;
    	delete from sl_table
    			where tab_set = p_set_id;
    	delete from sl_subscribe
    			where sub_set = p_set_id;
    	delete from sl_setsync
    			where ssy_setid = p_set_id;
    	delete from sl_set
    			where set_id = p_set_id;

    	-- Regenerate sl_listen since we revised the subscriptions
    	perform RebuildListenEntries();

    	-- Run addPartialLogIndices() to try to add indices to unused sl_log_? table
    	perform addPartialLogIndices();

    	return p_set_id;
    end;

Prev | Home | Next
dropset(p_set_id integer) | Up | enable_indexes_on_table(i_oid oid)