How to check if a materialised view is being updated?

From: Myklebust, Bjørn Magnar <Bjorn(dot)Myklebust(at)skatteetaten(dot)no>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: How to check if a materialised view is being updated?
Date: 2021-01-19 09:53:09
Message-ID: 592B0FD5-9EF7-4D22-A44B-AF8287B627E4@skatteetaten.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi.
I’ve got a materialized view as a source for my ETL-process, and the materialized view takes several hours to refresh. During which it is locked for queries.
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?

I’m using PostgreSQL 11.10 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39), 64-bit

Thanks,

Bjørn

________________________________
Denne e-posten og eventuelle vedlegg er beregnet utelukkende for den institusjon eller person den er rettet til og kan være belagt med lovbestemt taushetsplikt. Dersom e-posten er feilsendt, vennligst slett den og kontakt Skatteetaten.
The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential information and may be legally protected from disclosure. If you are not the intended recipient of this message, please immediately delete the message and alert the Norwegian Tax Administration.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thiemo Kellner 2021-01-19 11:24:39 Re: How to check if a materialised view is being updated?
Previous Message Stacey Haysler 2021-01-19 02:42:44 Re: Code of Conduct plan,Re: Code of Conduct plan,Re: Code of Conduct plan,Re: Code of Conduct plan