From: hayk at mail dot ru
Operating system: FreeBSD 4.8
PHP version: 4.3.8
PHP Bug Type: PostgreSQL related
Bug description: pg_fieldname returns an unqualified name
Description:
------------
For "SELECT field1, field2 FROM table"
pg_field_name() returns "field1" and "field2", but for "SELECT 'field1',
'field2' FROM table" (when fields name in single quotes) returns
"?column?" and "?column?".
PostgreSQL(libpq) Version 7.4.2
Reproduce code:
---------------
$pc = pg_connect("dbname=webmail");
$res = pg_query($pc, "SELECT 'userid', 'domainid' FROM users WHERE
userid=1");
$num = pg_num_fields($res);
for ($i=0; $i<$num; $i++)
{
$fieldname = pg_field_name($res, $i);
echo "column $i: $fieldname <br>";
}
Expected result:
----------------
column 0: userid
column 1: domainid
Actual result:
--------------
column 0: ?column?
column 1: ?column?
--
Edit bug report at http://bugs.php.net/?id=29709&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29709&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29709&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29709&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29709&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29709&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29709&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29709&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29709&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29709&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29709&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29709&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29709&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29709&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29709&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29709&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29709&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29709&r=float