* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.285 2006/05/24 04:53:40 chriskl Exp $
+ * $Id: Postgres.php,v 1.286 2006/06/20 14:06:09 xzilla Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
function hasAutovacuum() { return false; }
function hasAlterSequence() { return false; }
function hasLocksView() { return false; }
+ function hasPreparedXacts() { return false; }
}
/**
* PostgreSQL 8.1 support
*
- * $Id: Postgres81.php,v 1.6 2006/04/21 03:31:26 chriskl Exp $
+ * $Id: Postgres81.php,v 1.7 2006/06/20 14:06:09 xzilla Exp $
*/
include_once('./classes/database/Postgres80.php');
return $this->selectSet($sql);
}
+ /**
+ * Returns prepared transactions information
+ * @param $database (optional) Find only prepared trasactions executed in a specific database
+ * @return A recordset
+ */
+ function getPreparedXacts($database = null) {
+ if ($database === null)
+ $sql = "SELECT * FROM pg_prepared_xacts";
+ else {
+ $this->clean($database);
+ $sql = "SELECT transaction, gid, prepared, owner FROM pg_prepared_xacts WHERE database='{$database}'
+ ORDER BY owner";
+ }
+
+ return $this->selectSet($sql);
+ }
+
// Roles
/**
function hasServerAdminFuncs() { return true; }
function hasRoles() { return true; }
function hasAutovacuum() { return true; }
+ function hasPreparedXacts() { return true; }
}
?>
/**
* Manage schemas within a database
*
- * $Id: database.php,v 1.85 2006/06/18 00:11:37 xzilla Exp $
+ * $Id: database.php,v 1.86 2006/06/20 14:06:08 xzilla Exp $
*/
// Include application functions
global $PHP_SELF, $data, $misc;
global $lang;
- // Fetch the processes from the database
- $processes = $data->getProcesses($_REQUEST['database']);
-
$misc->printTrail('database');
$misc->printTabs('database','processes');
$misc->printMsg($msg);
+
+ // Display prepared transactions
+ if($data->hasPreparedXacts()) {
+ echo "<h3>{$lang['strpreparedxacts']}</h3>\n";
+ $prep_xacts = $data->getPreparedXacts($_REQUEST['database']);
+ $columns = array(
+ 'transaction' => array(
+ 'title' => $lang['strxactid'],
+ 'field' => 'transaction',
+ ),
+ 'gid' => array(
+ 'title' => $lang['strgid'],
+ 'field' => 'gid',
+ ),
+ 'prepared' => array(
+ 'title' => $lang['strstarttime'],
+ 'field' => 'prepared',
+ ),
+ 'owner' => array(
+ 'title' => $lang['strowner'],
+ 'field' => 'owner',
+ ),
+ );
+
+ $actions = array();
+
+ $misc->printTable($prep_xacts, $columns, $actions, $lang['strnodata']);
+ }
+
+ // Fetch the processes from the database
+ echo "<br /><h3>{$lang['strprocesses']}</h3>\n";
+ $processes = $data->getProcesses($_REQUEST['database']);
+
$columns = array(
'user' => array(
'title' => $lang['strusername'],
// Remove query start time for <7.4
if (!isset($processes->f['query_start'])) unset($columns['start_time']);
-
+
$misc->printTable($processes, $columns, $actions, $lang['strnodata']);
}
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.188 2006/05/24 04:53:40 chriskl Exp $
+ * $Id: english.php,v 1.189 2006/06/20 14:06:09 xzilla Exp $
*/
// Language and character set
$lang['strmode'] = 'Lock mode';
$lang['strislockheld'] = 'Is lock held?';
+ // Prepared transactions
+ $lang['strpreparedxacts'] = 'Prepared transactions';
+ $lang['strxactid'] = 'Transaction ID';
+ $lang['strgid'] = 'Global ID';
?>
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.141 2006/05/24 04:53:40 chriskl Exp $
+ * $Id: english.php,v 1.142 2006/06/20 14:06:09 xzilla Exp $
*/
// Language and character set
$lang['strmode'] = 'Lock mode';
$lang['strislockheld'] = 'Is lock held?';
+ // Prepared transactions
+ $lang['strpreparedxacts'] = 'Prepared transactions';
+ $lang['strxactid'] = 'Transaction ID';
+ $lang['strgid'] = 'Global ID';
?>