php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #22243 Extending pg_meta_data() for arrays
Submitted: 2003-02-16 08:56 UTC Modified: 2003-08-26 19:04 UTC
From: m-lesser at better-com dot de Assigned: yohgaki (profile)
Status: Closed Package: Feature/Change Request
PHP Version: 4.3.0 OS: Any
Private report: No CVE-ID: None
 [2003-02-16 08:56 UTC] m-lesser at better-com dot de
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);
        }

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-25 07:59 UTC] yohgaki@php.net
Prevent me to forget about this
 [2003-08-26 19:04 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

This feature is now part of php 5.0
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 08:02:42 2024 UTC