Re: pg_dump -j against standbys

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_dump -j against standbys
Дата
Msg-id 32316.1464104393@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pg_dump -j against standbys  (Magnus Hagander <magnus@hagander.net>)
Ответы Re: pg_dump -j against standbys  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-hackers
Magnus Hagander <magnus@hagander.net> writes:
> I think the cleanest way to do it is to just track if it's a standby in the
> AH struct as written.

> Comments?

This patch will cause pg_dump to fail entirely against pre-9.0 servers.
You need to execute the test conditionally.

Also, in view of that, this test

-    if (fout->remoteVersion >= 90000)
+    if (fout->remoteVersion >= 90000 && fout->isStandby)

could be reduced to just "if (fout->isStandby)".  And the comment in
front of it could stand some attention (possibly just replace it with
the one that's currently within the inner if() ... actually, that
comment should move to where you moved the test to, no?)

Also, why didn't you keep using ExecuteSqlQueryForSingleRow()?
As coded, you're losing a sanity check that the query gives exactly
one row back.
        regards, tom lane



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

Предыдущее
От: Konstantin Knizhnik
Дата:
Сообщение: Re: Inheritance
Следующее
От: Christoph Berg
Дата:
Сообщение: Re: LSN as a recovery target