diff options
author | Robert Treat | 2012-06-04 02:25:51 +0000 |
---|---|---|
committer | Robert Treat | 2012-06-04 02:25:51 +0000 |
commit | b733136a7d8d0233a01db1dad83e8939e780fa62 (patch) | |
tree | eca0ca9b3994e6a35cadd3d95e14bfa44ff044e0 | |
parent | df2c223a84f8d85bef2fed1292eee1d5fe3309ac (diff) |
update tablespace support to handle 9.2 changes
-rwxr-xr-x | classes/database/Postgres.php | 4 | ||||
-rwxr-xr-x | classes/database/Postgres91.php | 41 |
2 files changed, 43 insertions, 2 deletions
diff --git a/classes/database/Postgres.php b/classes/database/Postgres.php index 76b9109f..69073d80 100755 --- a/classes/database/Postgres.php +++ b/classes/database/Postgres.php @@ -6941,7 +6941,7 @@ class Postgres extends ADODB_base { function getTablespaces($all = false) { global $conf; - $sql = "SELECT spcname, pg_catalog.pg_get_userbyid(spcowner) AS spcowner, spclocation, + $sql = "SELECT spcname, pg_catalog.pg_get_userbyid(spcowner) AS spcowner, pg_catalog.pg_tablespace_location(oid) as spclocation, (SELECT description FROM pg_catalog.pg_shdescription pd WHERE pg_tablespace.oid=pd.objoid) AS spccomment FROM pg_catalog.pg_tablespace"; @@ -6961,7 +6961,7 @@ class Postgres extends ADODB_base { function getTablespace($spcname) { $this->clean($spcname); - $sql = "SELECT spcname, pg_catalog.pg_get_userbyid(spcowner) AS spcowner, spclocation, + $sql = "SELECT spcname, pg_catalog.pg_get_userbyid(spcowner) AS spcowner, pg_catalog.pg_tablespace_location(oid) as spclocation, (SELECT description FROM pg_catalog.pg_shdescription pd WHERE pg_tablespace.oid=pd.objoid) AS spccomment FROM pg_catalog.pg_tablespace WHERE spcname='{$spcname}'"; diff --git a/classes/database/Postgres91.php b/classes/database/Postgres91.php index acda2053..613beca8 100755 --- a/classes/database/Postgres91.php +++ b/classes/database/Postgres91.php @@ -27,7 +27,48 @@ class Postgres91 extends Postgres { return $this->help_page; } + // Tablespace functions + + /** + * Retrieves information for all tablespaces + * @param $all Include all tablespaces (necessary when moving objects back to the default space) + * @return A recordset + */ + function getTablespaces($all = false) { + global $conf; + + $sql = "SELECT spcname, pg_catalog.pg_get_userbyid(spcowner) AS spcowner, spclocation, + (SELECT description FROM pg_catalog.pg_shdescription pd WHERE pg_tablespace.oid=pd.objoid) AS spccomment + FROM pg_catalog.pg_tablespace"; + + if (!$conf['show_system'] && !$all) { + $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, + (SELECT description FROM pg_catalog.pg_shdescription pd WHERE pg_tablespace.oid=pd.objoid) AS spccomment + FROM pg_catalog.pg_tablespace WHERE spcname='{$spcname}'"; + + return $this->selectSet($sql); + } + + // Capabilities + + + } ?> |