Re: Let's start using setenv()

2020-12-29 Thread Tom Lane
Thomas Munro writes: > On Wed, Dec 30, 2020 at 5:45 AM Tom Lane wrote: > +/* We assume the error must be "out of memory" */ > +ereport(LOG, > +(errcode(ERRCODE_OUT_OF_MEMORY), > + errmsg("out of memory"))); > Wouldn't it be better t

Re: Let's start using setenv()

2020-12-29 Thread Thomas Munro
On Wed, Dec 30, 2020 at 5:45 AM Tom Lane wrote: > Since the cfbot seems happy with v1, here's a v2 that runs around > and converts all putenv() uses to setenv(). In some places there's > no notational savings, but it seems to me that standardizing > on just one way to do it is beneficial. +

Re: Let's start using setenv()

2020-12-29 Thread Tom Lane
Since the cfbot seems happy with v1, here's a v2 that runs around and converts all putenv() uses to setenv(). In some places there's no notational savings, but it seems to me that standardizing on just one way to do it is beneficial. I'm not sure if there would be any value in revising win32env.c

Re: Let's start using setenv()

2020-12-28 Thread Tom Lane
Thomas Munro writes: > On Tue, Dec 29, 2020 at 4:21 PM Tom Lane wrote: >> I also changed our unsetenv() emulations to make them return an int >> error indicator, as per POSIX. I have no desire to change the call >> sites to check for errors, but it seemed like our compatibility stubs >> should b

Re: Let's start using setenv()

2020-12-28 Thread Thomas Munro
On Tue, Dec 29, 2020 at 4:21 PM Tom Lane wrote: > Back in 2001 we decided to prefer putenv() over setenv() because the > latter wasn't in POSIX (SUSv2) at the time. That decision has been > overtaken by events: more recent editions of POSIX not only provide > setenv() but recommend it over putenv