Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcf85151

Browse files
committed
pg_dump: Support using synchronized snapshots on standbys
This became possible by commit6c2003f. This just makes pg_dump awareof it and updates the documentation.Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>
1 parentdcd052c commitcf85151

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
@@ -1134,9 +1134,9 @@ setup_connection(Archive *AH, const char *dumpencoding,
11341134
AH->remoteVersion >= 90200 &&
11351135
!dopt->no_synchronized_snapshots)
11361136
{
1137-
if (AH->isStandby)
1137+
if (AH->isStandby && AH->remoteVersion < 100000)
11381138
exit_horribly(NULL,
1139-
"Synchronized snapshots are not supportedon standby servers.\n"
1139+
"Synchronized snapshotson standby serversare not supportedby this server version.\n"
11401140
"Run with --no-synchronized-snapshots instead if you do not need\n"
11411141
"synchronized snapshots.\n");
11421142

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp