* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.182 2004/02/13 12:42:12 chriskl Exp $
+ * $Id: Postgres.php,v 1.183 2004/02/25 15:46:22 soranzo Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
function &getStatsTableTuples($table) {
$this->clean($table);
- $sql = "SELECT * FROM pg_stat_all_tables WHERE schemaname='{$this->_schema}'
- AND relname='{$table}'";
+ $sql = 'SELECT * FROM pg_stat_all_tables WHERE';
+ if ($this->hasSchemas()) $sql .= " schemaname='{$this->_schema}' AND";
+ $sql .= " relname='{$table}'";
return $this->selectSet($sql);
}
function &getStatsTableIO($table) {
$this->clean($table);
- $sql = "SELECT * FROM pg_statio_all_tables WHERE schemaname='{$this->_schema}'
- AND relname='{$table}'";
+ $sql = 'SELECT * FROM pg_statio_all_tables WHERE';
+ if ($this->hasSchemas()) $sql .= " schemaname='{$this->_schema}' AND";
+ $sql .= " relname='{$table}'";
return $this->selectSet($sql);
}
function &getStatsIndexTuples($table) {
$this->clean($table);
- $sql = "SELECT * FROM pg_stat_all_indexes WHERE schemaname='{$this->_schema}'
- AND relname='{$table}' ORDER BY indexrelname";
+ $sql = 'SELECT * FROM pg_stat_all_indexes WHERE';
+ if ($this->hasSchemas()) $sql .= " schemaname='{$this->_schema}' AND";
+ $sql .= " relname='{$table}' ORDER BY indexrelname";
return $this->selectSet($sql);
}
function &getStatsIndexIO($table) {
$this->clean($table);
- $sql = "SELECT * FROM pg_statio_all_indexes WHERE schemaname='{$this->_schema}'
- AND relname='{$table}' ORDER BY indexrelname";
+ $sql = 'SELECT * FROM pg_statio_all_indexes WHERE';
+ if ($this->hasSchemas()) $sql .= " schemaname='{$this->_schema}' AND";
+ $sql .= " relname='{$table}' ORDER BY indexrelname";
return $this->selectSet($sql);
}
<?php
/**
- * Does an export of a database to the screen or as a download.
- * Can also dump a specific table of a database.
+ * Does an export of a database or a table (via pg_dump)
+ * to the screen or as a download.
*
- * $Id: dbexport.php,v 1.7 2004/01/29 07:30:11 chriskl Exp $
+ * $Id: dbexport.php,v 1.8 2004/02/25 15:46:22 soranzo Exp $
*/
// Include application functions