Re: how to check that recovery is complete

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: how to check that recovery is complete
Дата
Msg-id ad6185ce53bfb674c061237092a1421ecf245e79.camel@cybertec.at
обсуждение исходный текст
Ответ на how to check that recovery is complete  (Dmitry O Litvintsev <litvinse@fnal.gov>)
Список pgsql-general
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




В списке pgsql-general по дате отправления:

Предыдущее
От: Tony Shelver
Дата:
Сообщение: Re: JSONB order?
Следующее
От: Java Developer
Дата:
Сообщение: Query a column with the same name as an operator