Re: pgsql: Add 'basebackup_to_shell' contrib module. - Mailing list pgsql-hackers

From Robert Haas
Subject Re: pgsql: Add 'basebackup_to_shell' contrib module.
Date
Msg-id CA+TgmobK9EEyPpVuBs7UL_1wHkgAbFdnAkrFox6h_0-5i7HM2A@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Add 'basebackup_to_shell' contrib module.  (Andres Freund <andres@anarazel.de>)
Responses Re: pgsql: Add 'basebackup_to_shell' contrib module.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Mar 30, 2022 at 12:54 PM Andres Freund <andres@anarazel.de> wrote:
> There are some commandline utilities (including copy) where backward slashes
> in arguments are necessary, to separate options from paths :/. Those are the
> extent of backslash use in Cluster.pm that I could see quickly.

I just copied this logic from that file:

        $path =~ s{\\}{\\\\}g if ($PostgreSQL::Test::Utils::windows_os);
        my $copy_command =
          $PostgreSQL::Test::Utils::windows_os
          ? qq{copy "$path\\\\%f" "%p"}
          : qq{cp "$path/%f" "%p"};

In the first version of the patch I neglected the first of those lines
and it broke, so the s{\\}{\\\\}g thing is definitely needed. It's
possible that / would be as good as \\\\ in the command text itself,
but it doesn't seem worth getting excited about. It'd be best if any
unnecessary garbage of this sort got cleaned up by someone who has a
test environment locally, rather than me testing by sending emails to
a mailing list which Thomas then downloads into a sandbox and executes
which you then send me links to what broke on the mailing list and I
try again.

> Fair enough. I found it a bit grating to read in the test, that's why I
> mentioned it...

I'm going to go ahead and commit this test script later on this
afternoon unless there are vigorous objections real soon now, and then
if somebody wants to improve it, great!

-- 
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Dagfinn Ilmari Mannsåker
Date:
Subject: Re: multithreaded zstd backup compression for client and server
Next
From: Andres Freund
Date:
Subject: Re: pgsql: Add 'basebackup_to_shell' contrib module.