--
-- membership_rel__deleted/1
--
create or replace function membership_rel__deleted(
  integer
) returns int4 as $$

declare
  deleted__rel_id               alias for $1;  
begin
    update membership_rels
    set member_state = 'deleted'
    where rel_id = deleted__rel_id;

    return 0; 
end;$$ language plpgsql;