From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Magnus Hagander <magnus(at)hagander(dot)net> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_dump -j against standbys |
Date: | 2016-05-24 15:39:53 |
Message-ID: | 32316.1464104393@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Magnus Hagander <magnus(at)hagander(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | parihaaraka | 2016-05-24 15:45:43 | Re: pg_upgrade error regarding hstore operator |
Previous Message | Konstantin Knizhnik | 2016-05-24 14:45:44 | Re: Inheritance |