From: gwood at ewebengine dot com Operating system: FreeBSD 5.1-RELEASE-p10 PHP version: 4.3.4 PHP Bug Type: PostgreSQL related Bug description: pg_pconnect failing to create multiple connections per script
Description: ------------ According to the documentation: "An important summary. Persistent connections were designed to have one-to-one mapping to regular connections. That means that you should always be able to replace persistent connections with non-persistent connections, and it won't change the way your script behaves. It may (and probably will) change the efficiency of the script, but not its behavior!" This does not appear to be the case with pg_pconnect. Specifically, creating two database connections using pg_pconnect with the same connection parameters, results in only a single database connection. This means that instead of being able to execute queries in parallel, all queries are executed sequentially. This happens with both the CLI interface and mod_php. Reproduce code: --------------- $conn1 = pg_pconnect($connect_string); $conn2 = pg_pconnect($connect_string); pg_query($conn1, 'BEGIN'); pg_query($conn2, 'BEGIN'); pg_query($conn1, 'INSERT INTO test (int1) VALUES (1)'); pg_query($conn2, 'INSERT INTO test (int1) VALUES (2)'); pg_query($conn1, 'ROLLBACK'); pg_query($conn2, 'COMMIT'); Expected result: ---------------- This should result in the second insert to the database being committed, while the first insert is rolled back. This is what happens when pg_connect() is substituted for pg_pconnect. Actual result: -------------- Both inserts are rolled back. -- Edit bug report at http://bugs.php.net/?id=27824&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27824&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27824&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27824&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27824&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27824&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27824&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27824&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27824&r=support Expected behavior: http://bugs.php.net/fix.php?id=27824&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27824&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27824&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27824&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27824&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27824&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27824&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27824&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27824&r=float