<div>Hi,<br></div><div>I have a question about DB connections. Is it real to make connection for each logined user or for each child? Now I create a new DB connection in child_init() hook:</div><div> </div><div>PGconn *conn;<br>
</div><div></div><div> int child_init()<br> { <br>conn = PQconnectdb(conn_str);<br>         return 0;<br> }<br></div><div></div><div><br></div><div> int pg_connect()<br> {<br>         if(conn)<br>                 PQreset(conn);<br>         else<br>                 conn = PQconnectdb(conn_str);<br>
<br>         if(conn &amp;&amp; PQstatus(conn) == CONNECTION_OK)<br>         {<br>                 info(&quot;Connected to PostgreSQL. Server version %d&quot;, <br>                         PQserverVersion(conn));<br>                 info(&quot;conn = %p&quot;, conn);<br>                 return 0;<br>
         }<br>  <br>         pg_finish();<br>         err(&quot;Connection to PostgreSQL failed&quot;);<br>         return 1;<br> }<br><br></div>