Slony-I 2.1.4 Documentation | ||||
---|---|---|---|---|
Prev | Fast Backward | Chapter 8. Schema schemadoc | Fast Forward | Next |
8.65. enablenode(p_no_id integer)
Function Properties
Language: PLPGSQL
Return Type: bigint
no_id - Node ID # Generate the ENABLE_NODE event for node no_iddeclare v_local_node_id int4; v_node_row record; begin -- ---- -- 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;