Remove everything about hasSchema as all supported pg version supports schema now...
authorGuillaume (ioguix) de Rorthais <ioguix@free.fr>
Wed, 5 Nov 2008 06:52:35 +0000 (01:52 -0500)
committerGuillaume (ioguix) de Rorthais <ioguix@free.fr>
Wed, 5 Nov 2008 06:52:35 +0000 (01:52 -0500)
18 files changed:
classes/Misc.php
classes/Reports.php
classes/database/Postgres.php
classes/plugins/Slony.php
colproperties.php
constraints.php
database.php
dataexport.php
dbexport.php
display.php
info.php
libraries/lib.inc.php
schemas.php
sequences.php
sql.php
sqledit.php
triggers.php
views.php

index 1f1b8fc15aed88650fd3f88edad7e51363f0fd9e..172c40574f0f29b912f69c857d5aabb11e5417ec 100644 (file)
                                                        'title' => $lang['strschemas'],
                                                        'url'   => 'schemas.php',
                                                        'urlvars' => array('subject' => 'database'),
-                                                       'hide'  => (!$data->hasSchemas()),
                                                        'help'  => 'pg.schema',
                                                        'icon'  => 'Schemas',
                                                ),
                                                ),
                                        );
                                        if (!$data->hasFTS()) unset($tabs['fulltext']);
-                                       if (!$data->hasSchemas()) unset($tabs['schemas']);
                                        return $tabs;
 
                                case 'schema':
                                                        'title' => $lang['strprivileges'],
                                                        'url'   => 'privileges.php',
                                                        'urlvars' => array('subject' => 'schema'),
-                                                       'hide'  => (!$data->hasSchemas()),
                                                        'help'  => 'pg.privilege',
                                                        'tree'  => false,
                                                        'icon'  => 'Privileges',
                function getLastTabURL($section) {
                        global $data;
 
-                       switch ($section) {
-                               case 'database':
-                               case 'role':
-                               case 'schema':
-                                       if ($data->hasSchemas() === false) {
-                                               $section = 'database';
-                                               $tabs = array_merge($this->getNavTabs('schema'), $this->getNavTabs('database'));
-                                               break;
-                                       }
-                               default:
-                                       $tabs = $this->getNavTabs($section);
-                       }
+                       $tabs = $this->getNavTabs($section);
 
                        if (isset($_SESSION['webdbLastTab'][$section]) && isset($tabs[$_SESSION['webdbLastTab'][$section]]))
                                $tab = $tabs[$_SESSION['webdbLastTab'][$section]];
index 3ad5181a1f782a3e00ed292734b8214bb7d8cc8e..0688f35a3019e4c79051448cb35614fd214ba290 100644 (file)
@@ -37,7 +37,7 @@
                                // Create a new database access object.
                                $this->driver = $misc->getDatabaseAccessor($this->reports_db);
                                // Reports database should have been created in public schema
-                               if ($this->driver->hasSchemas()) $this->driver->setSchema($this->reports_schema);
+                               $this->driver->setSchema($this->reports_schema);
                                $status = 0;
                        }
                }
index ac6b873d055f6f8a5205b38e1a32edc670254f7a..6ab8caa7f4da9560b70c54df989c210c74508296 100755 (executable)
@@ -840,13 +840,6 @@ class Postgres extends ADODB_base {
 
        // Schema functons
 
-       /**
-        * Returns the current schema to prepend on object names
-        */
-       function schema() {
-               return "\"{$this->_schema}\".";
-       }
-
        /**
         * Return all schemas in the current database.  This differs from the version
         * in 7.3 only in that it considers the information_schema to be a system schema.
@@ -907,7 +900,7 @@ class Postgres extends ADODB_base {
                        $this->clean($schema);
                        $this->_schema = $schema;
                        return 0;
-                       }
+               }
                else return $status;
                        }
 
@@ -1278,12 +1271,8 @@ class Postgres extends ADODB_base {
                // Output a reconnect command to create the table as the correct user
                $sql = $this->getChangeUserSQL($t->fields['relowner']) . "\n\n";
 
-               // Set schema search path if we support schemas
-               $schema = '';
-               if ($this->hasSchemas()) {
-                       $schema = "\"{$this->_schema}\".";
-                       $sql .= "SET search_path = \"{$this->_schema}\", pg_catalog;\n\n";
-               }
+               // Set schema search path
+               $sql .= "SET search_path = \"{$this->_schema}\", pg_catalog;\n\n";
 
                // Begin CREATE TABLE definition
                $sql .= "-- Definition\n\n";
@@ -1291,8 +1280,8 @@ class Postgres extends ADODB_base {
                // in pg_catalog.
                if (!$clean) $sql .= "-- ";
                $sql .= "DROP TABLE ";
-               $sql .= "{$schema}\"{$t->fields['relname']}\";\n";
-               $sql .= "CREATE TABLE {$schema}\"{$t->fields['relname']}\" (\n";
+               $sql .= "{$this->_schema}\"{$t->fields['relname']}\";\n";
+               $sql .= "CREATE TABLE {$this->_schema}\"{$t->fields['relname']}\" (\n";
 
                // Output all table columns
                $col_comments_sql = '';   // Accumulate comments on columns
@@ -1381,7 +1370,7 @@ class Postgres extends ADODB_base {
                        while (!$parents->EOF) {
                                $this->fieldClean($parents->fields['relname']);
                                // Qualify the parent table if it's in another schema
-                               if ($this->hasSchemas() && $parents->fields['schemaname'] != $this->_schema) {
+                               if ($parents->fields['schemaname'] != $this->_schema) {
                                        $this->fieldClean($parents->fields['schemaname']);
                                        $sql .= "\"{$parents->fields['schemaname']}\".";
                                }
@@ -1415,7 +1404,7 @@ class Postgres extends ADODB_base {
                                        $sql .= "\n";
                                        $first = false;
                                }
-                               $sql .= "ALTER TABLE ONLY {$schema}\"{$t->fields['relname']}\" ALTER COLUMN \"{$atts->fields['attname']}\" SET STATISTICS {$atts->fields['attstattarget']};\n";
+                               $sql .= "ALTER TABLE ONLY {$this->_schema}\"{$t->fields['relname']}\" ALTER COLUMN \"{$atts->fields['attname']}\" SET STATISTICS {$atts->fields['attstattarget']};\n";
                        }
                        // Then storage
                        if ($atts->fields['attstorage'] != $atts->fields['typstorage']) {
@@ -1437,7 +1426,7 @@ class Postgres extends ADODB_base {
                                                $this->rollbackTransaction();
                                                return null;
                                }
-                               $sql .= "ALTER TABLE ONLY {$schema}\"{$t->fields['relname']}\" ALTER COLUMN \"{$atts->fields['attname']}\" SET STORAGE {$storage};\n";
+                               $sql .= "ALTER TABLE ONLY {$this->_schema}\"{$t->fields['relname']}\" ALTER COLUMN \"{$atts->fields['attname']}\" SET STORAGE {$storage};\n";
                        }
 
                        $atts->moveNext();
@@ -1447,7 +1436,7 @@ class Postgres extends ADODB_base {
                if ($t->fields['relcomment'] !== null) {
                        $this->clean($t->fields['relcomment']);
                        $sql .= "\n-- Comment\n\n";
-                       $sql .= "COMMENT ON TABLE {$schema}\"{$t->fields['relname']}\" IS '{$t->fields['relcomment']}';\n";
+                       $sql .= "COMMENT ON TABLE {$this->_schema}\"{$t->fields['relname']}\" IS '{$t->fields['relcomment']}';\n";
                }
 
                // Add comments on columns, if any
@@ -1467,7 +1456,7 @@ class Postgres extends ADODB_base {
                         * wire-in knowledge about the default public privileges for different
                         * kinds of objects.
                         */
-                       $sql .= "REVOKE ALL ON TABLE {$schema}\"{$t->fields['relname']}\" FROM PUBLIC;\n";
+                       $sql .= "REVOKE ALL ON TABLE {$this->_schema}\"{$t->fields['relname']}\" FROM PUBLIC;\n";
                        foreach ($privs as $v) {
                                // Get non-GRANT OPTION privs
                                $nongrant = array_diff($v[2], $v[4]);
@@ -1647,12 +1636,10 @@ class Postgres extends ADODB_base {
                $status = $this->beginTransaction();
                if ($status != 0) return -1;
 
-               $schema = $this->schema();
-
                $found = false;
                $first = true;
                $comment_sql = ''; //Accumulate comments for the columns
-               $sql = "CREATE TABLE {$schema}\"{$name}\" (";
+               $sql = "CREATE TABLE \"{$this->_schema}\".\"{$name}\" (";
                for ($i = 0; $i < $fields; $i++) {
                        $this->fieldClean($field[$i]);
                        $this->clean($type[$i]);
@@ -2042,10 +2029,8 @@ class Postgres extends ADODB_base {
                $this->clean($length);
                $this->clean($comment);
 
-               $schema = $this->schema();
-
                if ($length == '')
-                       $sql = "ALTER TABLE {$schema}\"{$table}\" ADD COLUMN \"{$column}\" {$type}";
+                       $sql = "ALTER TABLE \"{$this->_schema}\".\"{$table}\" ADD COLUMN \"{$column}\" {$type}";
                else {
                        switch ($type) {
                                // Have to account for weird placing of length for with/without
@@ -2053,15 +2038,15 @@ class Postgres extends ADODB_base {
                                case 'timestamp with time zone':
                                case 'timestamp without time zone':
                                        $qual = substr($type, 9);
-                                       $sql = "ALTER TABLE {$schema}\"{$table}\" ADD COLUMN \"{$column}\" timestamp({$length}){$qual}";
+                                       $sql = "ALTER TABLE \"{$this->_schema}\".\"{$table}\" ADD COLUMN \"{$column}\" timestamp({$length}){$qual}";
                                        break;
                                case 'time with time zone':
                                case 'time without time zone':
                                        $qual = substr($type, 4);
-                                       $sql = "ALTER TABLE {$schema}\"{$table}\" ADD COLUMN \"{$column}\" time({$length}){$qual}";
+                                       $sql = "ALTER TABLE \"{$this->_schema}\".\"{$table}\" ADD COLUMN \"{$column}\" time({$length}){$qual}";
                                        break;
                                default:
-                                       $sql = "ALTER TABLE {$schema}\"{$table}\" ADD COLUMN \"{$column}\" {$type}({$length})";
+                                       $sql = "ALTER TABLE \"{$this->_schema}\".\"{$table}\" ADD COLUMN \"{$column}\" {$type}({$length})";
                        }
                }
 
@@ -2405,8 +2390,6 @@ class Postgres extends ADODB_base {
                else {
                $this->fieldClean($table);
 
-                       $schema = $this->schema();
-
                        // Build clause
                        if (sizeof($vars) > 0) {
                                $fields = '';
@@ -2419,7 +2402,7 @@ class Postgres extends ADODB_base {
                                        else $tmp = $this->formatValue($types[$key], $format[$key], $value);
 
                                        if ($fields) $fields .= ", \"{$key}\"";
-                                       else $fields = "INSERT INTO {$schema}\"{$table}\" (\"{$key}\"";
+                                       else $fields = "INSERT INTO \"{$this->_schema}\".\"{$table}\" (\"{$key}\"";
 
                                        if ($values) $values .= ", {$tmp}";
                                        else $values = ") VALUES ({$tmp}";
@@ -2449,7 +2432,6 @@ class Postgres extends ADODB_base {
 
                        // Build clause
                        if (sizeof($vars) > 0) {
-                               $schema = $this->schema();
 
                                foreach($vars as $key => $value) {
                                        $this->fieldClean($key);
@@ -2459,7 +2441,7 @@ class Postgres extends ADODB_base {
                                        else $tmp = $this->formatValue($types[$key], $format[$key], $value);
 
                                        if (isset($sql)) $sql .= ", \"{$key}\"={$tmp}";
-                                       else $sql = "UPDATE {$schema}\"{$table}\" SET \"{$key}\"={$tmp}";
+                                       else $sql = "UPDATE \"{$this->_schema}\".\"{$table}\" SET \"{$key}\"={$tmp}";
                                }
                                $first = true;
                                foreach ($keyarr as $k => $v) {
@@ -2644,9 +2626,7 @@ class Postgres extends ADODB_base {
                $this->clean($startvalue);
                $this->clean($cachevalue);
 
-               $schema = $this->schema();
-
-               $sql = "CREATE SEQUENCE {$schema}\"{$sequence}\"";
+               $sql = "CREATE SEQUENCE \"{$this->_schema}\".\"{$sequence}\"";
                if ($increment != '') $sql .= " INCREMENT {$increment}";
                if ($minvalue != '') $sql .= " MINVALUE {$minvalue}";
                if ($maxvalue != '') $sql .= " MAXVALUE {$maxvalue}";
@@ -2929,7 +2909,7 @@ class Postgres extends ADODB_base {
 
                $sql = "CREATE ";
                if ($replace) $sql .= "OR REPLACE ";
-               $sql .= "VIEW ". $this->schema() ."\"{$viewname}\" AS {$definition}";
+               $sql .= "VIEW \"{$this->_schema}\".\"{$viewname}\" AS {$definition}";
 
                $status = $this->execute($sql);
                if ($status) {
@@ -3085,7 +3065,7 @@ class Postgres extends ADODB_base {
        function dropView($viewname, $cascade) {
                $this->fieldClean($viewname);
 
-               $sql = "DROP VIEW ". $this->schema() ."\"{$viewname}\"";
+               $sql = "DROP VIEW \"{$this->_schema}\".\"{$viewname}\"";
                if ($cascade) $sql .= " CASCADE";
 
                return $this->execute($sql);
@@ -3131,11 +3111,9 @@ class Postgres extends ADODB_base {
                $this->fieldClean($name);
                $this->fieldClean($table);
 
-               $schema = $this->schema();
-
                $sql = "CREATE";
                if ($unique) $sql .= " UNIQUE";
-               $sql .= " INDEX \"{$name}\" ON {$schema}\"{$table}\" USING {$type} ";
+               $sql .= " INDEX \"{$name}\" ON \"{$this->_schema}\".\"{$table}\" USING {$type} ";
 
                if (is_array($columns)) {
                        $this->arrayClean($columns);
@@ -3334,9 +3312,7 @@ class Postgres extends ADODB_base {
                $this->fieldClean($name);
                $this->fieldClean($tablespace);
 
-               $schema = $this->schema();
-
-               $sql = "ALTER TABLE {$schema}\"{$table}\" ADD ";
+               $sql = "ALTER TABLE \"{$this->_schema}\".\"{$table}\" ADD ";
                if ($name != '') $sql .= "CONSTRAINT \"{$name}\" ";
                $sql .= "PRIMARY KEY (\"" . join('","', $fields) . "\")";
 
@@ -3362,9 +3338,7 @@ class Postgres extends ADODB_base {
                $this->fieldClean($name);
                $this->fieldClean($tablespace);
 
-               $schema = $this->schema();
-
-               $sql = "ALTER TABLE {$schema}\"{$table}\" ADD ";
+               $sql = "ALTER TABLE \"{$this->_schema}\".\"{$table}\" ADD ";
                if ($name != '') $sql .= "CONSTRAINT \"{$name}\" ";
                $sql .= "UNIQUE (\"" . join('","', $fields) . "\")";
 
@@ -3471,17 +3445,11 @@ class Postgres extends ADODB_base {
                $this->fieldArrayClean($tfields);
                $this->fieldClean($name);
 
-               $schema = $this->schema();
-
-               $sql = "ALTER TABLE {$schema}\"{$table}\" ADD ";
+               $sql = "ALTER TABLE \"{$this->_schema}\".\"{$table}\" ADD ";
                if ($name != '') $sql .= "CONSTRAINT \"{$name}\" ";
                $sql .= "FOREIGN KEY (\"" . join('","', $sfields) . "\") ";
-               $sql .= "REFERENCES ";
                // Target table needs to be fully qualified
-               if ($this->hasSchemas()) {
-                       $sql .= "\"{$targschema}\".";
-               }
-               $sql .= "\"{$targtable}\"(\"" . join('","', $tfields) . "\") ";
+               $sql .= "REFERENCES \"{$targschema}\".\"{$targtable}\"(\"" . join('","', $tfields) . "\") ";
                if ($match != $this->fkmatches[0]) $sql .= " {$match}";
                if ($upd_action != $this->fkactions[0]) $sql .= " ON UPDATE {$upd_action}";
                if ($del_action != $this->fkactions[0]) $sql .= " ON DELETE {$del_action}";
@@ -4208,10 +4176,8 @@ class Postgres extends ADODB_base {
                $this->fieldClean($typin);
                $this->fieldClean($typout);
 
-               $schema = $this->schema();
-
                $sql = "
-                       CREATE TYPE {$schema}\"{$typname}\" (
+                       CREATE TYPE \"{$this->_schema}\".\"{$typname}\" (
                                INPUT = \"{$typin}\",
                                OUTPUT = \"{$typout}\",
                                INTERNALLENGTH = {$typlen}";
@@ -4513,11 +4479,9 @@ class Postgres extends ADODB_base {
                $this->fieldClean($table);
                if (!in_array($event, $this->rule_events)) return -1;
 
-               $schema = $this->schema();
-
                $sql = "CREATE";
                if ($replace) $sql .= " OR REPLACE";
-               $sql .= " RULE \"{$name}\" AS ON {$event} TO {$schema}\"{$table}\"";
+               $sql .= " RULE \"{$name}\" AS ON {$event} TO \"{$this->_schema}\".\"{$table}\"";
                // Can't escape WHERE clause
                if ($where != '') $sql .= " WHERE {$where}";
                $sql .= " DO";
@@ -4648,10 +4612,7 @@ class Postgres extends ADODB_base {
                }
 
                // Table name
-               $tgdef .= " ON ";
-               if($this->hasSchemas())
-                       $tgdef .= "\"{$this->_schema}\".";
-               $tgdef .= "\"{$trigger['relname']}\" ";
+               $tgdef .= " ON \"{$this->_schema}\".\"{$trigger['relname']}\" ";
 
                // Deferrability
                if ($trigger['tgisconstraint']) {
@@ -4859,9 +4820,7 @@ class Postgres extends ADODB_base {
                $opr = $this->getOperator($operator_oid);
                $this->fieldClean($opr->fields['oprname']);
 
-               $schema = $this->schema();
-
-               $sql = "DROP OPERATOR {$schema}{$opr->fields['oprname']} (";
+               $sql = "DROP OPERATOR \"{$this->_schema}\".{$opr->fields['oprname']} (";
                // Quoting or formatting here???
                if ($opr->fields['oprleftname'] !== null) $sql .= $opr->fields['oprleftname'] . ', ';
                else $sql .= "NONE, ";
@@ -5396,8 +5355,7 @@ class Postgres extends ADODB_base {
 
                $this->beginTransaction();
 
-               $schema = $this->schema();
-               $sql = "CREATE AGGREGATE {$schema}\"{$name}\" (BASETYPE = \"{$basetype}\", SFUNC = \"{$sfunc}\", STYPE = \"{$stype}\"";
+               $sql = "CREATE AGGREGATE \"{$this->_schema}\".\"{$name}\" (BASETYPE = \"{$basetype}\", SFUNC = \"{$sfunc}\", STYPE = \"{$stype}\"";
                if(trim($ffunc) != '') $sql .= ", FINALFUNC = \"{$ffunc}\"";
                if(trim($initcond) != '') $sql .= ", INITCOND = \"{$initcond}\"";
                if(trim($sortop) != '') $sql .= ", SORTOP = \"{$sortop}\"";
@@ -6380,7 +6338,6 @@ class Postgres extends ADODB_base {
                        (!$public && sizeof($usernames) == 0 && sizeof($groupnames) == 0)) return -4;
                if ($mode != 'GRANT' && $mode != 'REVOKE') return -5;
 
-               $schema = $this->schema();
                $sql = $mode;
 
                // Grant option
@@ -6397,7 +6354,7 @@ class Postgres extends ADODB_base {
                        case 'view':
                        case 'sequence':
                                $this->fieldClean($object);
-                               $sql .= " {$schema}\"{$object}\"";
+                               $sql .= " \"{$this->_schema}\".\"{$object}\"";
                                break;
                        case 'database':
                                $this->fieldClean($object);
@@ -6407,7 +6364,7 @@ class Postgres extends ADODB_base {
                                // Function comes in with $object as function OID
                                $fn = $this->getFunction($object);
                                $this->fieldClean($fn->fields['proname']);
-                               $sql .= " FUNCTION {$schema}\"{$fn->fields['proname']}\"({$fn->fields['proarguments']})";
+                               $sql .= " FUNCTION \"{$this->_schema}\".\"{$fn->fields['proname']}\"({$fn->fields['proarguments']})";
                                break;
                        case 'language':
                                $this->fieldClean($object);
@@ -6746,19 +6703,17 @@ class Postgres extends ADODB_base {
        function setComment($obj_type, $obj_name, $table, $comment, $basetype = NULL) {
                $sql = "COMMENT ON {$obj_type} " ;
 
-               $schema = $this->schema();
-
                switch ($obj_type) {
                        case 'TABLE':
-                               $sql .= "{$schema}\"{$table}\" IS ";
+                               $sql .= "\"{$this->_schema}\".\"{$table}\" IS ";
                                break;
                        case 'COLUMN':
-                               $sql .= "{$schema}\"{$table}\".\"{$obj_name}\" IS ";
+                               $sql .= "\"{$this->_schema}\".\"{$table}\".\"{$obj_name}\" IS ";
                                break;
                        case 'SEQUENCE':
                        case 'VIEW':
                        case 'TYPE':
-                               $sql .= "{$schema}";
+                               $sql .= "\"{$this->_schema}\".";
                        case 'DATABASE':
                        case 'ROLE':
                        case 'SCHEMA':
@@ -6770,10 +6725,10 @@ class Postgres extends ADODB_base {
                                $sql .= "\"{$obj_name}\" IS ";
                                break;
                        case 'FUNCTION':
-                               $sql .= "{$schema}{$obj_name} IS ";
+                               $sql .= "\"{$this->_schema}\".{$obj_name} IS ";
                                break;
                        case 'AGGREGATE':
-                               $sql .= "{$schema}\"{$obj_name}\" (\"{$basetype}\") IS ";
+                               $sql .= "\"{$this->_schema}\".\"{$obj_name}\" (\"{$basetype}\") IS ";
                                break;
                        default:
                                // Unknown object type
@@ -7108,7 +7063,7 @@ class Postgres extends ADODB_base {
                        $sql .= join('","', $show) . "\" FROM ";
                }
 
-               if ($this->hasSchemas() && isset($_REQUEST['schema'])) {
+               if (isset($_REQUEST['schema'])) {
                        $this->fieldClean($_REQUEST['schema']);
                        $sql .= "\"{$_REQUEST['schema']}\".";
                }
@@ -7288,7 +7243,7 @@ class Postgres extends ADODB_base {
         */
        function browseQueryCount($query, $count) {
                return $this->selectField($count, 'total');
-                       }
+    }
 
        /**
         * Returns a recordset of all columns in a table
@@ -7299,9 +7254,7 @@ class Postgres extends ADODB_base {
        function browseRow($table, $key) {
                $this->fieldClean($table);
 
-               $schema = $this->schema();
-
-               $sql = "SELECT * FROM {$schema}\"{$table}\"";
+               $sql = "SELECT * FROM \"{$this->_schema}\".\"{$table}\"";
                if (is_array($key) && sizeof($key) > 0) {
                        $sql .= " WHERE true";
                        foreach ($key as $k => $v) {
@@ -7359,12 +7312,11 @@ class Postgres extends ADODB_base {
        function getStatsTableTuples($table) {
                $this->clean($table);
 
-               $sql = 'SELECT * FROM pg_stat_all_tables WHERE';
-               if ($this->hasSchemas()) $sql .= " schemaname='{$this->_schema}' AND";
-               $sql .= " relname='{$table}'";
+               $sql = "SELECT * FROM pg_stat_all_tables 
+                       WHERE schemaname=\'{$this->_schema}\' AND relname='{$table}'";
 
                return $this->selectSet($sql);
-                               }
+       }
 
        /**
         * Fetches I/0 statistics for a table
@@ -7374,12 +7326,11 @@ class Postgres extends ADODB_base {
        function getStatsTableIO($table) {
                $this->clean($table);
 
-               $sql = 'SELECT * FROM pg_statio_all_tables WHERE';
-               if ($this->hasSchemas()) $sql .= " schemaname='{$this->_schema}' AND";
-               $sql .= " relname='{$table}'";
+               $sql = "SELECT * FROM pg_statio_all_tables 
+                       WHERE schemaname='{$this->_schema}' AND relname='{$table}'";
 
                return $this->selectSet($sql);
-                       }
+       }
 
        /**
         * Fetches tuple statistics for all indexes on a table
@@ -7389,12 +7340,11 @@ class Postgres extends ADODB_base {
        function getStatsIndexTuples($table) {
                $this->clean($table);
 
-               $sql = 'SELECT * FROM pg_stat_all_indexes WHERE';
-               if ($this->hasSchemas()) $sql .= " schemaname='{$this->_schema}' AND";
-               $sql .= " relname='{$table}' ORDER BY indexrelname";
+               $sql = "SELECT * FROM pg_stat_all_indexes 
+                       WHERE schemaname='{$this->_schema}' AND relname='{$table}' ORDER BY indexrelname";
 
                return $this->selectSet($sql);
-       }
+    }
 
        /**
         * Fetches I/0 statistics for all indexes on a table
@@ -7404,9 +7354,9 @@ class Postgres extends ADODB_base {
        function getStatsIndexIO($table) {
                $this->clean($table);
 
-               $sql = 'SELECT * FROM pg_statio_all_indexes WHERE';
-               if ($this->hasSchemas()) $sql .= " schemaname='{$this->_schema}' AND";
-               $sql .= " relname='{$table}' ORDER BY indexrelname";
+               $sql = "SELECT * FROM pg_statio_all_indexes 
+                       WHERE schemaname='{$this->_schema}' AND relname='{$table}' 
+                       ORDER BY indexrelname";
 
                return $this->selectSet($sql);
        }
@@ -7460,7 +7410,6 @@ class Postgres extends ADODB_base {
        function hasReadOnlyQueries() { return true; }
        function hasRecluster() { return true; }
        function hasRoles() { return true; }
-       function hasSchemas() { return true; }
        function hasSequenceAlterSchema() { return true; }
        function hasServerAdminFuncs() { return true; }
        function hasSharedComments() { return true; }
index 94061fa817edca253e1a4bde96d9c19befe27f69..e73f9dbe64b0a135d413c022226bdd061d81128a 100755 (executable)
@@ -38,9 +38,6 @@ class Slony extends Plugin {
                
                global $data;
                
-               // Slony needs schemas
-               if (!$data->hasSchemas()) return false;
-               
                // Check for the slonyversion() function and find the schema
                // it's in.  We put an order by and limit 1 in here to guarantee
                // only finding the first one, even if there are somehow two
index d7f2a656ad8c7a1e6863c162829424397a9db56f..0ab126e952a1721ce2f3e902378951c40922dda2 100644 (file)
                        if ($isTable) {
                                $return_url = urlencode("colproperties.php?{$misc->href}&amp;table=$tableName&amp;column={$_REQUEST['column']}");
 
-                               $schema = $data->schema();
-                               
                                /* Browse link */
                                echo "\t<li><a href=\"display.php?{$misc->href}&amp;subject=column&amp;table=", urlencode($_REQUEST['table']), "&amp;column=",
                                        urlencode($_REQUEST['column']), "&amp;return_url={$return_url}&amp;return_desc=", urlencode($lang['strback']), "&amp;query=", 
-                                       urlencode("SELECT \"{$_REQUEST['column']}\", count(*) AS \"count\" FROM {$schema}\"$tableName\" GROUP BY \"{$_REQUEST['column']}\" ORDER BY \"{$_REQUEST['column']}\"") , "\">{$lang['strbrowse']}</a></li>\n";
+                                       urlencode("SELECT \"{$_REQUEST['column']}\", count(*) AS \"count\" FROM \"{$data->_schema}\".\"$tableName\" GROUP BY \"{$_REQUEST['column']}\" ORDER BY \"{$_REQUEST['column']}\"") , "\">{$lang['strbrowse']}</a></li>\n";
 
                                /* Edit link */
                                echo "\t<li><a href=\"colproperties.php?action=properties&amp;{$misc->href}&amp;table=", urlencode($_REQUEST['table']),
index eb925951ef7f71b817b5b4452c01f3b01a9d8efd..ce052aafeede1b198d931740a5e7eb199393512f 100644 (file)
 
                                        // Unserialize target and fetch appropriate table. This is a bit messy
                                        // because the table could be in another schema.
-                                       if ($data->hasSchemas())
-                                               $data->setSchema($_REQUEST['target']['schemaname']);
+                                       $data->setSchema($_REQUEST['target']['schemaname']);
                                        $attrs = $data->getTableAttributes($_REQUEST['target']['tablename']);
-                                       if ($data->hasSchemas())
-                                               $data->setSchema($_REQUEST['schema']);
+                                       $data->setSchema($_REQUEST['schema']);
 
                                        $selColumns = new XHTML_select('TableColumnList', true, 10);
                                        $selColumns->set_style('width: 15em;');
                                        $key = array('schemaname' => $tables->fields['nspname'], 'tablename' => $tables->fields['relname']);
                                        $key = serialize($key);
                                        echo "<option value=\"", htmlspecialchars($key), "\">";
-                                       if ($data->hasSchemas() && $tables->fields['nspname'] != $_REQUEST['schema']) {
+                                       if ($tables->fields['nspname'] != $_REQUEST['schema']) {
                                                        echo htmlspecialchars($tables->fields['nspname']), '.';
                                        }
                                        echo htmlspecialchars($tables->fields['relname']), "</option>\n";
index 7ee241c9b2d3a59c7ca6c034896a0763faa4a933..dfccf2cd506e5992c06d19ac688987b317c57690 100755 (executable)
@@ -49,8 +49,7 @@
                // Output list of filters.  This is complex due to all the 'has' and 'conf' feature possibilities
                echo "<select name=\"filter\">\n";
                echo "\t<option value=\"\"", ($_REQUEST['filter'] == '') ? ' selected="selected"' : '', ">{$lang['strallobjects']}</option>\n";
-               if ($data->hasSchemas())
-                       echo "\t<option value=\"SCHEMA\"", ($_REQUEST['filter'] == 'SCHEMA') ? ' selected="selected"' : '', ">{$lang['strschemas']}</option>\n";
+               echo "\t<option value=\"SCHEMA\"", ($_REQUEST['filter'] == 'SCHEMA') ? ' selected="selected"' : '', ">{$lang['strschemas']}</option>\n";
                echo "\t<option value=\"TABLE\"", ($_REQUEST['filter'] == 'TABLE') ? ' selected="selected"' : '', ">{$lang['strtables']}</option>\n";
                echo "\t<option value=\"VIEW\"", ($_REQUEST['filter'] == 'VIEW') ? ' selected="selected"' : '', ">{$lang['strviews']}</option>\n";
                echo "\t<option value=\"SEQUENCE\"", ($_REQUEST['filter'] == 'SEQUENCE') ? ' selected="selected"' : '', ">{$lang['strsequences']}</option>\n";
                                                }
                                        }
                                        
-                                       // Generate schema prefix
-                                       if ($data->hasSchemas())
-                                               $prefix = $rs->fields['schemaname'];
-                                       else
-                                               $prefix = '';
-                                               
                                        switch ($curr) {
                                                case 'SCHEMA':                                          
                                                        echo "<li><a href=\"redirect.php?subject=schema&amp;{$misc->href}&amp;schema=", $misc->printVal($rs->fields['name']), "\">", _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                                                case 'TABLE':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"tables.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($prefix), "\">", $misc->printVal($prefix), "</a>.";
+                                                       echo "<a href=\"tables.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "</a>.";
                                                        echo "<a href=\"redirect.php?subject=table&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "&amp;table=", 
                                                                urlencode($rs->fields['name']), "\">", _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                                                case 'VIEW':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"views.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($prefix), "\">", $misc->printVal($prefix), "</a>.";
+                                                       echo "<a href=\"views.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "</a>.";
                                                        echo "<a href=\"redirect.php?subject=view&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "&amp;view=", 
                                                                urlencode($rs->fields['name']), "\">", _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                                                case 'SEQUENCE':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"sequences.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($prefix), "\">", $misc->printVal($prefix), "</a>.";
+                                                       echo "<a href=\"sequences.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "</a>.";
                                                        echo "<a href=\"sequences.php?subject=sequence&amp;action=properties&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), 
                                                                "&amp;sequence=", urlencode($rs->fields['name']), "\">", _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                                                case 'COLUMNTABLE':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"redirect.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($prefix), "\">", $misc->printVal($prefix), "</a>.";
+                                                       echo "<a href=\"redirect.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "</a>.";
                                                        echo "<a href=\"tblproperties.php?subject=table&amp;{$misc->href}&amp;table=", urlencode($rs->fields['relname']), "&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['relname']), "</a>.";
                                                        echo "<a href=\"colproperties.php?{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "&amp;table=", 
                                                                urlencode($rs->fields['relname']), "&amp;column=", urlencode($rs->fields['name']), "\">", 
                                                        break;
                                                case 'COLUMNVIEW':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"redirect.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($prefix), "\">", $misc->printVal($prefix), "</a>.";
-                                                        echo "<a href=\"viewproperties.php?subject=view&amp;{$misc->href}&amp;view=", urlencode($rs->fields['relname']), "&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['relname']), "</a>.";
+                                                       echo "<a href=\"redirect.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "</a>.";
+                                                       echo "<a href=\"viewproperties.php?subject=view&amp;{$misc->href}&amp;view=", urlencode($rs->fields['relname']), "&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['relname']), "</a>.";
                                                        echo "<a href=\"colproperties.php?{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "&amp;view=", 
                                                                urlencode($rs->fields['relname']), "&amp;column=", urlencode($rs->fields['name']), "\">", 
                                                                _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                                                case 'INDEX':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"redirect.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($prefix), "\">", $misc->printVal($prefix), "}</a>.";
+                                                       echo "<a href=\"redirect.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "}</a>.";
                                                        echo "<a href=\"redirect.php?subject=table&amp;{$misc->href}&amp;table=", urlencode($rs->fields['relname']), "&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['relname']), "</a>.";
                                                        echo "<a href=\"indexes.php?{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "&amp;table=", urlencode($rs->fields['relname']), "\">", _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                                                case 'CONSTRAINTTABLE':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"redirect.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($prefix), "\">", $misc->printVal($prefix), "</a>.";
+                                                       echo "<a href=\"redirect.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "</a>.";
                                                        echo "<a href=\"redirect.php?subject=table&amp;{$misc->href}&amp;table=", urlencode($rs->fields['relname']), "&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['relname']), "</a>.";
                                                        echo "<a href=\"constraints.php?{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "&amp;table=", 
                                                                urlencode($rs->fields['relname']), "\">", _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                                                case 'CONSTRAINTDOMAIN':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"domains.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($prefix), "</a>.";
+                                                       echo "<a href=\"domains.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "</a>.";
                                                        echo "<a href=\"domains.php?action=properties&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "&amp;domain=", urlencode($rs->fields['relname']), "\">", 
                                                                $misc->printVal($rs->fields['relname']), '.', _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                                                case 'TRIGGER':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"redirect.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($prefix), "</a>.";
+                                                       echo "<a href=\"redirect.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "</a>.";
                                                        echo "<a href=\"redirect.php?subject=table&amp;{$misc->href}&amp;table=", urlencode($rs->fields['relname']), "&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['relname']), "</a>.";
                                                        echo "<a href=\"triggers.php?{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "&amp;table=", urlencode($rs->fields['relname']), "\">", 
                                                                _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                                                case 'RULETABLE':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"redirect.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($prefix), "</a>.";
+                                                       echo "<a href=\"redirect.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "</a>.";
                                                        echo "<a href=\"redirect.php?subject=table&amp;{$misc->href}&amp;table=", urlencode($rs->fields['relname']), "&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['relname']), "</a>.";
                                                        echo "<a href=\"rules.php?subject=table&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "&amp;reltype=table&amp;table=", 
                                                                urlencode($rs->fields['relname']), "\">", _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                                                case 'RULEVIEW':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"redirect.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($prefix), "</a>.";
+                                                       echo "<a href=\"redirect.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "</a>.";
                                                        echo "<a href=\"redirect.php?subject=view&amp;{$misc->href}&amp;view=", urlencode($rs->fields['relname']), "&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['relname']), "</a>.";
                                                        echo "<a href=\"rules.php?subject=view&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "&amp;reltype=view&amp;view=", 
                                                                urlencode($rs->fields['relname']), "\">", _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                                                case 'FUNCTION':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"functions.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($prefix), "\">", $misc->printVal($prefix), "</a>.";
+                                                       echo "<a href=\"functions.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "</a>.";
                                                        echo "<a href=\"functions.php?action=properties&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "&amp;function=", 
                                                                urlencode($rs->fields['name']), "&amp;function_oid=", urlencode($rs->fields['oid']), "\">", 
                                                                _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                                                case 'TYPE':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"types.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($prefix), "\">", $misc->printVal($prefix), "</a>.";
+                                                       echo "<a href=\"types.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "</a>.";
                                                        echo "<a href=\"types.php?action=properties&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "&amp;type=", 
                                                                urlencode($rs->fields['name']), "\">", _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                                                case 'DOMAIN':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"domains.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($prefix), "\">", $misc->printVal($prefix), "</a>.";
+                                                       echo "<a href=\"domains.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "</a>.";
                                                        echo "<a href=\"domains.php?action=properties&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "&amp;domain=", 
                                                                urlencode($rs->fields['name']), "\">", _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                                                case 'OPERATOR':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"operators.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($prefix), "\">", $misc->printVal($prefix), "</a>.";
+                                                       echo "<a href=\"operators.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "</a>.";
                                                        echo "<a href=\"operators.php?action=properties&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "&amp;operator=", 
                                                                urlencode($rs->fields['name']), "&amp;operator_oid=", urlencode($rs->fields['oid']) ,"\">", _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                                                case 'CONVERSION':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"conversions.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($prefix), "\">", $misc->printVal($prefix), "</a>.";
+                                                       echo "<a href=\"conversions.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "</a>.";
                                                        echo "<a href=\"conversions.php?{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), 
                                                                "\">", _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                                                        break;
                                                case 'AGGREGATE':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"aggregates.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($prefix), "\">", $misc->printVal($prefix), "</a>.";
+                                                       echo "<a href=\"aggregates.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "</a>.";
                                                        echo "<a href=\"aggregates.php?{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">",
                                                                _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                                                case 'OPCLASS':
                                                        echo "<li>";
-                                                       if (!empty($prefix))
-                                                               echo "<a href=\"redirect.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($prefix), "\">", $misc->printVal($prefix), "</a>.";
+                                                       echo "<a href=\"redirect.php?subject=schema&amp;{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">", $misc->printVal($rs->fields['schemaname']), "</a>.";
                                                        echo "<a href=\"opclasses.php?{$misc->href}&amp;schema=", urlencode($rs->fields['schemaname']), "\">",
                                                                _highlight($misc->printVal($rs->fields['name']), $_REQUEST['term']), "</a></li>\n";
                                                        break;
                $reqvars = $misc->getRequestVars('database');
 
                $tabs = $misc->getNavTabs('database');
-               if (!$data->hasSchemas()) {
-                       $tabs = array_merge($misc->getNavTabs('schema'), $tabs);
-               }
 
                $items = $misc->adjustTabsForTree($tabs);
                
index acfd082f9fc1baa9ed571ee7cbe5b9756c851887..ca6f7d32957e9a092f77124d59b7e4eb4f795025 100644 (file)
@@ -92,7 +92,7 @@
                if (isset($_REQUEST['query'])) $_REQUEST['query'] = trim(urldecode($_REQUEST['query']));
 
                // Set the schema search path
-               if ($data->hasSchemas() && isset($_REQUEST['search_path'])) {
+               if (isset($_REQUEST['search_path'])) {
                        $data->setSearchPath(array_map('trim',explode(',',$_REQUEST['search_path'])));
                }
                
index f429404da2313ff4ffbf04e129766fa49738c52a..2c922607bb6f24aedb9b68cb72fe8c5224ddfde6 100644 (file)
                        // If we are 7.4 or higher, assume they are using 7.4 pg_dump and
                        // set dump schema as well.  Also, mixed case dumping has been fixed
                        // then..
-                               $cmd .= " -t " . $misc->escapeShellArg($_REQUEST[$_REQUEST['subject']]);
-                               // Even though they're using a schema-enabled pg_dump, the backend database
-                               // may not support schemas.
-                               if ($data->hasSchemas()) {
-                                       $cmd .= " -n " . $misc->escapeShellArg($_REQUEST['schema']);
-                               }
+                               $cmd .= " -t " . $misc->escapeShellArg($_REQUEST[$_REQUEST['subject']])
+                                       . " -n " . $misc->escapeShellArg($_REQUEST['schema']);
                        }
                        else {
                                // This is an annoying hack needed to work around a bug in dumping
index 31887ffb3addb418cbefe1616251f6fb759036d3..60971b7efe9bbd27876a83434d1b34132b517ba7 100644 (file)
                        $key = array();
                
                // Set the schema search path
-               if ($data->hasSchemas() && isset($_REQUEST['search_path'])) {
+               if (isset($_REQUEST['search_path'])) {
                        if ($data->setSearchPath(array_map('trim',explode(',',$_REQUEST['search_path']))) != 0) {
                                return;
                        }
index cc992b43921c43356752039da4eb139c9a7d855c..98ae6d5a9166b2946caee82c625877c766ab3c00 100644 (file)
--- a/info.php
+++ b/info.php
@@ -50,9 +50,7 @@
                                echo "<h3>{$lang['strreferringtables']}</h3>\n";
                                echo "<table>\n";
                                echo "\t<tr>\n\t\t";
-                               if ($data->hasSchemas()) {
-                                       echo "<th class=\"data\">{$lang['strschema']}</th>";
-                               }
+                               echo "<th class=\"data\">{$lang['strschema']}</th>";
                                echo "<th class=\"data\">{$lang['strtable']}</th>";
                                echo "<th class=\"data\">{$lang['strname']}</th><th class=\"data\">{$lang['strdefinition']}</th>";
                                echo "<th class=\"data\">{$lang['stractions']}</th>\n";
@@ -62,9 +60,7 @@
                                while (!$referrers->EOF) {
                                        $id = ( ($i % 2 ) == 0 ? '1' : '2' );
                                        echo "\t<tr>\n\t\t";
-                                       if ($data->hasSchemas()) {
-                                               echo "<td class=\"data{$id}\">", $misc->printVal($referrers->fields['nspname']), "</td>";
-                                       }
+                                       echo "<td class=\"data{$id}\">", $misc->printVal($referrers->fields['nspname']), "</td>";
                                        echo "<td class=\"data{$id}\">", $misc->printVal($referrers->fields['relname']), "</td>";
                                        echo "<td class=\"data{$id}\">", $misc->printVal($referrers->fields['conname']), "</td>";
                                        echo "<td class=\"data{$id}\">", $misc->printVal($referrers->fields['consrc']), "</td>";
@@ -84,9 +80,7 @@
                                echo "<h3>{$lang['strparenttables']}</h3>\n";
                                echo "<table>\n";
                                echo "\t<tr>\n\t\t";
-                               if ($data->hasSchemas()) {                      
-                                       echo "<th class=\"data\">{$lang['strschema']}</th>";
-                               }
+                               echo "<th class=\"data\">{$lang['strschema']}</th>";
                                echo "\t\t<th class=\"data\">{$lang['strtable']}</th>";                 
                                echo "<th class=\"data\">{$lang['stractions']}</th>\n";
                                echo "\t</tr>\n";
@@ -95,9 +89,7 @@
                                while (!$parents->EOF) {
                                        $id = ( ($i % 2 ) == 0 ? '1' : '2' );
                                        echo "\t<tr>\n";
-                                       if ($data->hasSchemas()) {
-                                               echo "\t\t<td class=\"data{$id}\">", $misc->printVal($parents->fields['nspname']), "</td>";
-                                       }
+                                       echo "\t\t<td class=\"data{$id}\">", $misc->printVal($parents->fields['nspname']), "</td>";
                                        echo "<td class=\"data{$id}\">", $misc->printVal($parents->fields['relname']), "</td>";
                                        echo "<td class=\"opbutton{$id}\"><a href=\"tblproperties.php?{$misc->href}",
                                                "&amp;schema=", urlencode($parents->fields['nspname']),
                                echo "<h3>{$lang['strchildtables']}</h3>\n";
                                echo "<table>\n";
                                echo "\t<tr>\n";
-                               if ($data->hasSchemas()) {                      
-                                       echo "<th class=\"data\">{$lang['strschema']}</th>";
-                               }
+                               echo "<th class=\"data\">{$lang['strschema']}</th>";
                                echo "\t\t<th class=\"data\">{$lang['strtable']}</th>";                 
                                echo "<th class=\"data\">{$lang['stractions']}</th>\n";
                                echo "\t</tr>\n";
                                while (!$children->EOF) {
                                        $id = ( ($i % 2 ) == 0 ? '1' : '2' );
                                        echo "\t<tr>\n";
-                                       if ($data->hasSchemas()) {
-                                               echo "\t\t<td class=\"data{$id}\">", $misc->printVal($children->fields['schemaname']), "</td>";
-                                       }
+                                       echo "\t\t<td class=\"data{$id}\">", $misc->printVal($children->fields['schemaname']), "</td>";
                                        echo "<td class=\"data{$id}\">", $misc->printVal($children->fields['relname']), "</td>";
                                        echo "<td class=\"opbutton{$id}\"><a href=\"tblproperties.php?{$misc->href}",
                                                "&amp;schema=", urlencode($children->fields['schemaname']),
index 4e1345b85c056910ebc8c454d0ccece416e0f9de..d425dc15041036c1748823a8bf611026c7654665 100644 (file)
 
                // If schema is defined and database supports schemas, then set the
                // schema explicitly.
-               if (isset($_REQUEST['database']) && isset($_REQUEST['schema']) && $data->hasSchemas()) {
+               if (isset($_REQUEST['database']) && isset($_REQUEST['schema'])) {
                        $status = $data->setSchema($_REQUEST['schema']);
                        if ($status != 0) {
                                echo $lang['strbadschema'];
index ff3914f6afb33526a31e72ccf3edc993351a332f..9a22f52a982c82a7e03dd10601c80155ec5cbefa 100755 (executable)
                $misc->printMsg($msg);
 
                // Check that the DB actually supports schemas
-               if ($data->hasSchemas()) {
-                       $schemas = $data->getSchemas();
-
-                       $columns = array(
-                               'schema' => array(
-                                       'title' => $lang['strschema'],
-                                       'field' => field('nspname'),
-                                       'url'   => "redirect.php?subject=schema&amp;{$misc->href}&amp;",
-                                       'vars'  => array('schema' => 'nspname'),
-                               ),
-                               'owner' => array(
-                                       'title' => $lang['strowner'],
-                                       'field' => field('nspowner'),
-                               ),
-                               'actions' => array(
-                                       'title' => $lang['stractions'],
-                               ),
-                               'comment' => array(
-                                       'title' => $lang['strcomment'],
-                                       'field' => field('nspcomment'),
-                               ),
-                       );
-
-                       $actions = array(
-                               'multiactions' => array(
-                                       'keycols' => array('nsp' => 'nspname'),
-                                       'url' => 'schemas.php',
-                               ),
-                               'drop' => array(
-                                       'title' => $lang['strdrop'],
-                                       'url'   => "schemas.php?action=drop&amp;{$misc->href}&amp;",
-                                       'vars'  => array('nsp' => 'nspname'),
-                                       'multiaction' => 'drop',
-                               ),
-                               'privileges' => array(
-                                       'title' => $lang['strprivileges'],
-                                       'url'   => "privileges.php?subject=schema&amp;{$misc->href}&amp;",
-                                       'vars'  => array('schema' => 'nspname'),
-                               ),
-                               'alter' => array(
-                                       'title' => $lang['stralter'],
-                                       'url'   => "schemas.php?action=alter&amp;{$misc->href}&amp;",
-                                       'vars'  => array('schema' => 'nspname'),
-                               ),
-                       );
-
-                       if (!$data->hasAlterSchema()) unset($actions['alter']);
-
-                       $misc->printTable($schemas, $columns, $actions, $lang['strnoschemas']);
-
-                       echo "<p><a class=\"navlink\" href=\"schemas.php?action=create&amp;{$misc->href}\">{$lang['strcreateschema']}</a></p>\n";
-               } else {
-                       // If the database does not support schemas...
-                       echo "<p>{$lang['strnoschemas']}</p>\n";
-               }
+               $schemas = $data->getSchemas();
+
+               $columns = array(
+                       'schema' => array(
+                               'title' => $lang['strschema'],
+                               'field' => field('nspname'),
+                               'url'   => "redirect.php?subject=schema&amp;{$misc->href}&amp;",
+                               'vars'  => array('schema' => 'nspname'),
+                       ),
+                       'owner' => array(
+                               'title' => $lang['strowner'],
+                               'field' => field('nspowner'),
+                       ),
+                       'actions' => array(
+                               'title' => $lang['stractions'],
+                       ),
+                       'comment' => array(
+                               'title' => $lang['strcomment'],
+                               'field' => field('nspcomment'),
+                       ),
+               );
+
+               $actions = array(
+                       'multiactions' => array(
+                               'keycols' => array('nsp' => 'nspname'),
+                               'url' => 'schemas.php',
+                       ),
+                       'drop' => array(
+                               'title' => $lang['strdrop'],
+                               'url'   => "schemas.php?action=drop&amp;{$misc->href}&amp;",
+                               'vars'  => array('nsp' => 'nspname'),
+                               'multiaction' => 'drop',
+                       ),
+                       'privileges' => array(
+                               'title' => $lang['strprivileges'],
+                               'url'   => "privileges.php?subject=schema&amp;{$misc->href}&amp;",
+                               'vars'  => array('schema' => 'nspname'),
+                       ),
+                       'alter' => array(
+                               'title' => $lang['stralter'],
+                               'url'   => "schemas.php?action=alter&amp;{$misc->href}&amp;",
+                               'vars'  => array('schema' => 'nspname'),
+                       ),
+               );
+
+               if (!$data->hasAlterSchema()) unset($actions['alter']);
+
+               $misc->printTable($schemas, $columns, $actions, $lang['strnoschemas']);
+
+               echo "<p><a class=\"navlink\" href=\"schemas.php?action=create&amp;{$misc->href}\">{$lang['strcreateschema']}</a></p>\n";
        }
 
        /**
index e46e0593268952b18feee91f7b43121f5bc70441..06b7725c139a8149b697179a8eedc8ac1da20f82 100644 (file)
                        if (!isset($_POST['name'])) $_POST['name'] = $_REQUEST['sequence'];
                        if (!isset($_POST['comment'])) $_POST['comment'] = $sequence->fields['seqcomment'];
                        if (!isset($_POST['owner'])) $_POST['owner'] = $sequence->fields['seqowner'];
-                       if (!isset($_POST['newschema']) && $data->hasSchemas()) $_POST['newschema'] = $sequence->fields['nspname'];
+                       if (!isset($_POST['newschema'])) $_POST['newschema'] = $sequence->fields['nspname'];
 
                        // Handle Checkbox Value
                        $sequence->fields['is_cycled'] = $data->phpBool($sequence->fields['is_cycled']);
diff --git a/sql.php b/sql.php
index 316cc259f0f363d58db9ad8571cb883151a27df7..85a5e00f8c8a5dc80c8b74ab17adcff6e5b69f0d 100644 (file)
--- a/sql.php
+++ b/sql.php
        $misc->printTitle($lang['strqueryresults']);
 
        // Set the schema search path
-       if ($data->hasSchemas() && isset($_REQUEST['search_path'])) {
+       if (isset($_REQUEST['search_path'])) {
                if ($data->setSearchPath(array_map('trim',explode(',',$_REQUEST['search_path']))) != 0) {
                        $misc->printFooter();
                        exit;
index 95e0e0715bc6b5adc9bc313e1df1a627a31e8f29..10abcc1db8181a13c19baf53960c9bd0fb906818 100644 (file)
@@ -28,9 +28,7 @@
                if ($action == 'find') {
                        $onchange .= "'&amp;term=' + encodeURI(term.value) + '&amp;filter=' + encodeURI(filter.value) + '&amp;'\"";
                } else {
-                       $onchange .= "'&amp;query=' + encodeURI(query.value) ";
-                       if ($data->hasSchemas()) $onchange .= "+ '&amp;search_path=' + encodeURI(search_path.value) ";
-                       $onchange .= "+ (paginate.checked ? '&amp;paginate=on' : '')  + '&amp;'\"";
+                       $onchange .= "'&amp;query=' + encodeURI(query.value) + '&amp;search_path=' + encodeURI(search_path.value) + (paginate.checked ? '&amp;paginate=on' : '')  + '&amp;'\"";
                }
                
                $misc->printConnection($onchange);
@@ -61,8 +59,7 @@
                // Output list of filters.  This is complex due to all the 'has' and 'conf' feature possibilities
                echo "<select name=\"filter\">\n";
                echo "\t<option value=\"\"", ($_REQUEST['filter'] == '') ? ' selected="selected"' : '', ">{$lang['strallobjects']}</option>\n";
-               if ($data->hasSchemas())
-                       echo "\t<option value=\"SCHEMA\"", ($_REQUEST['filter'] == 'SCHEMA') ? ' selected="selected"' : '', ">{$lang['strschemas']}</option>\n";
+               echo "\t<option value=\"SCHEMA\"", ($_REQUEST['filter'] == 'SCHEMA') ? ' selected="selected"' : '', ">{$lang['strschemas']}</option>\n";
                echo "\t<option value=\"TABLE\"", ($_REQUEST['filter'] == 'TABLE') ? ' selected="selected"' : '', ">{$lang['strtables']}</option>\n";
                echo "\t<option value=\"VIEW\"", ($_REQUEST['filter'] == 'VIEW') ? ' selected="selected"' : '', ">{$lang['strviews']}</option>\n";
                echo "\t<option value=\"SEQUENCE\"", ($_REQUEST['filter'] == 'SEQUENCE') ? ' selected="selected"' : '', ">{$lang['strsequences']}</option>\n";
                echo "<form action=\"sql.php\" method=\"post\" target=\"detail\">\n";
                _printConnection();
                echo "\n";
-               if ($data->hasSchemas()) {
-                       if (!isset($_REQUEST['search_path']))
-                               $_REQUEST['search_path'] = implode(',',$data->getSearchPath());
-               
-                       echo "<p><label>";
-                       $misc->printHelp($lang['strsearchpath'], 'pg.schema.search_path');
-                       echo ": <input type=\"text\" name=\"search_path\" size=\"50\" value=\"",
-                               htmlspecialchars($_REQUEST['search_path']), "\" /></label></p>\n";
-               }
+               if (!isset($_REQUEST['search_path']))
+                       $_REQUEST['search_path'] = implode(',',$data->getSearchPath());
+               
+               echo "<p><label>";
+               $misc->printHelp($lang['strsearchpath'], 'pg.schema.search_path');
+               echo ": <input type=\"text\" name=\"search_path\" size=\"50\" value=\"",
+                       htmlspecialchars($_REQUEST['search_path']), "\" /></label></p>\n";
                
                echo "<textarea style=\"width: 100%;\" rows=\"10\" cols=\"50\" name=\"query\">",
                        htmlspecialchars($_SESSION['sqlquery']), "</textarea>\n";
index 41674b8986464b48821025e0f2e2473bb5e858cf..d597b63d9598a0b7aa8e96b1d1b5fafc5204db9a 100644 (file)
                                'vars'  => array('trigger' => 'tgname'),
                        ),
                );
-               if(!$data->hasSchemas()) unset($columns['function']['vars']['schema']);
                if($data->hasDisableTriggers()) {
                        if(!$data->phpBool($triggers->fields["tgenabled"])) {
                                $actions['enable'] = array(
index da3bbba08fdee752881b17303d354b875133bcfa..cd73f98efc33d1ec1631e3276304a246ef5b95a0 100644 (file)
--- a/views.php
+++ b/views.php
                        
                        //if we have schemas we need to specify the correct schema for each table we're retrieiving
                        //with getTableAttributes
-                       $curSchema = $data->hasSchemas() ? $data->_schema : NULL;
+                       $curSchema = $data->_schema;
                        for ($i = 0; $i < $tblCount; $i++) {
-                               if ($data->hasSchemas() && $data->_schema != $arrSelTables[$i]['schemaname']) {
+                               if ($data->_schema != $arrSelTables[$i]['schemaname']) {
                                        $data->setSchema($arrSelTables[$i]['schemaname']);
                                }
                                
                                $attrs = $data->getTableAttributes($arrSelTables[$i]['tablename']);
                                while (!$attrs->EOF) {
-                                       if ($data->hasSchemas() ) {
-                                               $arrFields["{$arrSelTables[$i]['schemaname']}.{$arrSelTables[$i]['tablename']}.{$attrs->fields['attname']}"] = serialize(array('schemaname' => $arrSelTables[$i]['schemaname'], 'tablename' => $arrSelTables[$i]['tablename'], 'fieldname' => $attrs->fields['attname']) );
-                                       }
-                                       else {
-                                               $arrFields["{$arrSelTables[$i]['tablename']}.{$attrs->fields['attname']}"] = serialize(array('schemaname' => NULL, 'tablename' => $arrSelTables[$i]['tablename'], 'fieldname' => $attrs->fields['attname']) );
-                                       }
+                                       $arrFields["{$arrSelTables[$i]['schemaname']}.{$arrSelTables[$i]['tablename']}.{$attrs->fields['attname']}"] = serialize(array(
+                                               'schemaname' => $arrSelTables[$i]['schemaname'], 
+                                               'tablename' => $arrSelTables[$i]['tablename'], 
+                                               'fieldname' => $attrs->fields['attname']) 
+                                       );
                                        $attrs->moveNext();
                                }
                                
-                               //reset back to our original schema in case we switched from it
-                               if ($data->hasSchemas() ) {
-                                       $data->setSchema($curSchema);
-                               }
+                               $data->setSchema($curSchema);
                        }
                        asort($arrFields);
                        
                        $arrTmp = array();
                        $arrTmp['schemaname'] = $tables->fields['nspname'];
                        $arrTmp['tablename'] = $tables->fields['relname'];
-                       if ($data->hasSchemas() ) { //if schemas aren't available don't show them in the interface
-                               $arrTables[$tables->fields['nspname'] . '.' . $tables->fields['relname']] = serialize($arrTmp);
-                       }
-                       else {
-                               $arrTables[$tables->fields['relname']] = serialize($arrTmp);
-                       }
+                       $arrTables[$tables->fields['nspname'] . '.' . $tables->fields['relname']] = serialize($arrTmp);
                        $tables->moveNext();
                }               
                echo GUI::printCombo($arrTables, 'formTables[]', false, '', true);                      
                                $arrTmp = unserialize($curField);
                                if (! empty($_POST['dblFldMeth']) ) { // doublon control
                                        if (empty($tmpHsh[$arrTmp['fieldname']])) { // field does not exist
-                                               $selFields .= $data->hasSchemas() ? "\"{$arrTmp['schemaname']}\"." : '';
-                                               $selFields .= "\"{$arrTmp['tablename']}\".\"{$arrTmp['fieldname']}\", ";
+                                               $selFields .= "\"{$arrTmp['schemaname']}\".\"{$arrTmp['tablename']}\".\"{$arrTmp['fieldname']}\", ";
                                                $tmpHsh[$arrTmp['fieldname']] = 1;
                                        } else if ($_POST['dblFldMeth'] == 'rename') { // field exist and must be renamed
                                                $tmpHsh[$arrTmp['fieldname']]++;
-                                               $selFields .= $data->hasSchemas() ? "\"{$arrTmp['schemaname']}\"." : '';
-                                               $selFields .= "\"{$arrTmp['tablename']}\".\"{$arrTmp['fieldname']}\" AS \"{$arrTmp['schemaname']}_{$arrTmp['tablename']}_{$arrTmp['fieldname']}{$tmpHsh[$arrTmp['fieldname']]}\", ";
+                                               $selFields .= "\"{$arrTmp['schemaname']}\".\"{$arrTmp['tablename']}\".\"{$arrTmp['fieldname']}\" AS \"{$arrTmp['schemaname']}_{$arrTmp['tablename']}_{$arrTmp['fieldname']}{$tmpHsh[$arrTmp['fieldname']]}\", ";
                                        }
                                        /* field already exist, just ignore this one */
                                } else { // no doublon control
-                                       $selFields .= $data->hasSchemas() ? "\"{$arrTmp['schemaname']}\"." : '';
-                                       $selFields .= "\"{$arrTmp['tablename']}\".\"{$arrTmp['fieldname']}\", ";
+                                       $selFields .= "\"{$arrTmp['schemaname']}\".\"{$arrTmp['tablename']}\".\"{$arrTmp['fieldname']}\", ";
                                }
                        }
 
                                                        $arrLeftLink = unserialize($curLink['leftlink']);
                                                        $arrRightLink = unserialize($curLink['rightlink']);
                                                        
-                                                       $tbl1 = $data->hasSchemas() ? "\"{$arrLeftLink['schemaname']}\".\"{$arrLeftLink['tablename']}\"" : $arrLeftLink['tablename'];
-                                                       $tbl2 = $data->hasSchemas() ? "\"{$arrRightLink['schemaname']}\".\"{$arrRightLink['tablename']}\"" : $arrRightLink['tablename'];
+                                                       $tbl1 = "\"{$arrLeftLink['schemaname']}\".\"{$arrLeftLink['tablename']}\"";
+                                                       $tbl2 = "\"{$arrRightLink['schemaname']}\".\"{$arrRightLink['tablename']}\"";
                                                        
                                                        if ( (!in_array($curLink, $arrJoined) && in_array($tbl1, $arrUsedTbls)) || !count($arrJoined) ) {
                                                                
                                                                // This can (and should be) more optimized for multi-column foreign keys
                                                                $adj_tbl2 = in_array($tbl2, $arrUsedTbls) ? "$tbl2 AS alias_ppa_" . mktime() : $tbl2;
                                                                
-                                                               if ($data->hasSchemas() ) {
-                                                                       $linkFields .= strlen($linkFields) ? "{$curLink['operator']} $adj_tbl2 ON (\"{$arrLeftLink['schemaname']}\".\"{$arrLeftLink['tablename']}\".\"{$arrLeftLink['fieldname']}\" = \"{$arrRightLink['schemaname']}\".\"{$arrRightLink['tablename']}\".\"{$arrRightLink['fieldname']}\") " : "$tbl1 {$curLink['operator']} $adj_tbl2 ON (\"{$arrLeftLink['schemaname']}\".\"{$arrLeftLink['tablename']}\".\"{$arrLeftLink['fieldname']}\" = \"{$arrRightLink['schemaname']}\".\"{$arrRightLink['tablename']}\".\"{$arrRightLink['fieldname']}\") ";
-                                                               }
-                                                               else {
-                                                                       $linkFields .= strlen($linkFields) ? "{$curLink['operator']} $adj_tbl2 ON (\"{$arrLeftLink['tablename']}\".\"{$arrLeftLink['fieldname']}\" = \"{$arrRightLink['tablename']}\".\"{$arrRightLink['fieldname']}\") " : "$tbl1 {$curLink['operator']} $adj_tbl2 ON (\"{$arrLeftLink['tablename']}\".\"{$arrLeftLink['fieldname']}\" = \"{$arrRightLink['tablename']}\".\"{$arrRightLink['fieldname']}\") ";
-                                                               }
+                                                               $linkFields .= strlen($linkFields) ? "{$curLink['operator']} $adj_tbl2 ON (\"{$arrLeftLink['schemaname']}\".\"{$arrLeftLink['tablename']}\".\"{$arrLeftLink['fieldname']}\" = \"{$arrRightLink['schemaname']}\".\"{$arrRightLink['tablename']}\".\"{$arrRightLink['fieldname']}\") " 
+                                                                       : "$tbl1 {$curLink['operator']} $adj_tbl2 ON (\"{$arrLeftLink['schemaname']}\".\"{$arrLeftLink['tablename']}\".\"{$arrLeftLink['fieldname']}\" = \"{$arrRightLink['schemaname']}\".\"{$arrRightLink['tablename']}\".\"{$arrRightLink['fieldname']}\") ";
                                                                
                                                                $arrJoined[] = $curLink;
                                                                if (!in_array($tbl1, $arrUsedTbls) )  $arrUsedTbls[] = $tbl1;
                        if (!strlen($linkFields) ) {
                                foreach ($_POST['formTables'] AS $curTable) {
                                        $arrTmp = unserialize($curTable);
-                                       if ($data->hasSchemas() ) {
-                                               $linkFields .= strlen($linkFields) ? ", \"{$arrTmp['schemaname']}\".\"{$arrTmp['tablename']}\"" : "\"{$arrTmp['schemaname']}\".\"{$arrTmp['tablename']}\"";
-                                       }
-                                       else {
-                                               $linkFields .= strlen($linkFields) ? ", \"{$arrTmp['tablename']}\"" : "\"{$arrTmp['tablename']}\"";
-                                       }
+                                       $linkFields .= strlen($linkFields) ? ", \"{$arrTmp['schemaname']}\".\"{$arrTmp['tablename']}\"" : "\"{$arrTmp['schemaname']}\".\"{$arrTmp['tablename']}\"";
                                }
                        }
                        
                                foreach ($_POST['formCondition'] AS $curCondition) {
                                        if (strlen($curCondition['field']) && strlen($curCondition['txt']) ) {
                                                $arrTmp = unserialize($curCondition['field']);
-                                               if ($data->hasSchemas() ) {
-                                                       $addConditions .= strlen($addConditions) ? " AND \"{$arrTmp['schemaname']}\".\"{$arrTmp['tablename']}\".\"{$arrTmp['fieldname']}\" {$curCondition['operator']} '{$curCondition['txt']}' " : " \"{$arrTmp['schemaname']}\".\"{$arrTmp['tablename']}\".\"{$arrTmp['fieldname']}\" {$curCondition['operator']} '{$curCondition['txt']}' ";
-                                               }
-                                               else {
-                                                       $addConditions .= strlen($addConditions) ? " AND \"{$arrTmp['tablename']}\".\"{$arrTmp['fieldname']}\" {$curCondition['field']} {$curCondition['operator']} '{$curCondition['txt']}' " : " \"{$arrTmp['tablename']}\".\"{$arrTmp['fieldname']}\" {$curCondition['operator']} '{$curCondition['txt']}' ";
-                                               }
+                                               $addConditions .= strlen($addConditions) ? " AND \"{$arrTmp['schemaname']}\".\"{$arrTmp['tablename']}\".\"{$arrTmp['fieldname']}\" {$curCondition['operator']} '{$curCondition['txt']}' " 
+                                                       : " \"{$arrTmp['schemaname']}\".\"{$arrTmp['tablename']}\".\"{$arrTmp['fieldname']}\" {$curCondition['operator']} '{$curCondition['txt']}' ";
                                        }
                                }
                        }