From:             [EMAIL PROTECTED]
Operating system: Any
PHP version:      4.3.0
PHP Bug Type:     Feature/Change Request
Bug description:  Extending pg_meta_data() for arrays

IMO it would be helpful if pg_meta_data() could also return the dimension
of an array if one uses this feature of postgres:

diff -u php4-4.3.0-compiled/ext/pgsql/pgsql.c
php4-4.3.0/ext/pgsql/pgsql.c
--- php4-4.3.0-compiled/ext/pgsql/pgsql.c       2002-12-21
18:46:32.000000000 +0100
+++ php4-4.3.0/ext/pgsql/pgsql.c        2003-02-16 14:57:10.000000000
+0100
@@ -3078,7 +3078,7 @@
        zval *elem;

        smart_str_appends(&querystr,
-                       "SELECT a.attname, a.attnum, t.typname, a.attlen,
a.attnotNULL, a.atthasdef "
+                       "SELECT a.attname, a.attnum, t.typname, a.attlen,
a.attnotNULL, a.atthasdef, a.attndims "
                        "FROM pg_class as c, pg_attribute a, pg_type t "
                        "WHERE a.attnum > 0 AND a.attrelid = c.oid AND
c.relname = '");

@@ -3117,6 +3117,7 @@
                else {
                        add_assoc_bool(elem, "has default", 0);
                }
+               add_assoc_long(elem, "array dims",
atoi(PQgetvalue(pg_result,i,6)));
                name = PQgetvalue(pg_result,i,0);
                add_assoc_zval(meta, name, elem);
        }

-- 
Edit bug report at http://bugs.php.net/?id=22243&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22243&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22243&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22243&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22243&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22243&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22243&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22243&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22243&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22243&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22243&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22243&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22243&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22243&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22243&r=gnused

Reply via email to