Edit report at http://bugs.php.net/bug.php?id=54607&edit=1

 ID:                 54607
 Comment by:         sesebs at gmail dot com
 Reported by:        sesebs at gmail dot com
 Summary:            Warning on pg_connection_status()
 Status:             Open
 Type:               Bug
 Package:            PostgreSQL related
 Operating System:   Ubuntu 8.04
 PHP Version:        5.2.6
 Block user comment: N
 Private report:     N

 New Comment:

If the resource is not a valid PostgreSql link resource,
pg_connection_status() return PGSQL_CONNECTION_BAD but in my case it
generate a warning more. I'm catching the warning with a personalized
error handler but I prefer keep the php error handler with a
error_reporting() set to E_ALL. Is There is a solution to verify my
connection without generate a warning ? Thanks.


Previous Comments:
------------------------------------------------------------------------
[2011-04-27 20:16:10] felipecg00 at gmail dot com

Seems like the problem is the resource $conn and not the function
pg_connection_status().



It's like the function couldn't use that resource to do what it must to
return the expected value.

------------------------------------------------------------------------
[2011-04-27 12:08:14] sesebs at gmail dot com

Not PHP 5.3.6 but 5.2.6

------------------------------------------------------------------------
[2011-04-26 15:30:10] sesebs at gmail dot com

Description:
------------
In order to verify my connection to PostgreSql, I use
PG_CONNECTION_STATUS(). When I try to check my connection, I have a
warning who said : "pg_connection_status(): 103 is not a valid
PostgreSQL link resource".

PG_CONNECTION_STATUS() should return just PGSQL_CONNECTION_BAD if the
connection is not a valid PostgreSQL link ressource. Why there is a
warning who appears ?

Test script:
---------------
$state = pg_connection_status($conn);

if ($state === PGSQL_CONNECTION_OK) {

  return true;

}

Actual result:
--------------
pg_connection_status(): 103 is not a valid PostgreSQL link resource


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54607&edit=1

Reply via email to