ID: 39979 User updated by: solar dot c at gmx dot net Reported By: solar dot c at gmx dot net Status: Assigned Bug Type: PostgreSQL related Operating System: SLES 10 PHP Version: 5.2.0 Assigned To: iliaa New Comment:
Hi, I've seen that the bug should be solved in the latest CVS - at least iliaa has written a comment with this information (why did you removed your comment?). So I fetched the latest CVS and tryed it - didn't solve the Problem. How can I help you to solve it? Greetz Clemens Previous Comments: ------------------------------------------------------------------------ [2006-12-28 17:46:00] solar dot c at gmx dot net Description: ------------ I want to force a NEW connection to a psql server with PGSQL_CONNECT_FORCE_NEW. After this i make a second pg_connect, which should have the same connection/ressource as the 1st one. But with the force-option the second pg_connect is also forced to establish a new connection (the 3rd pg_connect will use the ressource of the 2nd). I tested this on 5.2 and 5.1.1. Only 5.2 showed up this behavior. Apache2, PostgreSQL 8.2 and 8.0.3 Reproduce code: --------------- <?php $host = "dbhost.local"; $port = "1234"; $dbname = "dbname"; $user = "dbuser"; $password = "dbpass"; $connstring = "host={$host} port={$port} dbname={$dbname} user={$user} password={$password}"; $conn1 = pg_connect($connstring, PGSQL_CONNECT_FORCE_NEW); $conn2 = pg_connect($connstring); $conn3 = pg_connect($connstring); print "conn1:".intval($conn1); print "\nconn2:".intval($conn2); // different result than 1 print "\nconn3:".intval($conn3); // different result than 1 (same as 2) // get current activity $qry = "select * from pg_stat_activity;"; $res2 = pg_query($conn2, $qry); $res3 = pg_query($conn3, $qry); $res1 = pg_query($conn1, $qry); // we will know see 2 openend connections (if the pg_server issn't busy elsewhere ;)) - except of 1 var_dump(pg_fetch_all($res1)); ?> Expected result: ---------------- Expected to only establish 1 connection, and reuse the established ones. the ressource id outputted should be everytime same. the stat_activity should show only one recordset (if the server issn't busy elsewhere). Actual result: -------------- 2 connection will be established, 2 different ressource ids 2 recordsets will be returned @ var_dump ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39979&edit=1