reshapesubscription(p_sub_receiver integer, p_sub_provider integer, p_sub_origin integer)

8.94. reshapesubscription(p_sub_receiver integer, p_sub_provider integer, p_sub_origin integer)

Function Properties

Language: PLPGSQL

Return Type: integer

Run on a receiver/subscriber node when the provider for that subscription is being changed. Slonik will invoke this method before the SUBSCRIBE_SET event propogates to the receiver so listen paths can be updated.

begin
	update sl_subscribe
		   set sub_provider=p_sub_provider
		   from sl_set
		   WHERE sub_set=sl_set.set_id
		   and sl_set.set_origin=p_sub_origin and sub_receiver=p_sub_receiver;
	if found then
	   perform RebuildListenEntries();
	   notify "_schemadoc_Restart";
	end if;
	return 0;
end