Fixed Bug #1697920: Can't assign a field type/domain of a different schema
authormr-russ <mr-russ>
Wed, 18 Apr 2007 15:50:21 +0000 (15:50 +0000)
committermr-russ <mr-russ>
Wed, 18 Apr 2007 15:50:21 +0000 (15:50 +0000)
We now show all domains that are available in the database, pg_type_is_visible just finds out if the current type is in the search_path.  We just schema qualify all of the types and everything works.

HISTORY
classes/database/Postgres73.php

diff --git a/HISTORY b/HISTORY
index 2c3337295104dbecbeb59db395a9598fe1e941d6..ea541a50797e4dac5ae52618fad6265857dbf924 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -5,6 +5,7 @@ Version 4.1.2
 -------------
 
 Bugs
+* Fix inability to assign a field type/domain of a different schema
 * Fix PHP5 Strict mode complaints 
 * Fix IN/NOT IN to accept text input lists 'a','b'.
 * Fix bytea doesn't display as NULL when NULL
index 52661de9411e4fe713c622d5af1a36ecfdb9a4b3..5bb1779fdf05f0c73d2eaba2e4fdd23e2b6a71fa 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres73.php,v 1.161 2007/01/10 02:01:17 soranzo Exp $
+ * $Id: Postgres73.php,v 1.160.2.1 2007/04/18 15:50:21 mr-russ Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -321,8 +321,8 @@ class Postgres73 extends Postgres72 {
                $rs = $this->selectSet($sql);
                if ($rs->recordCount() != 1) return -99;
                else {
-                       $rs->fields['relhasoids'] = $this->phpBool($rs->fields['relhasoids']);
-                       return $rs->fields['relhasoids'];
+                       $rs->f['relhasoids'] = $this->phpBool($rs->f['relhasoids']);
+                       return $rs->f['relhasoids'];
                }
        }
 
@@ -355,7 +355,7 @@ class Postgres73 extends Postgres72 {
                else {
                        $temp = array();
                        while (!$rs->EOF) {
-                               $temp[$rs->fields['attnum']] = $rs->fields['attname'];
+                               $temp[$rs->f['attnum']] = $rs->f['attname'];
                                $rs->moveNext();
                        }
                        return $temp;
@@ -396,7 +396,7 @@ class Postgres73 extends Postgres72 {
                }
                // Otherwise find the names of the keys
                else {
-                       $attnames = $this->getAttributeNames($oldtable, explode(' ', $rs->fields['indkey']));
+                       $attnames = $this->getAttributeNames($oldtable, explode(' ', $rs->f['indkey']));
                        if (!is_array($attnames)) {
                                $this->rollbackTransaction();
                                return -1;
@@ -667,7 +667,7 @@ class Postgres73 extends Postgres72 {
                // Get the minimum value of the sequence
                $seq = $this->getSequence($sequence);
                if ($seq->recordCount() != 1) return -1;
-               $minvalue = $seq->fields['min_value'];
+               $minvalue = $seq->f['min_value'];
 
                /* This double-cleaning is deliberate */
                $this->fieldClean($sequence);
@@ -1015,7 +1015,7 @@ class Postgres73 extends Postgres72 {
         */
        function getTypes($all = false, $tabletypes = false, $domains = false) {
                if ($all)
-                       $where = 'pg_catalog.pg_type_is_visible(t.oid)';
+                       $where = '1 = 1';
                else
                        $where = "n.nspname = '{$this->_schema}'";
                // Never show system table types