Skip to content

Commit e4892c6

Browse files
committed
pg_dump: Support using synchronized snapshots on standbys
This became possible by commit 6c2003f. This just makes pg_dump aware of it and updates the documentation. Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>
1 parent 0c16efc commit e4892c6

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

doc/src/sgml/ref/pg_dump.sgml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,16 @@ PostgreSQL documentation
337337
but to abort the dump.
338338
</para>
339339
<para>
340-
For a consistent backup, the database server needs to support synchronized snapshots,
341-
a feature that was introduced in <productname>PostgreSQL</productname> 9.2. With this
342-
feature, database clients can ensure they see the same data set even though they use
343-
different connections. <command>pg_dump -j</command> uses multiple database
344-
connections; it connects to the database once with the master process and
345-
once again for each worker job. Without the synchronized snapshot feature, the
346-
different worker jobs wouldn't be guaranteed to see the same data in each connection,
347-
which could lead to an inconsistent backup.
340+
For a consistent backup, the database server needs to support
341+
synchronized snapshots, a feature that was introduced in
342+
<productname>PostgreSQL</productname> 9.2 for primary servers and 10
343+
for standbys. With this feature, database clients can ensure they see
344+
the same data set even though they use different connections.
345+
<command>pg_dump -j</command> uses multiple database connections; it
346+
connects to the database once with the master process and once again
347+
for each worker job. Without the synchronized snapshot feature, the
348+
different worker jobs wouldn't be guaranteed to see the same data in
349+
each connection, which could lead to an inconsistent backup.
348350
</para>
349351
<para>
350352
If you want to run a parallel dump of a pre-9.2 server, you need to make sure that the

src/bin/pg_dump/pg_dump.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,9 +1131,9 @@ setup_connection(Archive *AH, const char *dumpencoding,
11311131
AH->remoteVersion >= 90200 &&
11321132
!dopt->no_synchronized_snapshots)
11331133
{
1134-
if (AH->isStandby)
1134+
if (AH->isStandby && AH->remoteVersion < 100000)
11351135
exit_horribly(NULL,
1136-
"Synchronized snapshots are not supported on standby servers.\n"
1136+
"Synchronized snapshots on standby servers are not supported by this server version.\n"
11371137
"Run with --no-synchronized-snapshots instead if you do not need\n"
11381138
"synchronized snapshots.\n");
11391139

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy