> On Jan 19, 2021, at 6:33 AM, Jayadevan M <maymala.jayadevan@gmail.com> wrote:
>
>
>
> So I’m looking for a way to identify if the refresh process is finished or if it’s still running - preferably
withouthaving to wait for timeout by querying a locked materialized view. But by e.g. using the system tables or
otherwise.
>
>
>
> Can anybody suggest some pointers on how to do this?
>
>
> Maybe pg_stat_activity will have the refresh query?
Yes, pg_stat_activity has a query column that could be searched with the regular string matching tools, including regex
ifnecessary. pg_stat_activity also has some other useful columns that, like query_start which can tell you how long the
queryhas been running.
Cheers
Philip