Package: postgresql-common
Version: 207.pgdg90+1
Severity: wishlist
Tags: patch

Hi,

please consider to support the --clone option for pg_upgrade, which
makes use of reflinks (added in version 12). Patch attached.

Regards, Til

-- System Information:
Debian Release: 9.11
  APT prefers oldstable-updates
  APT policy: (500, 'oldstable-updates'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-0.bpo.6-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_CH.UTF-8, LC_CTYPE=de_CH.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages postgresql-common depends on:
ii  adduser                   3.115
ii  debconf [debconf-2.0]     1.5.61
ii  init-system-helpers       1.48
ii  lsb-base                  9.20161125
ii  postgresql-client-common  207.pgdg90+1
ii  procps                    2:3.3.12-3+deb9u1
ii  ssl-cert                  1.0.39
ii  ucf                       3.0036

Versions of packages postgresql-common recommends:
ii  e2fsprogs  1.43.4-2+deb9u1
ii  logrotate  3.11.0-0.1

Versions of packages postgresql-common suggests:
pn  libjson-perl  <none>

-- debconf information excluded
--- /usr/bin/pg_upgradecluster.orig     2019-10-14 12:36:24.516188221 +0200
+++ /usr/bin/pg_upgradecluster  2019-10-14 12:43:42.774257835 +0200
@@ -233,6 +233,7 @@
 
 my $method = 'dump';
 my $link = 0;
+my $clone = 0;
 my $keep_port = 0;
 my $start = -1; # -1 = auto
 
@@ -250,6 +251,7 @@
            'm|method=s' => \$method,
            'j|jobs=s', => \$jobs,
            'k|link' => \$link,
+           'clone' => \$clone,
             'keep-port' => \$keep_port,
             'rename=s' => \$newcluster,
             'old-bindir=s' => \$old_bindir,
@@ -259,6 +261,7 @@
 
 $method eq 'dump' or $method eq 'upgrade' or error 'method must be "dump" or 
"upgrade"';
 $link and $method eq 'dump' and error 'cannot use --link with --method=dump';
+$clone and $method eq 'dump' and error 'cannot use --clone with --method=dump';
 $jobs and $method eq 'dump' and error 'cannot use --jobs with --method=dump';
 
 # untaint
@@ -556,6 +559,7 @@
         }
         push @argv, '-D', $newinfo{configdir};
        push @argv, "--link" if $link;
+       push @argv, "--clone" if $clone;
        push @argv, '-j', $jobs if $jobs;
 
        # Make a directory for pg_upgrade to store its reports and log
@@ -824,6 +828,12 @@
 cluster.  This option is merely passed on to pg_upgrade.  See
 L<pg_upgrade(1)> for details.
 
+=item B<--clone>
+
+In pg_upgrade mode, use efficient file cloning (also known as "reflinks"
+on some systems) instead of copying files to the new cluster. This option
+is merely passed on to pg_upgrade.  See L<pg_upgrade(1)> for details.
+
 =item B<-j>, B<--jobs>
 
 In pg_upgrade mode, number of simultaneous processes to use. This

Reply via email to