* Fix SQL window parent update to not update any random window
* Show owner on privileges screen?
http://devilock.mine.nu/textarea_tab.html
-
-* DOMAINS NOT SHOWN IN TYPE LISTS!
+* privs on tablespaces
+* creating objects in tablespaces
+* fix test for MINGW backend
Groups
------
-* -Alter group (chriskl)
Permissions
-----------
Databases
---------
-* -Fix failure to drop database even tho seemingly no-one is connected to it (chriskl, bryan)
* Add alter database for 7.3+
-* -Dump database using pg_dump streaming (chriskl)
* Comments on databases
* -Vacuum & analyze (bryan)
Tables
------
+* Allow PK and UNIQUE and FKs during create table
* -Not using proper attFields array for attribute info (i was being lazy) (wontfix)
* -Rename table
* -Change table owner
Views
-----
-* Display, add, edit and drop rules on views
Sequences
---------
Functions
---------
-* Browse function (set-returning-functions only)
* Syntax highlighting?
Indexes
-------
-* -Partial indexes (chriskl)
* Functional indexes
Types
Operators
---------
-* -Properties (chriskl)
-* -Drop (chriskl)
* Create
Operator Classes
----------------
-* Unimplemented
+* Create
Triggers
--------
-* -Alter trigger (7.3+) (eg. rename trigger) (chriskl)
Aggregates
----------
Languages
---------
-* -Display (chriskl)
* Drop
* Create
Conversions (7.3)
-----------------
-* -Display (chriskl)
* Properties
* Drop
* Create
Casts (7.3)
-----------
-* -Display (chriskl)
* Properties
* Drop
* Create
-Settings
---------
-
-* -Postgres 7.3 returns SHOW ALL as a proper result set - makes it easy to do a phpMyAdmin style 'view settings'.
-
Miscellaneous
-------------
* Allow setting/dropping comments for all objects (Dan Boren)
* Show owner for all objects
* Allow changing owner for objects that have this feature (7.4+ generally)
-* -Config option to disallow pgsql and postgres logins
-* Do David Smith's redireect idea to prevent refresh login resending password
* Translated FAQ
Exotic
------
* Support contrib/tsearch2 for easy full text indexes
-* -Search for object feature (chriskl)
* Pivot reports (ADODB has a feature for this)
* Parameratised reports (use prepared queries)
* Full web accessability conformance
/*
* Parent class of all ADODB objects.
*
- * $Id: ADODB_base.php,v 1.16 2003/12/17 09:11:32 chriskl Exp $
+ * $Id: ADODB_base.php,v 1.17 2004/07/04 15:02:35 chriskl Exp $
*/
include_once('./libraries/errorhandler.inc.php');
return !$this->conn->RollbackTrans();
}
+ /**
+ * Get the backend platform
+ * @return The backend platform
+ */
+ function getPlatform() {
+ //return $this->conn->platform;
+ return "UNKNOWN";
+ }
+
// Type conversion routines
/**
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: BaseDB.php,v 1.48 2004/05/30 14:31:35 chriskl Exp $
+ * $Id: BaseDB.php,v 1.49 2004/07/04 15:02:35 chriskl Exp $
*/
include_once('./classes/database/ADODB_base.php');
function hasFullVacuum() { return false; }
function hasForeignKeysInfo() { return false; }
function hasViewColumnRename() { return false; }
+ function hasTablespaces() { return false; }
}
/**
* Class to represent a database connection
*
- * $Id: Connection.php,v 1.4 2004/06/07 11:38:39 soranzo Exp $
+ * $Id: Connection.php,v 1.5 2004/07/04 15:02:35 chriskl Exp $
*/
include_once('./classes/database/ADODB_base.php');
class Connection {
var $conn;
-
+
+ // The backend platform. Set to UNKNOWN by default.
+ var $platform = 'UNKNOWN';
+
/**
* Creates a new connection. Will actually make a database connection.
* @param $fetchMode Defaults to associative. Override for different behaviour
}
/**
- * Gets the name of the correct database driver to use
+ * Gets the name of the correct database driver to use. As a side effect,
+ * sets the platform.
* @param (return-by-ref) $description A description of the database and version
* @return The class name of the driver eg. Postgres73
* @return null if version is < 7.0
$sql = "SELECT VERSION() AS version";
$field = $adodb->selectField($sql, 'version');
+ // Check the platform, if it's mingw, set it
+ if (eregi(' mingw ', $field))
+ $this->platform = 'MINGW';
+
$params = explode(' ', $field);
if (!isset($params[1])) return -3;
/**
* PostgreSQL 7.5 support
*
- * $Id: Postgres75.php,v 1.6 2004/06/06 08:50:28 chriskl Exp $
+ * $Id: Postgres75.php,v 1.7 2004/07/04 15:02:35 chriskl Exp $
*/
include_once('./classes/database/Postgres74.php');
return $this->endTransaction();
}
+
+ // Tablespace functions
+
+ /**
+ * Retrieves information for all tablespaces
+ * @return A recordset
+ */
+ function getTablespaces() {
+ global $conf;
+
+ $sql = "SELECT spcname, pg_catalog.pg_get_userbyid(spcowner) AS spcowner, spclocation
+ FROM pg_catalog.pg_tablespace";
+
+ if (!$conf['show_system']) {
+ $sql .= " WHERE spcname NOT LIKE 'pg\\\\_%'";
+ }
+
+ $sql .= " ORDER BY spcname";
+
+ return $this->selectSet($sql);
+ }
+
+ /**
+ * Retrieves a tablespace's information
+ * @return A recordset
+ */
+ function getTablespace($spcname) {
+ $this->clean($spcname);
+
+ $sql = "SELECT spcname, pg_catalog.pg_get_userbyid(spcowner) AS spcowner, spclocation
+ FROM pg_catalog.pg_tablespace WHERE spcname='{$spcname}'";
+
+ return $this->selectSet($sql);
+ }
+
+ /**
+ * Creates a tablespace
+ * @param $spcname The name of the tablespace to create
+ * @param $spcowner The owner of the tablespace. '' for current
+ * @param $spcloc The directory in which to create the tablespace
+ * @return 0 success
+ */
+ function createTablespace($spcname, $spcowner, $spcloc) {
+ $this->fieldClean($spcname);
+ $this->clean($spcloc);
+
+ $sql = "CREATE TABLESPACE \"{$spcname}\"";
+
+ if ($spcowner != '') {
+ $this->fieldClean($spcowner);
+ $sql .= " OWNER \"{$spcowner}\"";
+ }
+
+ $sql .= " LOCATION '{$spcloc}'";
- function hasAlterColumnType() { return true; }
+ return $this->execute($sql);
+ }
+
+ /**
+ * Drops a tablespace
+ * @param $spcname The name of the domain to drop
+ * @return 0 success
+ */
+ function dropTablespace($spcname) {
+ $this->fieldClean($spcname);
+
+ $sql = "DROP TABLESPACE \"{$spcname}\"";
+
+ return $this->execute($sql);
+ }
+
+ /**
+ * Alters a tablespace
+ * @param $spcname The name of the tablespace
+ * @param $name The new name for the tablespace
+ * @param $owner The new owner for the tablespace
+ * @return 0 success
+ * @return -1 transaction error
+ * @return -2 owner error
+ * @return -3 rename error
+ */
+ function alterTablespace($spcname, $name, $owner) {
+ $this->fieldClean($spcname);
+ $this->fieldClean($name);
+ $this->fieldClean($owner);
+
+ // Begin transaction
+ $status = $this->beginTransaction();
+ if ($status != 0) return -1;
+
+ // Owner
+ $sql = "ALTER TABLESPACE \"{$spcname}\" OWNER TO \"{$owner}\"";
+ $status = $this->execute($sql);
+ if ($status != 0) {
+ $this->rollbackTransaction();
+ return -2;
+ }
+
+ // Rename (only if name has changed)
+ if ($name != $spcname) {
+ $sql = "ALTER TABLESPACE \"{$spcname}\" RENAME TO \"{$name}\"";
+ $status = $this->execute($sql);
+ if ($status != 0) {
+ $this->rollbackTransaction();
+ return -3;
+ }
+ }
+
+ return $this->endTransaction();
+ }
+ function hasAlterColumnType() { return true; }
+ function hasTablespaces() {
+ $platform = $this->getPlatform();
+ return $platform != 'MINGW';
+ }
+
}
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.147 2004/06/07 11:38:39 soranzo Exp $
+ * $Id: english.php,v 1.148 2004/07/04 15:02:35 chriskl Exp $
*/
// Language and character set
$lang['strdisk'] = 'Disk';
$lang['strrows2'] = 'Rows';
+ // Tablespaces
+ $lang['strtablespaces'] = 'Tablespaces';
+ $lang['strnotablespaces'] = 'No tablespaces found.';
+ $lang['strcreatetablespace'] = 'Create tablespace';
+ $lang['strlocation'] = 'Location';
+ $lang['strtablespaceneedsname'] = 'You must give a name for your tablespace.';
+ $lang['strtablespaceneedsloc'] = 'You must give a directory in which to create the tablespace.';
+ $lang['strtablespacecreated'] = 'Tablespace created';
+ $lang['strtablespacecreatedbad'] = 'Tablespace creation failed';
+ $lang['strconfdroptablespace'] = 'Are you sure you want to drop the tablespace "%s"?';
+ $lang['strtablespacedropped'] = 'Tablespace dropped.';
+ $lang['strtablespacedroppedbad'] = 'Tablespace drop failed.';
+ $lang['strtablespacealtered'] = 'Tablespace altered.';
+ $lang['strtablespacealteredbad'] = 'Tablespace alteration failed.';
+
// Miscellaneous
$lang['strtopbar'] = '%s running on %s:%s -- You are logged in as user "%s", %s';
$lang['strtimefmt'] = 'jS M, Y g:iA';
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.100 2004/06/07 11:38:39 soranzo Exp $
+ * $Id: english.php,v 1.101 2004/07/04 15:02:35 chriskl Exp $
*/
// Language and character set
$lang['strdisk'] = 'Disk';
$lang['strrows2'] = 'Rows';
+ // Tablespaces
+ $lang['strtablespaces'] = 'Tablespaces';
+ $lang['strnotablespaces'] = 'No tablespaces found.';
+ $lang['strcreatetablespace'] = 'Create tablespace';
+ $lang['strlocation'] = 'Location';
+ $lang['strtablespaceneedsname'] = 'You must give a name for your tablespace.';
+ $lang['strtablespaceneedsloc'] = 'You must give a directory in which to create the tablespace.';
+ $lang['strtablespacecreated'] = 'Tablespace created';
+ $lang['strtablespacecreatedbad'] = 'Tablespace creation failed';
+ $lang['strconfdroptablespace'] = 'Are you sure you want to drop the tablespace "%s"?';
+ $lang['strtablespacedropped'] = 'Tablespace dropped.';
+ $lang['strtablespacedroppedbad'] = 'Tablespace drop failed.';
+ $lang['strtablespacealtered'] = 'Tablespace altered.';
+ $lang['strtablespacealteredbad'] = 'Tablespace alteration failed.';
+
// Miscellaneous
$lang['strtopbar'] = '%s running on %s:%s -- You are logged in as user "%s", %s';
$lang['strtimefmt'] = 'jS M, Y g:iA';
/**
* Top menu for phpPgAdmin
*
- * $Id: topbar.php,v 1.23 2004/05/31 09:46:37 soranzo Exp $
+ * $Id: topbar.php,v 1.24 2004/07/04 15:02:35 chriskl Exp $
*/
// Include application functions
endif;
?>
<a class="toplink" href="users.php?action=account" target="detail"><?php echo $lang['straccount'] ?></a> |
+<?php if ($data->hasTablespaces()) : ?>
+ <a class="toplink" href="tablespaces.php" target="detail"><?php echo $lang['strtablespaces'] ?></a> |
+<?php endif; ?>
<?php if ($conf['show_reports']) : ?>
<a class="toplink" href="reports.php" target="detail"><?php echo $lang['strreports'] ?></a> |
<?php endif; ?>