Re: libpq enhancement for multi-process application - Mailing list pgsql-hackers

From Daniele Orlandi
Subject Re: libpq enhancement for multi-process application
Date
Msg-id 3A3F9672.7F7361BB@orlandi.com
Whole thread Raw
In response to libpq enhancement for multi-process application  (Sébastien Bonnet <bonseb@free.fr>)
List pgsql-hackers
Sébastien Bonnet wrote:
> 
> Hi all, and mainly postresql developpers,
> 
> I've been reading old posts about the libpq interface related to multi-process
> application. The main problem being that after a fork, each process has a DB
> connexion, actually the same. If one closes it, the other one remains in a
> unknown or not stable state.

Uhm... I always thought that sharing the same socket between processes
is wrong.

My multi-process daemon works like apache with a pool of processes
everyone with its own connection to the DB. The connection is only
opened AFTER the fork and remains open as long as the process lives just
to avoid a new connection for each accept.

Bye!


pgsql-hackers by date:

Previous
From: "Hiroshi Inoue"
Date:
Subject: Is PQreset() proper ?
Next
From: mlw
Date:
Subject: Sample databases?