[GENERAL] Sharing database handles across forked child processes

2007-11-13 Thread dan
How does Postgres handle sharing database handles across child processes? That is, if I have a process that opens a connection to the database and then forks a few child processes, what happens? Can the child processes safely use the handle? If one child closes the handle, what happens to the h

Re: [GENERAL] Sharing database handles across forked child processes

2007-11-13 Thread Martijn van Oosterhout
On Tue, Nov 13, 2007 at 12:02:31PM -0500, [EMAIL PROTECTED] wrote: > How does Postgres handle sharing database handles across child processes? > That is, if I have a process that opens a connection to the database and > then forks a few child processes, what happens? > > Can the child processes sa

Re: [GENERAL] Sharing database handles across forked child processes

2007-11-13 Thread Tom Lane
Martijn van Oosterhout <[EMAIL PROTECTED]> writes: > On Tue, Nov 13, 2007 at 12:02:31PM -0500, [EMAIL PROTECTED] wrote: >> How does Postgres handle sharing database handles across child processes? >> That is, if I have a process that opens a connection to the database and >> then forks a few child

Re: [GENERAL] Sharing database handles across forked child processes

2007-11-13 Thread dan
> Martijn van Oosterhout <[EMAIL PROTECTED]> writes: >> On Tue, Nov 13, 2007 at 12:02:31PM -0500, [EMAIL PROTECTED] wrote: >>> How does Postgres handle sharing database handles across child >>> processes? >>> That is, if I have a process that opens a connection to the database >>> and >>> then fork

Re: [GENERAL] Sharing database handles across forked child processes

2007-11-13 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > Yep, this is a fork without exec. And the child processes often aren't > even doing any database access -- the database connection's opened and > held, then a child is forked off, and the child 'helpfully' closes the > handle during the child'

Re: [GENERAL] Sharing database handles across forked child processes

2007-11-13 Thread Martijn van Oosterhout
On Tue, Nov 13, 2007 at 01:18:25PM -0500, [EMAIL PROTECTED] wrote: > Yep, this is a fork without exec. And the child processes often aren't > even doing any database access -- the database connection's opened and > held, then a child is forked off, and the child 'helpfully' closes the > handle duri

Re: [GENERAL] Sharing database handles across forked child processes

2007-11-13 Thread Vivek Khera
On Nov 13, 2007, at 1:18 PM, [EMAIL PROTECTED] wrote: Yep, this is a fork without exec. And the child processes often aren't even doing any database access -- the database connection's opened and held, then a child is forked off, and the child 'helpfully' closes the handle during the child's gl

Re: [GENERAL] Sharing database handles across forked child processes

2007-11-13 Thread dan
> > -BEGIN PGP SIGNED MESSAGE- > Hash: RIPEMD160 > > >> Yep, this is a fork without exec. And the child processes often aren't >> even doing any database access -- the database connection's opened and >> held, then a child is forked off, and the child 'helpfully' closes the >> handle during