--
-- search_observer__dequeue/3
--
create or replace function search_observer__dequeue(
  integer,
  timestamp with time zone,
  character varying
) returns int4 as $$

declare
    p_object_id                 alias for $1;
    p_event_date                alias for $2;
    p_event                     alias for $3;
begin

    delete from search_observer_queue
    where object_id = p_object_id
    and event = p_event
    and event_date = p_event_date;

    return 0;

end;$$ language plpgsql;