Claudio Natoli wrote:
> * With regards to BackendFork itself, was your plan to reduce this to simply
> formatting the argument list, and calling fork/exec, with things like random
> number seeding and the like moved into PostgresMain? (ie. the BackendFork
> call would actually be performed by the Postmaster, with BackendFork
> rewritten such that no "global" context is required between the fork and
> exec calls; which'll be what we need to make Win32/CreateProcess changes
> possible). If not, could you give me an idea of what you had intended?
You will see code in postmaster.c that calls
write_nondefault_variables(). That basically dumps out GUC
variables into a binary file to be read in by fork/exec backends. My
idea is that we will need another similar file for postmaster constants.
The random seed value is unique per-backend, and we want to keep it
secure so we can't pass it on the command line. I am not sure how to
deal with that. I hesitate to add a per-backend file to pass such
things. Does anyone have ideas on how to pass a data value to an
exec()'ed child? Maybe we have to use a pipe between parent/child and
pass the values that way.
--
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