Get the App
SLTechnology News&Howtos  ›  Database  › 

How to use trigger to refresh materialized views automatically by Postgres

Shulou Source: shulou.com Published: 2022-05-31 15:24:47 10月29日 Update

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!

Tags: Views learning content that is ideas situations articles more knowledge knowledge points articles follow questions practice push research verification Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft vpn OPPO Reno Shulou Information NVidia