Skip to content

Commit a9577ba

Browse files
committed
Add pg_combinebackup --copy option
Introduces --copy as an alternative to --clone and --copy-file-range. This option simply picks the default mode to copy files, as if none of the options was specified. This makes pg_combinebackup options more consistent with pg_upgrade, and it makes testing simpler. Reported-by: Peter Eisentraut Discussion: https://postgr.es/m/48da4a1f-ccd9-4988-9622-24f37b1de2b4%40eisentraut.org
1 parent e99e840 commit a9577ba

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

doc/src/sgml/ref/pg_combinebackup.sgml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,16 @@ PostgreSQL documentation
162162
</listitem>
163163
</varlistentry>
164164

165+
<varlistentry>
166+
<term><option>--copy</option></term>
167+
<listitem>
168+
<para>
169+
Perform regular file copy. This is the default. (See also
170+
<option>--copy-file-range</option> and <option>--clone</option>.)
171+
</para>
172+
</listitem>
173+
</varlistentry>
174+
165175
<varlistentry>
166176
<term><option>--copy-file-range</option></term>
167177
<listitem>

src/bin/pg_combinebackup/pg_combinebackup.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ main(int argc, char *argv[])
139139
{"no-manifest", no_argument, NULL, 2},
140140
{"sync-method", required_argument, NULL, 3},
141141
{"clone", no_argument, NULL, 4},
142-
{"copy-file-range", no_argument, NULL, 5},
142+
{"copy", no_argument, NULL, 5},
143+
{"copy-file-range", no_argument, NULL, 6},
143144
{NULL, 0, NULL, 0}
144145
};
145146

@@ -209,6 +210,9 @@ main(int argc, char *argv[])
209210
opt.copy_method = COPY_METHOD_CLONE;
210211
break;
211212
case 5:
213+
opt.copy_method = COPY_METHOD_COPY;
214+
break;
215+
case 6:
212216
opt.copy_method = COPY_METHOD_COPY_FILE_RANGE;
213217
break;
214218
default:
@@ -763,6 +767,7 @@ help(const char *progname)
763767
printf(_(" -T, --tablespace-mapping=OLDDIR=NEWDIR\n"
764768
" relocate tablespace in OLDDIR to NEWDIR\n"));
765769
printf(_(" --clone clone (reflink) instead of copying files\n"));
770+
printf(_(" --copy copy files (default)\n"));
766771
printf(_(" --copy-file-range copy using copy_file_range() syscall\n"));
767772
printf(_(" --manifest-checksums=SHA{224,256,384,512}|CRC32C|NONE\n"
768773
" use algorithm for manifest checksums\n"));

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