Use column names, not numeric offsets in the postgres adapter also
authorMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 3 Nov 2010 00:23:54 +0000 (20:23 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 3 Nov 2010 00:23:54 +0000 (20:23 -0400)
framework/Db/lib/Horde/Db/Adapter/Postgresql/Schema.php

index 4cc858a..7126e64 100644 (file)
@@ -290,8 +290,8 @@ class Horde_Db_Adapter_Postgresql_Schema extends Horde_Db_Adapter_Base_Schema
         // create columns from rows
         $columns = array();
         foreach ($rows as $row) {
-            $columns[$row[0]] = $this->makeColumn(
-                $row[0], $row[2], $row[1], !(boolean)$row[3]);
+            $columns[$row['attname']] = $this->makeColumn(
+                $row['attname'], $row['adsrc'], $row['format_type'], !(boolean)$row['attnotnull']);
         }
         return $columns;
     }