PHP 4.0 Bug #7007 Updated: The pg_close function doesn't close the connection.
| From: | thies@php.net | Date: | Tue, 13 Feb 2001 17:43:11 +0000 |
| Subject: | PHP 4.0 Bug #7007 Updated: The pg_close function doesn't close the connection. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-46502@lists.php.net to get a copy of this message | ||
ID: 7007
Updated by: thies
Reported By: alex@zend.com
Old-Status: Open
Status: Analyzed
Bug Type: PostgreSQL related
Assigned To:
Comments:
it seems that postgres does not shut down connections synchronous which means that after pg_close()
the connection is still alive for a very short moment (and so are the locks). inserting a sleep(1)
after pg_close() fixed the problem 100% for me. i'm in contact with some postgres guy to
confirm. i can assure you that it's not a php-problem.
Previous Comments:
---------------------------------------------------------------------------
[2000-10-04 03:05:12] alex@zend.com
The script below doesn't remove the database because the second
link is not closed and the postgres will not drop a database if there is a connection using it.
<?php
$id1 = pg_connect("host=cheese port=7655 user=zendtest password=********
dbname=template1");
pg_exec($id1, "CREATE DATABASE zendtest");
pg_close($id1);
$id2 = pg_connect("host=cheese port=7655 user=zendtest password=dnez
dbname=zendtest");
pg_close($id2);
$id3 = pg_connect("host=cheese port=7655 user=zendtest password=********
dbname=template1");
pg_exec($id3, "DROP DATABASE zendtest");
pg_close($id3);
?>
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=7007&edit=2