Re: Sharing database handles across forked child processes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Sharing database handles across forked child processes
Дата
Msg-id 18873.1194974812@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Sharing database handles across forked child processes  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: Sharing database handles across forked child processes
Список pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> On Tue, Nov 13, 2007 at 12:02:31PM -0500, dan@sidhe.org 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Sharing database handles across forked child processes
Следующее
От: Reg Me Please
Дата:
Сообщение: Re: Postgres table size