#27824 [Opn]: pg_pconnect failing to create multiple connections per script

From: Date: Thu, 01 Apr 2004 16:51:47 +0000
Subject: #27824 [Opn]: pg_pconnect failing to create multiple connections per script
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969359890@lists.php.net to get a copy of this message
ID: 27824 Updated by: derick@php.net Reported By: gwood at ewebengine dot com Status: Open Bug Type: Documentation problem Operating System: FreeBSD 5.1-RELEASE-p10 PHP Version: 4.3.4 New Comment: Oops, last one should be: pg_connect(string host, string port, int options, string tty, string db_name) Previous Comments: ------------------------------------------------------------------------ [2004-04-01 11:51:05] derick@php.net It seems that it already exist, but it's not documented or no longer working correctly anymore. It *seems* that you can can pass it like this: pg_connect("conectionstring", PGSQL_CONNECT_FORCE_NEW); also, the order of parameters documented in the manaul for the old *deprecated* way for connecting to PGSQL is wrong: pg_connect("host", "port", "options", "tty", "dbname") from what I read from the source it should be: pg_connect(string connect_string [, int options ]) or pg_connect(string host, string port, string db_name ) or pg_connect(string host, string port, int options, string db_name) or pg_connect(string host, string port, int options, string db_name, string tty) ------------------------------------------------------------------------ [2004-04-01 09:56:20] derick@php.net Making this a feature request, as the MySQL extension actually has a parameter to force a new connection. ------------------------------------------------------------------------ [2004-04-01 09:52:38] gwood at ewebengine dot com You are exactly correct, I apologize: I was incorrect about my expectations of pg_connect(). I reread the documentation with regards to this and sure enough that is the expected behavior. In my testing I had mixed pg_pconnect() and pg_connect() which resulted in different results, hence my confusion. I guess I'll have to fool PHP into thinking that they're two separate connections by creating a junk user or an alias for the host name. Ugh. ------------------------------------------------------------------------ [2004-04-01 09:23:56] derick@php.net Non-persistent connections behave exactly the same as persistent ones for this too. If not, *that*'s a bug. Can you please verify that? ------------------------------------------------------------------------ [2004-04-01 09:06:59] gwood at ewebengine dot com If this isn't considered a bug, then the documentation is incorrect. The documentation states that persistant connections can be swapped out for non-persistant connections with no problem. This IS NOT TRUE for the example I presented. If this is expected behaviour this caveat needs to be added to the warnings on the persistant connection page. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/27824 -- Edit this bug report at http://bugs.php.net/?id=27824&edit=1

« previous php.doc (#969359890) next »