0002-Introduce-pg_combinebackup-copy-option.patch
text/x-patch
Filename: 0002-Introduce-pg_combinebackup-copy-option.patch
Type: text/x-patch
Part: 1
Patch
Format: format-patch
Series: patch 0002
Subject: Introduce pg_combinebackup --copy option
| File | + | − |
|---|---|---|
| doc/src/sgml/ref/pg_combinebackup.sgml | 10 | 0 |
| src/bin/pg_combinebackup/pg_combinebackup.c | 6 | 1 |
From 93ecbe611936279127cebc5ddfefb6ebf1f4730f Mon Sep 17 00:00:00 2001
From: Tomas Vondra <tomas@2ndquadrant.com>
Date: Fri, 21 Jun 2024 14:36:04 +0200
Subject: [PATCH 2/4] Introduce pg_combinebackup --copy option
The --copy option simply allows picking the default mode to copy data,
and does not change the behavior. This makes pg_combinebackup options
more consistent with pg_upgrade.
Reported-by: Peter Eisentraut
Discussion: https://postgr.es/m/48da4a1f-ccd9-4988-9622-24f37b1de2b4%40eisentraut.org
---
doc/src/sgml/ref/pg_combinebackup.sgml | 10 ++++++++++
src/bin/pg_combinebackup/pg_combinebackup.c | 7 ++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/doc/src/sgml/ref/pg_combinebackup.sgml b/doc/src/sgml/ref/pg_combinebackup.sgml
index 375307d57bd..091982f62ad 100644
--- a/doc/src/sgml/ref/pg_combinebackup.sgml
+++ b/doc/src/sgml/ref/pg_combinebackup.sgml
@@ -162,6 +162,16 @@ PostgreSQL documentation
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--copy</option></term>
+ <listitem>
+ <para>
+ Perform regular file copy. This is the default. (See also
+ <option>--copy-file-range</option> and <option>--clone</option>.)
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><option>--copy-file-range</option></term>
<listitem>
diff --git a/src/bin/pg_combinebackup/pg_combinebackup.c b/src/bin/pg_combinebackup/pg_combinebackup.c
index f67ccf76ea2..6ddf5b534b1 100644
--- a/src/bin/pg_combinebackup/pg_combinebackup.c
+++ b/src/bin/pg_combinebackup/pg_combinebackup.c
@@ -139,7 +139,8 @@ main(int argc, char *argv[])
{"no-manifest", no_argument, NULL, 2},
{"sync-method", required_argument, NULL, 3},
{"clone", no_argument, NULL, 4},
- {"copy-file-range", no_argument, NULL, 5},
+ {"copy", no_argument, NULL, 5},
+ {"copy-file-range", no_argument, NULL, 6},
{NULL, 0, NULL, 0}
};
@@ -209,6 +210,9 @@ main(int argc, char *argv[])
opt.copy_method = COPY_METHOD_CLONE;
break;
case 5:
+ opt.copy_method = COPY_METHOD_COPY;
+ break;
+ case 6:
opt.copy_method = COPY_METHOD_COPY_FILE_RANGE;
break;
default:
@@ -763,6 +767,7 @@ help(const char *progname)
printf(_(" -T, --tablespace-mapping=OLDDIR=NEWDIR\n"
" relocate tablespace in OLDDIR to NEWDIR\n"));
printf(_(" --clone clone (reflink) instead of copying files\n"));
+ printf(_(" --copy copy files (default)\n"));
printf(_(" --copy-file-range copy using copy_file_range() syscall\n"));
printf(_(" --manifest-checksums=SHA{224,256,384,512}|CRC32C|NONE\n"
" use algorithm for manifest checksums\n"));
--
2.45.2