* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.303 2007/09/13 14:53:41 ioguix Exp $
+ * $Id: Postgres.php,v 1.304 2007/09/18 05:03:29 xzilla Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
function hasCreateTableLike() {return false;}
function hasCreateTableLikeWithConstraints() {return false;}
function hasCreateTableLikeWithIndexes() {return false;}
- function hasFTS() {return false;}
+ function hasFTS() {return false;}
+ function hasVirtualTransactionId() {return false;}
}
?>
/**
* PostgreSQL 8.3 support
*
- * $Id: Postgres83.php,v 1.5 2007/09/14 21:38:06 ioguix Exp $
+ * $Id: Postgres83.php,v 1.6 2007/09/18 05:03:29 xzilla Exp $
*/
include_once('./classes/database/Postgres82.php');
return $this->help_page;
}
+ // Schemas functions
+ /**
+ * 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.pid, pl.mode, pl.granted, pl.virtualtransaction,
+ (select transactionid from pg_catalog.pg_locks l2 where l2.locktype='transactionid'
+ and l2.mode='ExclusiveLock' and l2.virtualtransaction=pl.virtualtransaction) as transaction
+ 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
+ pid,nspname,tablename";
+
+ return $this->selectSet($sql);
+ }
+
// Views functions
/**
return $this->selectSet($sql);
}
- // FTS functions
+ // FTS functions
+
/**
* Creates a new FTS configuration.
* @param string $cfgname The name of the FTS configuration to create
// Capabilities
function hasCreateTableLikeWithIndexes() {return true;}
+ function hasVirtualTransactionId() {return true;}
}
?>
/**
* Manage schemas within a database
*
- * $Id: database.php,v 1.101 2007/08/31 18:30:10 ioguix Exp $
+ * $Id: database.php,v 1.102 2007/09/18 05:03:29 xzilla Exp $
*/
// Include application functions
'title' => $lang['strtablename'],
'field' => field('tablename'),
),
+ 'vxid' => array(
+ 'title' => $lang['strvirtualtransaction'],
+ 'field' => field('virtualtransaction'),
+ ),
'transactionid' => array(
'title' => $lang['strtransaction'],
'field' => field('transaction'),
),
);
+ if (!$data->hasVirtualTransactionId()) unset($columns['vxid']);
+
$actions = array();
$misc->printTable($variables, $columns, $actions, $lang['strnodata']);
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.217 2007/09/13 14:53:41 ioguix Exp $
+ * $Id: english.php,v 1.218 2007/09/18 05:03:29 xzilla Exp $
*/
// Language and character set
// Table-level Locks
$lang['strlocks'] = 'Locks';
$lang['strtransaction'] = 'Transaction ID';
+ $lang['strvirtualtransaction'] = 'Virtual Transaction ID';
$lang['strprocessid'] = 'Process ID';
$lang['strmode'] = 'Lock mode';
$lang['strislockheld'] = 'Is lock held?';
$lang['strftsmappingaddedbad'] = 'FTS mapping add failed.';
-?>
\ No newline at end of file
+?>
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.169 2007/09/13 14:53:41 ioguix Exp $
+ * $Id: english.php,v 1.170 2007/09/18 05:03:29 xzilla Exp $
*/
// Language and character set
// Table-level Locks
$lang['strlocks'] = 'Locks';
$lang['strtransaction'] = 'Transaction ID';
+ $lang['strvirtualtransaction'] = 'Virtual Transaction ID';
$lang['strprocessid'] = 'Process ID';
$lang['strmode'] = 'Lock mode';
$lang['strislockheld'] = 'Is lock held?';