> On Jan 19, 2021, at 6:33 AM, Jayadevan M <maymala.jayade...@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 without having 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 if necessary. pg_stat_activity
also has some other useful columns that, like query_start which can tell you
how long the query has been running.
Cheers
Philip