php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5862 Consecutive pg_open statements cause second statement to fail
Submitted: 2000-07-30 18:47 UTC Modified: 2001-02-13 11:57 UTC
From: reinke at e-softinc dot com Assigned:
Status: Closed Package: PostgreSQL related
PHP Version: 4.0.1pl2 OS: Linux RedHat 6.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: reinke at e-softinc dot com
New email:
PHP Version: OS:

 

 [2000-07-30 18:47 UTC] reinke at e-softinc dot com
Using PostGres 7.0.2, and the latest PHP, any script that
would choose to open a database connection a second time
will fail.

For example:

<?
        $pg = pg_connect("dbname=customer");
        $res  = pg_exec("select count(*) from list_weeklynews;");
        pg_close($pg);

        $pg = pg_connect("dbname=customer");
        $res  = pg_exec("select count(*) from list_weeklynews;");
        pg_close($pg);
?>

The second connect fails with:

1 is not a valid PostgreSQL link resource in file.php

Repeating the 3 lines multiple times in the script does pretty
unusual stuff - the file descriptor is bouncing all over the place -
if file descriptors were properly closed, the same descriptor
would in all likelihood be re-used


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-13 11:57 UTC] thies@php.net
fixed in CVS
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 06:01:30 2024 UTC