How to use trigger to refresh materialized views automatically by Postgres
This article mainly explains "Postgres how to use trigger to automatically refresh materialized view", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "Postgres how to use trigger to automatically refresh materialized view" bar!
Create or replace function tri_tableName_mview_func () returns trigger as $$declarebegin refresh materialized view concurrently tableName_mview with data; return null; end; $$language plpgsql;create trigger tri_tableName_iduafter insert or update or delete on tableNamefor each statement execute procedure tri_tableName_mview_func () Thank you for your reading, the above is the content of "how Postgres uses trigger to automatically refresh materialized views". After the study of this article, I believe you have a deeper understanding of how Postgres uses trigger to automatically refresh materialized views. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!