pg_regress.c also sensitive to various PG* environment variables

Started by Michael Paquieralmost 5 years ago4 messageshackers
Jump to latest
#1Michael Paquier
michael@paquier.xyz

Hi all,

Following up with the recent thread that dealt with the same $subject
for the TAP tests, I have gone through pg_regress.c:
/messages/by-id/YLbjjRpucIeZ78VQ@paquier.xyz

The list of environment variables that had better be reset when using
a temporary instance is very close to TestLib.pm, leading to the
attached. Please note that that the list of unsetted parameters has
been reorganized to be consistent with the TAP tests, and that I have
added comments referring one and the other.

Thoughts?
--
Michael

Attachments:

regress-env-vars.patchtext/x-diff; charset=us-asciiDownload+25-5
#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#1)
Re: pg_regress.c also sensitive to various PG* environment variables

On 2021-Jun-11, Michael Paquier wrote:

Following up with the recent thread that dealt with the same $subject
for the TAP tests, I have gone through pg_regress.c:
/messages/by-id/YLbjjRpucIeZ78VQ@paquier.xyz

Good idea.

The list of environment variables that had better be reset when using
a temporary instance is very close to TestLib.pm, leading to the
attached. Please note that that the list of unsetted parameters has
been reorganized to be consistent with the TAP tests, and that I have
added comments referring one and the other.

Thoughts?

I think if they're to be kept in sync, then the exceptions should be
noted. I mean, where PGCLIENTENCODING would otherwise be, I'd add
/* PGCLIENTENCODING set above */
/* See below for PGHOSTADDR */
and so on (PGHOST and PGPORT probably don't need this because they're
immediately below; not sure; but I would put them in alphabetical order
in both lists for sure and then that wouldn't apply). Otherwise I would
think that it's an omission and would set to fix it.

--
�lvaro Herrera 39�49'30"S 73�17'W

#3Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#2)
Re: pg_regress.c also sensitive to various PG* environment variables

On Fri, Jun 11, 2021 at 10:08:20AM -0400, Alvaro Herrera wrote:

I think if they're to be kept in sync, then the exceptions should be
noted. I mean, where PGCLIENTENCODING would otherwise be, I'd add
/* PGCLIENTENCODING set above */
/* See below for PGHOSTADDR */
and so on (PGHOST and PGPORT probably don't need this because they're
immediately below; not sure; but I would put them in alphabetical order
in both lists for sure and then that wouldn't apply). Otherwise I would
think that it's an omission and would set to fix it.

Good idea, thanks. I'll add comments for each one that cannot be
unsetted.
--
Michael

#4Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#3)
Re: pg_regress.c also sensitive to various PG* environment variables

On Sat, Jun 12, 2021 at 09:10:06AM +0900, Michael Paquier wrote:

Good idea, thanks. I'll add comments for each one that cannot be
unsetted.

And done, finally.
--
Michael