Martijn van Oosterhout <kleptog@xxxxxxxxx> writes: > On Tue, Nov 13, 2007 at 12:02:31PM -0500, dan@xxxxxxxxx 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 safely use the handle? > No. For some time now, libpq has set FD_CLOEXEC on the socket connection to the backend, which ensures that child processes won't be able to mess up the parent's database connection. However it sounded like Dan might be doing fork without exec, in which case he's definitely at risk ... regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings