support 8.0beta5 removal of tablespaces on schemas
authorchriskl <chriskl>
Mon, 29 Nov 2004 01:48:38 +0000 (01:48 +0000)
committerchriskl <chriskl>
Mon, 29 Nov 2004 01:48:38 +0000 (01:48 +0000)
HISTORY
classes/database/Postgres73.php
classes/database/Postgres80.php
database.php

diff --git a/HISTORY b/HISTORY
index e44e77201330e0361021717f2b341f6a2fa3607b..f03193262f239021152cb07d72b620ac72ebba10 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -4,6 +4,9 @@ phpPgAdmin History
 Version 3.5.1
 -------------
 
+Bugs
+* Support 8.0beta5 schema tablespace changes
+
 Translations
 * Romanian from Alin
 
index 61f787fd44d0dd1fb69fcc4f0b37ded587febc3c..99d1c87aefbbbb2179b16d2acdb7d1fa8488e52f 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.140 2004/11/10 01:46:36 chriskl Exp $
+ * $Id: Postgres73.php,v 1.141 2004/11/29 01:48:38 chriskl Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -140,19 +140,16 @@ class Postgres73 extends Postgres72 {
         * Creates a new schema.
         * @param $schemaname The name of the schema to create
         * @param $authorization (optional) The username to create the schema for.
-        * @param $tablespace (optional) The tablespace for the schema, '' indicates default.
         * @param $comment (optional) If omitted, defaults to nothing
         * @return 0 success
         */
-       function createSchema($schemaname, $authorization = '', $tablespace = '', $comment = '') {
+       function createSchema($schemaname, $authorization = '', $comment = '') {
                $this->fieldClean($schemaname);
                $this->fieldClean($authorization);
-               $this->fieldClean($tablespace);
                $this->clean($comment);
 
                $sql = "CREATE SCHEMA \"{$schemaname}\"";
                if ($authorization != '') $sql .= " AUTHORIZATION \"{$authorization}\"";
-               if ($tablespace != '' && $this->hasTablespaces()) $sql .= " TABLESPACE \"{$tablespace}\"";
                
                $status = $this->beginTransaction();
                if ($status != 0) return -1;
index d205eb1e37ea85d31258214035119ef509ea7612..db1f6f10ad9390bec4f9a1df7bacc9eb4ce21e7a 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * PostgreSQL 8.0 support
  *
- * $Id: Postgres80.php,v 1.7 2004/11/10 01:46:36 chriskl Exp $
+ * $Id: Postgres80.php,v 1.8 2004/11/29 01:48:39 chriskl Exp $
  */
 
 include_once('./classes/database/Postgres74.php');
@@ -85,8 +85,7 @@ class Postgres80 extends Postgres74 {
 
                if (!$conf['show_system']) $and = "AND nspname NOT LIKE 'pg\\\\_%' AND nspname != 'information_schema'";
                else $and = "AND nspname !~ '^pg_t(emp_[0-9]+|oast)$'";
-               $sql = "SELECT pn.nspname, pu.usename AS nspowner, pg_catalog.obj_description(pn.oid, 'pg_namespace') AS nspcomment,
-                                                               (SELECT spcname FROM pg_catalog.pg_tablespace pt WHERE pt.oid=pn.nsptablespace) AS tablespace
+               $sql = "SELECT pn.nspname, pu.usename AS nspowner, pg_catalog.obj_description(pn.oid, 'pg_namespace') AS nspcomment
                         FROM pg_catalog.pg_namespace pn, pg_catalog.pg_user pu
                        WHERE pn.nspowner = pu.usesysid
                        {$and} ORDER BY nspname";
index 47baac7d066ef0658de6684698ca3fa273c67588..a3726770f315b1eca6ad6d853f17944b29444308 100755 (executable)
@@ -3,7 +3,7 @@
        /**
         * Manage schemas within a database
         *
-        * $Id: database.php,v 1.64 2004/11/04 02:56:50 chriskl Exp $
+        * $Id: database.php,v 1.65 2004/11/29 01:48:38 chriskl Exp $
         */
 
        // Include application functions
 
                // Fetch all users from the database
                $users = &$data->getUsers();
-               // Fetch all tablespaces from the database
-               if ($data->hasTablespaces()) $tablespaces = &$data->getTablespaces();
 
                $misc->printTrail('database');
                $misc->printTitle($lang['strcreateschema'],'pg.schema.create');
                                ($uname == $_POST['formAuth']) ? ' selected="selected"' : '', ">{$uname}</option>\n";
                        $users->moveNext();
                }
-               echo "\t\t\t</select>\n\t\t</td>\n\t\n";
-               
-               // Tablespace (if there are any)
-               if ($data->hasTablespaces() && $tablespaces->recordCount() > 0) {
-                       echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strtablespace']}</th>\n";
-                       echo "\t\t<td class=\"data1\">\n\t\t\t<select name=\"formSpc\">\n";
-                       // Always offer the default (empty) option
-                       echo "\t\t\t\t<option value=\"\"",
-                               ($_POST['formSpc'] == '') ? ' selected="selected"' : '', "></option>\n";
-                       // Display all other tablespaces
-                       while (!$tablespaces->EOF) {
-                               $spcname = htmlspecialchars($tablespaces->f['spcname']);
-                               echo "\t\t\t\t<option value=\"{$spcname}\"",
-                                       ($spcname == $_POST['formSpc']) ? ' selected="selected"' : '', ">{$spcname}</option>\n";
-                               $tablespaces->moveNext();
-                       }
-                       echo "\t\t\t</select>\n\t\t</td>\n\t</tr>\n";
-               }
-               
+               echo "\t\t\t</select>\n\t\t</td>\n\t\n";                
                echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strcomment']}</th>\n";
                echo "\t\t<td class=\"data1\"><textarea name=\"formComment\" rows=\"3\" cols=\"32\" wrap=\"virtual\">", 
                        htmlspecialchars($_POST['formComment']), "</textarea></td>\n\t</tr>\n";
        function doSaveCreate() {
                global $data, $lang, $_reload_browser;
 
-               // Default tablespace to null if it isn't set
-               if (!isset($_POST['formSpc'])) $_POST['formSpc'] = null;
-
                // Check that they've given a name
                if ($_POST['formName'] == '') doCreate($lang['strschemaneedsname']);
                else {
-                       $status = $data->createSchema($_POST['formName'], $_POST['formAuth'], $_POST['formSpc'], $_POST['formComment']);
+                       $status = $data->createSchema($_POST['formName'], $_POST['formAuth'], $_POST['formComment']);
                        if ($status == 0) {
                                $_reload_browser = true;
                                doDefault($lang['strschemacreated']);
                                        'title' => $lang['strowner'],
                                        'field' => 'nspowner',
                                ),
-                               'tablespace' => array(
-                                       'title' => $lang['strtablespace'],
-                                       'field' => 'tablespace',
-                               ),
                                'actions' => array(
                                        'title' => $lang['stractions'],
                                ),
                                ),
                        );
                        
-                       if (!$data->hasTablespaces()) unset($columns['tablespace']);
-                       
                        $misc->printTable($schemas, $columns, $actions, $lang['strnoschemas']);
 
                        echo "<p><a class=\"navlink\" href=\"$PHP_SELF?database=", urlencode($_REQUEST['database']),