- Russell Smith
- Guillaume Lelarge
- Ian Barwick
+- Javier Carlos (Locks view)
Third Party Libraries
* Autovacuum configuration support (Robert Treat)
* Basic ROLE support (Chris Kings-Lynne)
* Add support for SSL connections (Eric Kinolik)
+* Display content of pg_locks view (Javier Carlos)
Version 4.0
-----------
* -Allow management of built-in autovacuum in 8.1 (xzilla)
* Support per-user and per-database connection limits per 8.1
* Put a 'What's blocking this query' on Processes view
-* Show locks on database view
+* -Show locks on database view (Javier)
* Show NOTICES on queries in SQL window/file
- Add sslmode to connection variables (Eric Kinolik)
* Printable view of things
Most objects are now covered thanks to those provided by Niko,
but we still need icons for:
Introduction, Variables, Admin, Privileges, Reports
-
Exotic
------
/**
* Class to hold various commonly used functions
*
- * $Id: Misc.php,v 1.127 2006/05/22 17:31:22 xzilla Exp $
+ * $Id: Misc.php,v 1.128 2006/05/24 04:53:40 chriskl Exp $
*/
class Misc {
'tree' => false,
'icon' => 'Processes',
),
+ 'locks' => array (
+ 'title' => $lang['strlocks'],
+ 'url' => 'database.php',
+ 'urlvars' => array('subject' => 'database', 'action' => 'locks'),
+ 'hide' => (!$data->hasLocksView()),
+ 'help' => 'pg.locks',
+ 'tree' => false,
+ 'icon' => 'Key',
+ ),
'admin' => array (
'title' => $lang['stradmin'],
'url' => 'database.php',
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.284 2006/05/19 07:17:30 chriskl Exp $
+ * $Id: Postgres.php,v 1.285 2006/05/24 04:53:40 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
function hasRoles() { return false; }
function hasAutovacuum() { return false; }
function hasAlterSequence() { return false; }
+ function hasLocksView() { return false; }
}
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres73.php,v 1.156 2006/05/19 07:17:30 chriskl Exp $
+ * $Id: Postgres73.php,v 1.157 2006/05/24 04:53:40 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
return $this->selectSet($sql);
}
-
+
+ /**
+ * Returns table locks information in the current database
+ * @return A recordset
+ */
+ function getLocks() {
+ global $conf;
+
+ if (!$conf['show_system'])
+ $where = "AND pn.nspname NOT LIKE 'pg\\\\_%'";
+ else
+ $where = "AND nspname !~ '^pg_t(emp_[0-9]+|oast)$'";
+
+ $sql = "SELECT pn.nspname, pc.relname AS tablename, pl.transaction, pl.pid, pl.mode, pl.granted
+ FROM pg_catalog.pg_locks pl, pg_catalog.pg_class pc, pg_catalog.pg_namespace pn
+ WHERE pl.relation = pc.oid AND pc.relnamespace=pn.oid {$where}
+ ORDER BY nspname,tablename";
+
+ return $this->selectSet($sql);
+ }
+
// Table functions
/**
function hasUserAndDbVariables() { return true; }
function hasCompositeTypes() { return true; }
function hasFuncPrivs() { return true; }
-
+ function hasLocksView() { return true; }
+
}
?>
/**
* Manage schemas within a database
*
- * $Id: database.php,v 1.82 2006/05/19 07:17:29 chriskl Exp $
+ * $Id: database.php,v 1.83 2006/05/24 04:53:40 chriskl Exp $
*/
// Include application functions
$misc->printTable($processes, $columns, $actions, $lang['strnodata']);
}
+ /**
+ * Show the existing table locks in the current database
+ */
+ function doLocks() {
+ global $PHP_SELF, $data, $misc;
+ global $lang;
+
+ // Get the info from the pg_locks view
+ $variables = $data->getLocks();
+
+ $misc->printTrail('database');
+ $misc->printTabs('database','locks');
+
+ $columns = array(
+ 'namespace' => array(
+ 'title' => $lang['strschema'],
+ 'field' => 'nspname',
+ ),
+ 'tablename' => array(
+ 'title' => $lang['strtablename'],
+ 'field' => 'tablename',
+ ),
+ 'transactionid' => array(
+ 'title' => $lang['strtransaction'],
+ 'field' => 'transaction',
+ ),
+ 'processid' => array(
+ 'title' => $lang['strprocessid'],
+ 'field' => 'pid',
+ ),
+ 'mode' => array(
+ 'title' => $lang['strmode'],
+ 'field' => 'mode',
+ ),
+ 'granted' => array(
+ 'title' => $lang['strislockheld'],
+ 'field' => 'granted',
+ 'type' => 'yesno',
+ ),
+ );
+
+ $actions = array();
+
+ $misc->printTable($variables, $columns, $actions, $lang['strnodata']);
+ }
+
/**
* Allow database administration and tuning tasks
*/
case 'processes':
doProcesses();
break;
+ case 'locks':
+ doLocks();
+ break;
case 'export':
doExport();
break;
/**
* Help links for PostgreSQL 7.3 documentation
*
- * $Id: PostgresDoc73.php,v 1.4 2005/04/30 18:02:01 soranzo Exp $
+ * $Id: PostgresDoc73.php,v 1.5 2006/05/24 04:53:40 chriskl Exp $
*/
include('./help/PostgresDoc72.php');
$this->help_page['pg.database.alter'] = 'sql-alterdatabase.html';
$this->help_page['pg.database.create'][1] = 'manage-ag-createdb.html';
+$this->help_page['pg.locks'] = 'view-pg-locks.html';
+
?>
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.187 2006/05/19 07:17:30 chriskl Exp $
+ * $Id: english.php,v 1.188 2006/05/24 04:53:40 chriskl Exp $
*/
// Language and character set
$lang['strvacuumcostdelay'] = 'Vacuum Cost Delay';
$lang['strvacuumcostlimit'] = 'Vacuum Cost Limit';
+ //Table-level Locks
+ $lang['strlocks'] = 'Locks';
+ $lang['strtransaction'] = 'Transaction ID';
+ $lang['strprocessid'] = 'Process ID';
+ $lang['strmode'] = 'Lock mode';
+ $lang['strislockheld'] = 'Is lock held?';
+
?>
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.140 2006/05/19 07:17:30 chriskl Exp $
+ * $Id: english.php,v 1.141 2006/05/24 04:53:40 chriskl Exp $
*/
// Language and character set
$lang['strvacuumcostdelay'] = 'Vacuum Cost Delay';
$lang['strvacuumcostlimit'] = 'Vacuum Cost Limit';
+ //Table-level Locks
+ $lang['strlocks'] = 'Locks';
+ $lang['strtransaction'] = 'Transaction ID';
+ $lang['strprocessid'] = 'Process ID';
+ $lang['strmode'] = 'Lock mode';
+ $lang['strislockheld'] = 'Is lock held?';
+
?>