B
B
beduin012021-08-29 21:22:01
PostgreSQL
beduin01, 2021-08-29 21:22:01

How to pledge the last creation date of MATERIALIZED VIEW?

Is there a way to pledge the creation time of the last REFRESH MATERIALIZED VIEW?
In simple words, is it possible to get some kind of flag that the request:
REFRESH MATERIALIZED VIEW regions_view;
fulfilled. Is it possible?

I plan to execute the request from the programming language. And you need to somehow get the status of the True type - they say that everything worked out

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Melkij, 2021-08-29
@beduin01

The question in the title and the question in the description are two completely different questions.
Like other commands, PQresultStatus answers the question whether the request was completed. You need to check with your connection library how to check the status of the command. In many cases, everything is simple - if the method returned control (and did not throw an exception) - the command is executed.

S
Slava Rozhnev, 2021-08-29
@rozhnev

Add an mterialized_at::timestamp column to the view with the value now() . This way you will know the update date

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question