Re: pg_dump -j against standbys - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_dump -j against standbys
Date
Msg-id 32316.1464104393@sss.pgh.pa.us
Whole thread Raw
In response to pg_dump -j against standbys  (Magnus Hagander <magnus@hagander.net>)
Responses Re: pg_dump -j against standbys  (Magnus Hagander <magnus@hagander.net>)
List 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 by date:

Previous
From: Konstantin Knizhnik
Date:
Subject: Re: Inheritance
Next
From: Christoph Berg
Date:
Subject: Re: LSN as a recovery target