Re: [PATCH] Honor PG_TEST_NOCLEAN for tempdirs

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Jacob Champion <jchampion(at)timescale(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Honor PG_TEST_NOCLEAN for tempdirs
Date: 2023-06-28 08:45:02
Message-ID: 0e19fdc3-2feb-6774-2d8b-744cd3ad0869@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 27.06.23 17:54, Dagfinn Ilmari Mannsåker wrote:
> However, the docs
> (https://www.postgresql.org/docs/16/regress-tap.html#REGRESS-TAP-VARS)
> say "If the environment variable PG_TEST_NOCLEAN is set", not "is set to
> a true value", and the existing test in PostgreSQL::Test::Cluster's END
> block is:
>
> # skip clean if we are requested to retain the basedir
> next if defined $ENV{'PG_TEST_NOCLEAN'};
>
> So the original `not defined` test is consistent with that.

Right, the usual style is just to check whether an environment variable
is set to something, not what it is.

Also note that in general not all environment variables are processed by
Perl, so I would avoid encoding Perl semantics about what is "true" or
whatever into it.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Jacobson 2023-06-28 08:50:20 Re: Do we want a hashset type?
Previous Message Peter Eisentraut 2023-06-28 08:40:22 Re: Detecting use-after-free bugs using gcc's malloc() attribute