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

Commit15a8010

Browse files
committed
Sort pg_basebackup options better
The --slot option somehow ended up under options controlling the output,and some other options were in a nonsensical place or were not movedafter recent renamings, so tidy all that up a bit.
1 parentab28fea commit15a8010

File tree

2 files changed

+53
-53
lines changed

2 files changed

+53
-53
lines changed

‎doc/src/sgml/ref/pg_basebackup.sgml

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -226,48 +226,6 @@ PostgreSQL documentation
226226
</listitem>
227227
</varlistentry>
228228

229-
<varlistentry>
230-
<term><option>-S <replaceable>slotname</replaceable></option></term>
231-
<term><option>--slot=<replaceable class="parameter">slotname</replaceable></option></term>
232-
<listitem>
233-
<para>
234-
This option can only be used together with <literal>-X
235-
stream</literal>. It causes the WAL streaming to use the specified
236-
replication slot. If the base backup is intended to be used as a
237-
streaming replication standby using replication slots, it should then
238-
use the same replication slot name
239-
in <filename>recovery.conf</filename>. That way, it is ensured that
240-
the server does not remove any necessary WAL data in the time between
241-
the end of the base backup and the start of streaming replication.
242-
</para>
243-
<para>
244-
If this option is not specified and the server supports temporary
245-
replication slots (version 10 and later), then a temporary replication
246-
slot is automatically used for WAL streaming.
247-
</para>
248-
</listitem>
249-
</varlistentry>
250-
251-
<varlistentry>
252-
<term><option>--no-slot</option></term>
253-
<listitem>
254-
<para>
255-
This option prevents the creation of a temporary replication slot
256-
during the backup even if it's supported by the server.
257-
</para>
258-
<para>
259-
Temporary replication slots are created by default if no slot name
260-
is given with the option <option>-S</option> when using log streaming.
261-
</para>
262-
<para>
263-
The main purpose of this option is to allow taking a base backup when
264-
the server is out of free replication slots. Using replication slots
265-
is almost always preferred, because it prevents needed WAL from being
266-
removed by the server during the backup.
267-
</para>
268-
</listitem>
269-
</varlistentry>
270-
271229
<varlistentry>
272230
<term><option>-T <replaceable class="parameter">olddir</replaceable>=<replaceable class="parameter">newdir</replaceable></option></term>
273231
<term><option>--tablespace-mapping=<replaceable class="parameter">olddir</replaceable>=<replaceable class="parameter">newdir</replaceable></option></term>
@@ -453,6 +411,21 @@ PostgreSQL documentation
453411
</listitem>
454412
</varlistentry>
455413

414+
<varlistentry>
415+
<term><option>-N</option></term>
416+
<term><option>--no-sync</option></term>
417+
<listitem>
418+
<para>
419+
By default, <command>pg_basebackup</command> will wait for all files
420+
to be written safely to disk. This option causes
421+
<command>pg_basebackup</command> to return without waiting, which is
422+
faster, but means that a subsequent operating system crash can leave
423+
the base backup corrupt. Generally, this option is useful for testing
424+
but should not be used when creating a production installation.
425+
</para>
426+
</listitem>
427+
</varlistentry>
428+
456429
<varlistentry>
457430
<term><option>-P</option></term>
458431
<term><option>--progress</option></term>
@@ -476,16 +449,43 @@ PostgreSQL documentation
476449
</varlistentry>
477450

478451
<varlistentry>
479-
<term><option>-N</option></term>
480-
<term><option>--no-sync</option></term>
452+
<term><option>-S <replaceable>slotname</replaceable></option></term>
453+
<term><option>--slot=<replaceable class="parameter">slotname</replaceable></option></term>
481454
<listitem>
482455
<para>
483-
By default, <command>pg_basebackup</command> will wait for all files
484-
to be written safely to disk. This option causes
485-
<command>pg_basebackup</command> to return without waiting, which is
486-
faster, but means that a subsequent operating system crash can leave
487-
the base backup corrupt. Generally, this option is useful for testing
488-
but should not be used when creating a production installation.
456+
This option can only be used together with <literal>-X
457+
stream</literal>. It causes the WAL streaming to use the specified
458+
replication slot. If the base backup is intended to be used as a
459+
streaming replication standby using replication slots, it should then
460+
use the same replication slot name
461+
in <filename>recovery.conf</filename>. That way, it is ensured that
462+
the server does not remove any necessary WAL data in the time between
463+
the end of the base backup and the start of streaming replication.
464+
</para>
465+
<para>
466+
If this option is not specified and the server supports temporary
467+
replication slots (version 10 and later), then a temporary replication
468+
slot is automatically used for WAL streaming.
469+
</para>
470+
</listitem>
471+
</varlistentry>
472+
473+
<varlistentry>
474+
<term><option>--no-slot</option></term>
475+
<listitem>
476+
<para>
477+
This option prevents the creation of a temporary replication slot
478+
during the backup even if it's supported by the server.
479+
</para>
480+
<para>
481+
Temporary replication slots are created by default if no slot name
482+
is given with the option <option>-S</option> when using log streaming.
483+
</para>
484+
<para>
485+
The main purpose of this option is to allow taking a base backup when
486+
the server is out of free replication slots. Using replication slots
487+
is almost always preferred, because it prevents needed WAL from being
488+
removed by the server during the backup.
489489
</para>
490490
</listitem>
491491
</varlistentry>

‎src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,13 +336,11 @@ usage(void)
336336
" (in kB/s, or use suffix \"k\" or \"M\")\n"));
337337
printf(_(" -R, --write-recovery-conf\n"
338338
" write recovery.conf for replication\n"));
339-
printf(_(" -S, --slot=SLOTNAME replication slot to use\n"));
340-
printf(_(" --no-slot prevent creation of temporary replication slot\n"));
341339
printf(_(" -T, --tablespace-mapping=OLDDIR=NEWDIR\n"
342340
" relocate tablespace in OLDDIR to NEWDIR\n"));
341+
printf(_(" --waldir=WALDIR location for the write-ahead log directory\n"));
343342
printf(_(" -X, --wal-method=none|fetch|stream\n"
344343
" include required WAL files with specified method\n"));
345-
printf(_(" --waldir=WALDIR location for the write-ahead log directory\n"));
346344
printf(_(" -z, --gzip compress tar output\n"));
347345
printf(_(" -Z, --compress=0-9 compress tar output with given compression level\n"));
348346
printf(_("\nGeneral options:\n"));
@@ -352,6 +350,8 @@ usage(void)
352350
printf(_(" -n, --no-clean do not clean up after errors\n"));
353351
printf(_(" -N, --no-sync do not wait for changes to be written safely to disk\n"));
354352
printf(_(" -P, --progress show progress information\n"));
353+
printf(_(" -S, --slot=SLOTNAME replication slot to use\n"));
354+
printf(_(" --no-slot prevent creation of temporary replication slot\n"));
355355
printf(_(" -v, --verbose output verbose messages\n"));
356356
printf(_(" -V, --version output version information, then exit\n"));
357357
printf(_(" -?, --help show this help, then exit\n"));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp