| Slony-I 2.2.10 Documentation | ||||
|---|---|---|---|---|
| Prev | Fast Backward | Chapter 8. Schema schemadoc | Fast Forward | Next |
Function Properties
Language: PLPGSQL
Return Type: integer
Store state of a Slony component. Useful for monitoringbegin
-- Trim out old state for this component
if not exists (select 1 from sl_components where co_actor = i_actor) then
insert into sl_components
(co_actor, co_pid, co_node, co_connection_pid, co_activity, co_starttime, co_event, co_eventtype)
values
(i_actor, i_pid, i_node, i_conn_pid, i_activity, i_starttime, i_event, i_eventtype);
else
update sl_components
set
co_connection_pid = i_conn_pid, co_activity = i_activity, co_starttime = i_starttime, co_event = i_event,
co_eventtype = i_eventtype
where co_actor = i_actor
and co_starttime < i_starttime;
end if;
return 1;
end