ID: 38014 Updated by: [EMAIL PROTECTED] Reported By: unex at linija dot org Status: Bogus Bug Type: Scripting Engine problem Operating System: *BSD, but probably independent PHP Version: 5.1.4 New Comment:
http://php.net/pg_connect If a second call is made to pg_connect() with the same connection_string as an existing connection, the existing connection will be returned unless you pass PGSQL_CONNECT_FORCE_NEW as connect_type. Previous Comments: ------------------------------------------------------------------------ [2006-07-05 11:37:58] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php . ------------------------------------------------------------------------ [2006-07-05 11:34:27] unex at linija dot org Description: ------------ Seems there is a problem with reference counting. The further example shows how pg_close() dereferences connection instead of just closing one. I'm not sure how PHP works, but this problem could exist deeper than in PostgreSQL extension, but that's really yours competence. Thanks. Reproduce code: --------------- <? $Con1 = pg_connect("dbname=template1"); $Con2 = pg_connect("dbname=template1"); pg_close($Con1); if(!ping($Con2)) echo "Connection 2 was closed too"; else pg_close($Con2); ?> Expected result: ---------------- Only first connection should be closed. Actual result: -------------- Both connections was closed. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38014&edit=1
