Is there a way to know when a database was restored or created in postgre DBaaS?

Alexsem 1 Reputation point
2020-06-08T13:53:27.44+00:00

Just that. I am trying to find a specific way, through the console, or with a query or the shell that would allow me to know if a database was restored accordingly. We have an automated process that restores from one environment to the other.

I have tried queries like SELECT (pg_stat_file('base/'||oid ||'/PG_VERSION')).modification, datname FROM pg_database (which doesn't exactly give the restored date) but obviously I don't have access to this information on a DBaaS.

Is there any other way to do this in postgre for azure?

I have also tried the command az postgres db show but it doesn't show what I need.

Azure Database for PostgreSQL
{count} votes

1 answer

Sort by: Most helpful
  1. Navtej Singh Saini 4,221 Reputation points Microsoft Employee
    2020-06-11T23:14:57.64+00:00

    Hi @alexsem We PITR’d one server and looked at the errorlog through portal and it shows the following info indicating the time when restore was complete and it got restarted

    2020-06-10 21:39:51 UTC-5ee15325.24-LOG: listening on IPv4 address "0.0.0.0", port 20125

    2020-06-10 21:39:51 UTC-5ee15325.24-LOG: database system is ready to accept connections

    Hope this helps.

    Thanks Navtej S

    0 comments No comments