Thread: Re: [COMMITTERS] pgsql-server/src backend/main/main.c b

Re: [COMMITTERS] pgsql-server/src backend/main/main.c b

From
Claudio Natoli
Date:
> Tom Lane wrote:
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > Tom Lane wrote:
> > >> Also, in the non-exec case it seems unnecessary and possibly unsafe
to
> > >> repeat this computation in a backend.
> >
> > > Thanks.  It originally was as below and I forgot about that.  It now
is:
> > >     if (my_exec_path[0] == '\0' && find_my_exec(argv[0],
my_exec_path) < 0)
> > > The issue is that fork/exec will need to set it too.
> >
> > That fixes it for my_exec_path, but what of the pkglib_path stuff?
>
> OK, I will fix that one, though it is a cheap call.

There's also the possibility of adding it to read/write_backend_variables,
just as we add other variables for fork/exec that we want the backends to
inherit.

Cheers,
Claudio

---
Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see
<a
href="http://www.memetrics.com/emailpolicy.html">http://www.memetrics.com/em
ailpolicy.html</a>

Re: [COMMITTERS] pgsql-server/src backend/main/main.c b ackend/p

From
Bruce Momjian
Date:
Claudio Natoli wrote:
>
> > Tom Lane wrote:
> > > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > > Tom Lane wrote:
> > > >> Also, in the non-exec case it seems unnecessary and possibly unsafe
> to
> > > >> repeat this computation in a backend.
> > >
> > > > Thanks.  It originally was as below and I forgot about that.  It now
> is:
> > > >     if (my_exec_path[0] == '\0' && find_my_exec(argv[0],
> my_exec_path) < 0)
> > > > The issue is that fork/exec will need to set it too.
> > >
> > > That fixes it for my_exec_path, but what of the pkglib_path stuff?
> >
> > OK, I will fix that one, though it is a cheap call.
>
> There's also the possibility of adding it to read/write_backend_variables,
> just as we add other variables for fork/exec that we want the backends to
> inherit.

In the exec case, the executable name is actually different from the
postmaster, so passing it doesn't make sense.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: [COMMITTERS] pgsql-server/src backend/main/main.c b ackend/p

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Claudio Natoli wrote:
>> There's also the possibility of adding it to read/write_backend_variables,
>> just as we add other variables for fork/exec that we want the backends to
>> inherit.

> In the exec case, the executable name is actually different from the
> postmaster, so passing it doesn't make sense.

How much do we care?  AFAIK we only really care about the directory part
of the path, no?  There are ports that need the exact executable
pathname for dynamic loading purposes, but I'd think Windows is not one
of them.

            regards, tom lane

Re: [COMMITTERS] pgsql-server/src backend/main/main.c b ackend/p

From
Bruce Momjian
Date:
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Claudio Natoli wrote:
> >> There's also the possibility of adding it to read/write_backend_variables,
> >> just as we add other variables for fork/exec that we want the backends to
> >> inherit.
>
> > In the exec case, the executable name is actually different from the
> > postmaster, so passing it doesn't make sense.
>
> How much do we care?  AFAIK we only really care about the directory part
> of the path, no?  There are ports that need the exact executable
> pathname for dynamic loading purposes, but I'd think Windows is not one
> of them.

Agreed, but I figured we should be accurate if we can.  For fork-only,
our binary is postmaster, while for fork/exec, it is postgres.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073