Search Postgresql Archives

Re: how to check that recovery is complete

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2020-11-05 at 19:03 +0000, Dmitry O Litvintsev wrote:
> I have a workflow where I recover from PITR backup and run a query on it. The program that runs query 
> checks that it can connect to database in a loop, until it can, and then runs the query. 
> This has worked fine far. Recently I upgraded to 11 and I see that I can connect to DB while recovery is 
> not complete yet.

That's because "hot_standby = on" by default from v10 on.

You could change the configuration and set it to "off",
then PostgreSQL will continue to work as before.

The alternative way is running this after you connect:

  SELECT pg_is_in_recovery();

If that returns TRUE, recovery is not done yet.
Back out, wait a while, then try again.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux