Perrin wrote:
> ==> $connection  = pg_connect("$constr user='$USER' password='$PW'");
> Actually It should be closed the connection after access finished, like that 
> ==> pg_close($connection);
> But if the user force to close the web page that means have not close the 
>connection. I want to ask the connection will be closed by Apache Server automatic ? 
>or when user closed the web page the connection will be closed at the same time ? If 
>the connection have not been closed automatic. So the Apache Server will keep the 
>connect port forever ?
> Actually the connection port handle by Apache Server or PHP ?
If you use pg_connect, it will close when the script is finished, like
when the page is to the browser.  If you use pg_pconnect, it will stay
open for other pages to use.  I am not sure how pg_close affects a
pg_pconnect.  As most of the overhead with postgres is in opening the
connection, I use pg_pconnect, and never close it.  This improves
performance, but if I want to shutdown, I have to shutdown apache before
I shut down postgres just in case there was some recent activity, and it
hasn't timed out yet.

PHP Database Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to