title: Postgresql LISTEN / NOTIFY recap
body: <p>I created the following trigger to track all the changes on a postgres table. </p>
  
  <pre><code>DROP TRIGGER tr_request_update_notify ON requests;
  
  CREATE OR REPLACE FUNCTION request_update_notify() RETURNS trigger as $$
  BEGIN  
    PERFORM pg_notify('request_update_notify', json_build_object('table', TG_TABLE_NAME, 'id', NEW.id, 'event', NEW.event, 'type', TG_OP)::text);
    RETURN NEW;
  END;
  $$ LANGUAGE plpgsql;
  
  
  CREATE TRIGGER tr_request_update_notify AFTER UPDATE or INSERT ON requests FOR EACH ROW EXECUTE PROCEDURE request_update_notify();
  </code></pre>
  
  <p>Another application will listen to the connection and apply suitable treatment for each event.</p>
  
  <p>If an event happens and my application is not up, the event will never be processed. Is there a way to have a recap of all missed notification? </p>