From 30022a008063c74cac8835d068bc09554555182d Mon Sep 17 00:00:00 2001 From: chriskl Date: Mon, 29 Nov 2004 01:48:38 +0000 Subject: [PATCH] support 8.0beta5 removal of tablespaces on schemas --- HISTORY | 3 +++ classes/database/Postgres73.php | 7 ++----- classes/database/Postgres80.php | 5 ++--- database.php | 35 +++------------------------------ 4 files changed, 10 insertions(+), 40 deletions(-) diff --git a/HISTORY b/HISTORY index e44e7720..f0319326 100644 --- 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 diff --git a/classes/database/Postgres73.php b/classes/database/Postgres73.php index 61f787fd..99d1c87a 100644 --- a/classes/database/Postgres73.php +++ b/classes/database/Postgres73.php @@ -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; diff --git a/classes/database/Postgres80.php b/classes/database/Postgres80.php index d205eb1e..db1f6f10 100644 --- a/classes/database/Postgres80.php +++ b/classes/database/Postgres80.php @@ -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"; diff --git a/database.php b/database.php index 47baac7d..a3726770 100755 --- a/database.php +++ b/database.php @@ -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 @@ -586,8 +586,6 @@ // 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'); @@ -607,25 +605,7 @@ ($uname == $_POST['formAuth']) ? ' selected="selected"' : '', ">{$uname}\n"; $users->moveNext(); } - echo "\t\t\t\n\t\t\n\t\n"; - - // Tablespace (if there are any) - if ($data->hasTablespaces() && $tablespaces->recordCount() > 0) { - echo "\t\n\t\t{$lang['strtablespace']}\n"; - echo "\t\t\n\t\t\t\n\t\t\n\t\n"; - } - + echo "\t\t\t\n\t\t\n\t\n"; echo "\t\n\t\t{$lang['strcomment']}\n"; echo "\t\t\n\t\n"; @@ -647,13 +627,10 @@ 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']); @@ -687,10 +664,6 @@ 'title' => $lang['strowner'], 'field' => 'nspowner', ), - 'tablespace' => array( - 'title' => $lang['strtablespace'], - 'field' => 'tablespace', - ), 'actions' => array( 'title' => $lang['stractions'], ), @@ -723,8 +696,6 @@ ), ); - if (!$data->hasTablespaces()) unset($columns['tablespace']); - $misc->printTable($schemas, $columns, $actions, $lang['strnoschemas']); echo "