Using postgres 9.5.2 (python client)
Is there any way to check if a materialized view is populated using a query? One that does not raise a warning the view is not populated?
The quick answer:
SELECT relispopulated FROM pg_class WHERE relname = '<the table name>';
You can find more details about the pg_class
table in the documentation. According to that, the field relispopulated
should be true for everything but some materialized views, and I infer from that and from the name of the field, that it will give you what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With