title: How to implement MVCC concept for materialized view in postgreSQL?
body: <pre><code>create materialized view mtview
  as 
  select * from table_name
  with no data;
  
  refresh materialized view mtview;
  
  create or replace function refresh_mat_view()
  returns trigger language plpgsql
  as $$
  begin
       refresh materialized view mtview
        return null;
  end $$;
  
  
  create trigger refresh_mat_view
  after insert or update or delete or truncate
  on table_name for each statement
  execute procedure refresh_mat_view();
  </code></pre>