From:             [EMAIL PROTECTED]
Operating system: RedHat 7.0
PHP version:      4.1.1
PHP Bug Type:     PostgreSQL related
Bug description:  pg_close($conn2) closes all connections?


/* TWO CONNECTIONS TO SAME SERVER, SAME DATABASE */

$conn1=pg_Connect("host=172.15.15.1 user=me dbname=mydb");
$conn2=pg_Connect("host=172.15.15.1 user=me dbname=mydb");

/* QUERIES HERE OK ON EITHER CONNECTION */
$result=pg_exec($conn1, "select stuff from table");
$result=pg_exec($conn2, "select stuff from table");


/* CLOSE conn2, conn1 SHOULD STILL BE OPEN */
$conn2=pg_close($conn2);


$result=pg_exec($conn1, "select stuff from table");
// ERROR! $conn1 seems to have been closed!



// MAYBE YOU ASK WHY WE DO TWO CONNS TO SAME db?
// NORMALLY, THEY ARE TWO DIFFERENT db's, MAIN and
// BACKUP.  IN A failover SITUATION, BACKUP DB IS 
// DOING BOTH JOBS, SO BOTH CONNS TO SAME MACHINE

// OUR PROBLEM FIXED WITH CONDITIONAL CODE: EG: IF
// MAIN AND BACKUP DBS ARE SAME, DON'T MAKE SECOND 
// CONNECTION, BUT .... THOUGHT YOU SHOULD KNOW
// ABOUT THIS.








-- 
Edit bug report at http://bugs.php.net/?id=16569&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=16569&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=16569&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=16569&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=16569&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16569&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=16569&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=16569&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=16569&r=submittedtwice

Reply via email to