Re: pgsql: Remove command checks in tests of pg_basebackup and pg_receivewa

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Remove command checks in tests of pg_basebackup and pg_receivewa
Date: 2022-05-09 14:10:27
Message-ID: d7897033-f823-f670-ec57-d68eeb9ad7e3@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers


On 2022-05-09 Mo 01:28, Michael Paquier wrote:
> Hi Andrew,
>
> On Sat, May 07, 2022 at 09:13:48AM +0900, Michael Paquier wrote:
>> Let's do that for now then as we need a middle ground for HEAD. I'll
>> come up with something at the beginning of next week.
> And here you go as of the attached to show the idea. The CI is able
> to execute and detect the default commands for lz4, gzip and zstd,
> while one of my boxes without any of those commands would ignore them.
> What do you think?

The system() call should include redirection, since we only case about
the return code.

I would just write this

+    if ($rc != 0)
+    {
+        # Execution of the default command failed, so reset its
+        # environment value.
+        $ENV{$envname} = '';
+        return;
+    }
+
+    # Set the environment to the default as it exists.
+    $ENV{$envname} = $envdefault;
+    return;

as

    $ENV{$envname} = $envdefault if $rc == 0;

   

There should be no need to set it to the empty string in case if
failure, we already know it's undefined.

Otherwise looks good.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2022-05-09 15:37:46 pgsql: In REFRESH MATERIALIZED VIEW, set user ID before running user co
Previous Message Peter Eisentraut 2022-05-09 10:33:48 pgsql: Translation updates