From:             miksir at maker dot ru
Operating system: Linux
PHP version:      5.2.3
PHP Bug Type:     PostgreSQL related
Bug description:  pg_meta_data mix tables metadata from different schemas

Description:
------------
If a database contains tables with the same name in different schemas,
requesting the meta data for this table returns a mix for all fields in
all that tables.
Related to bug #35996 http://bugs.php.net/35996

Reproduce code:
---------------
mydb=# create schema a;
mydb=# create schema b;
mydb=# create table a.test(id int, field1 text);
mydb=# create table b.test(id int, field2 text);

In PHP connect to `mydb' with user `a' (search_path will be set to schema
a) or with different user and say "set search_path = 'a';". Use
pg_meta_data('test') for get table metadata.

Expected result:
----------------
a.test metadata:
 attname | attnum | typname | attlen | attnotnull | atthasdef |att...
---------+--------+---------+--------+------------+-----------+-----
 id      |      1 | int4    |      4 | f          | f         |    0
 field1  |      2 | text    |     -1 | f          | f         |    0


Actual result:
--------------
mix of a.test and b.test metadata:
 attname | attnum | typname | attlen | attnotnull | atthasdef |att...
---------+--------+---------+--------+------------+-----------+-----
 id      |      1 | int4    |      4 | f          | f         |    0
 id      |      1 | int4    |      4 | f          | f         |    0
 field1  |      2 | text    |     -1 | f          | f         |    0
 field2  |      2 | text    |     -1 | f          | f         |    0

-- 
Edit bug report at http://bugs.php.net/?id=42078&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42078&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42078&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42078&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42078&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42078&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42078&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42078&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42078&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42078&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42078&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42078&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42078&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42078&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42078&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42078&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42078&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42078&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42078&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42078&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42078&r=mysqlcfg

Reply via email to