| 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 itselfdeclare
	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;