1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
<?php
/**
* PHPPgAdmin v6.0.0-RC9
*/
namespace PHPPgAdmin\Database;
/**
* @file
* PostgreSQL 9.1 support
*/
/**
* Id: Postgres82.php,v 1.10 2007/12/28 16:21:25 ioguix Exp $.
*
* @package PHPPgAdmin
*/
class Postgres91 extends Postgres92
{
public $major_version = 9.1;
// Administration functions
/**
* Returns all available process information.
*
* @param null|string $database (optional) Find only connections to specified database
*
* @return int|\PHPPgAdmin\ADORecordSet A recordset
*/
public function getProcesses($database = null)
{
if ($database === null) {
$sql = 'SELECT datname, usename, procpid AS pid, waiting, current_query AS query, query_start
FROM pg_catalog.pg_stat_activity
ORDER BY datname, usename, procpid';
} else {
$this->clean($database);
$sql = "SELECT datname, usename, procpid AS pid, waiting, current_query AS query, query_start
FROM pg_catalog.pg_stat_activity
WHERE datname='{$database}'
ORDER BY usename, procpid";
}
return $this->selectSet($sql);
}
// Tablespace functions
/**
* Retrieves information for all tablespaces.
*
* @param bool $all Include all tablespaces (necessary when moving objects back to the default space)
*
* @return int|\PHPPgAdmin\ADORecordSet A recordset
*/
public function getTablespaces($all = false)
{
$conf = $this->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 AND pd.classoid='pg_tablespace'::regclass) 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.
*
* @param string $spcname
*
* @return int|\PHPPgAdmin\ADORecordSet A recordset
*/
public 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 AND pd.classoid='pg_tablespace'::regclass) AS spccomment
FROM pg_catalog.pg_tablespace WHERE spcname='{$spcname}'";
return $this->selectSet($sql);
}
// Capabilities
public function hasUserSignals()
{
return false;
}
}
|