Re: Add SHELL_EXIT_CODE to psql - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: Add SHELL_EXIT_CODE to psql
Date
Msg-id CADkLM=cbXoxEM4w=BouG6=-+jtkCAByemSvCpmMUdCfp8oYTng@mail.gmail.com
Whole thread Raw
In response to Re: Add SHELL_EXIT_CODE to psql  (Maxim Orlov <orlovmg@gmail.com>)
List pgsql-hackers
On Tue, Jan 10, 2023 at 3:54 AM Maxim Orlov <orlovmg@gmail.com> wrote:


On Mon, 9 Jan 2023 at 21:36, Corey Huinker <corey.huinker@gmail.com> wrote:

I chose a name that would avoid collisions with anything a user might potentially throw into their environment, so if the var "OS" is fairly standard is a reason to avoid using it. Also, going with our own env var allows us to stay in perfect synchronization with the build's #ifdef WIN32 ... and whatever #ifdefs may come in the future for new OSes. If there is already an environment variable that does that for us, I would rather use that, but I haven't found it.

Perhaps, I didn't make myself clear. Your solution is perfectly adapted to our needs.
But all Windows since 2000 already have an environment variable OS=Windows_NT. So, if env OS is defined and equal Windows_NT, this had to be Windows.
May we use it in our case? I don't insist, just asking.

Ah, that makes more sense. I don't have a strong opinion on which we should use, and I would probably defer to someone who does windows (and possibly cygwin) builds more often than I do.

pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Re: heapgettup refactoring
Next
From: Matthias van de Meent
Date:
Subject: Re: BUG: Postgres 14 + vacuum_defer_cleanup_age + FOR UPDATE + UPDATE