Christopher B. Browne's Home Page
cbbrowne@acm.org

8.60. enablenode(integer)

Function Properties

PLPGSQLbigint
no_id - Node ID # Generate the ENABLE_NODE event for node no_id
    declare
    	p_no_id			alias for $1;
    	v_local_node_id	int4;
    	v_node_row		record;
    begin
    	-- ----
    	-- Grab the central configuration lock
    	-- ----
    	lock table sl_config_lock;
    
    	-- ----
    	-- Check that we are the node to activate and that we are
    	-- currently disabled.
    	-- ----
    	v_local_node_id := getLocalNodeId('_schemadoc');
    	select * into v_node_row
    			from sl_node
    			where no_id = p_no_id
    			for update;
    	if not found then 
    		raise exception 'Slony-I: node % not found', p_no_id;
    	end if;
    	if v_node_row.no_active then
    		raise exception 'Slony-I: node % is already active', p_no_id;
    	end if;
    
    	-- ----
    	-- Activate this node and generate the ENABLE_NODE event
    	-- ----
    	perform enableNode_int (p_no_id);
    	return  createEvent('_schemadoc', 'ENABLE_NODE',
    									p_no_id::text);
    end;

Google

If this was useful, let others know by an Affero rating

Contact me at cbbrowne@acm.org