1.119.  storeset_int( integer, integer, text )

Propriétés de la fonction
Langage: PLPGSQL
Type du code retour: integer

Traite l'événement STORE_SET, indiquant que le nouvel ensemble avec l'identifiant donné, le nœud origine et un commentaire lisible par un humain.

declare
        p_set_id                        alias for $1;
        p_set_origin            alias for $2;
        p_set_comment           alias for $3;
        v_dummy                         int4;
begin
        -- ----
        -- Grab the central configuration lock
        -- ----
        lock table sl_config_lock;

        select 1 into v_dummy
                        from sl_set
                        where set_id = p_set_id
                        for update;
        if found then 
                update sl_set
                                set set_comment = p_set_comment
                                where set_id = p_set_id;
        else
                if not exists (select 1 from sl_node
                                                where no_id = p_set_origin) then
                        perform storeNode_int (p_set_origin, '<event pending>', 'f');
                end if;
                insert into sl_set
                                (set_id, set_origin, set_comment) values
                                (p_set_id, p_set_origin, p_set_comment);
        end if;

        -- Run addPartialLogIndices() to try to add indices to unused sl_log_? table
        perform addPartialLogIndices();

        return p_set_id;
end;