PGconn and fork

From: Rodrigo Barboza <rodrigombufrj(at)gmail(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: PGconn and fork
Date: 2013-05-08 13:29:48
Message-ID: CANs8QJajRnuU-Yz26ZQnO7ymAj+wgDvNOZ4L7sWm6y6n7ZeypQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Hi, guys.
I have a program in C, the createas a connection, do stuff, fork, exit
child and continues life.
Supose that when I create de PGconn, I have 1 active connection in postgres.
When I fork, does it count as a second connection? I mean, will postrges
interpretate 2 active connections or they only share the same connection?
I know that if the child process execute some query, I can get unexpected
results, but it doesn't, so I am safe about that.
I'm only worried that this can increase the number of connections and reach
the limit of max_connections.

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2013-05-08 14:03:26 Re: PGconn and fork
Previous Message dhaval257 2013-03-04 09:00:20 PostgreSQL connect with Visual C++