* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.304 2007/09/18 05:03:29 xzilla Exp $
+ * $Id: Postgres.php,v 1.305 2007/09/29 09:09:45 ioguix Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
*/
function getIndexes($table = '', $unique = false) {
$this->clean($table);
- $sql = "SELECT c2.relname AS indname, i.indisprimary, i.indisunique, pg_get_indexdef(i.indexrelid) AS inddef
+ $sql = "SELECT c2.relname AS indname, i.indisprimary, i.indisunique, pg_get_indexdef(i.indexrelid) AS inddef,
+ pg_catalog.obj_description(c.oid, 'pg_index') AS idxcomment
FROM pg_class c, pg_class c2, pg_index i
WHERE c.relname = '{$table}' AND c.oid = i.indrelid AND i.indexrelid = c2.oid
";
function hasUserRename() { return false; }
function hasRecluster() { return false; }
function hasFullVacuum() { return false; }
- function hasForeignKeysInfo() { return false; }
+ function hasConstraintsInfo() { return false; }
+ function hasForeignKeysInfo() { return $this->hasConstraintsInfo(); }
function hasViewColumnRename() { return false; }
function hasTablespaces() { return false; }
function hasSignals() { return false; }
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres73.php,v 1.171 2007/09/29 09:00:33 ioguix Exp $
+ * $Id: Postgres73.php,v 1.172 2007/09/29 09:09:45 ioguix Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
$this->clean($table);
$sql = "SELECT c2.relname AS indname, i.indisprimary, i.indisunique, i.indisclustered,
- pg_catalog.pg_get_indexdef(i.indexrelid) AS inddef
+ pg_catalog.pg_get_indexdef(i.indexrelid) AS inddef,
+ pg_catalog.obj_description(c.oid, 'pg_index') AS idxcomment
FROM pg_catalog.pg_class c, pg_catalog.pg_class c2, pg_catalog.pg_index i
WHERE c.relname = '{$table}' AND pg_catalog.pg_table_is_visible(c.oid)
AND c.oid = i.indrelid AND i.indexrelid = c2.oid
SELECT
c.contype, c.conname, pg_catalog.pg_get_constraintdef(c.oid) AS consrc,
ns1.nspname as p_schema, r1.relname as p_table, ns2.nspname as f_schema,
- r2.relname as f_table, f1.attname as p_field, f2.attname as f_field
+ r2.relname as f_table, f1.attname as p_field, f2.attname as f_field,
+ pg_catalog.obj_description(c.oid, \'pg_constraint\') AS constcomment
FROM
pg_catalog.pg_constraint AS c
JOIN pg_catalog.pg_class AS r1 ON (c.conrelid=r1.oid)
function hasUserSessionDefaults() { return true; }
function hasVariables() { return true; }
function hasFullExplain() { return true; }
- function hasForeignKeysInfo() { return true; }
+// function hasForeignKeysInfo() { return true; }
+ function hasConstraintsInfo() { return true; }
function hasViewColumnRename() { return true; }
function hasUserAndDbVariables() { return true; }
function hasCompositeTypes() { return true; }
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres74.php,v 1.62 2007/09/29 09:00:33 ioguix Exp $
+ * $Id: Postgres74.php,v 1.63 2007/09/29 09:09:45 ioguix Exp $
*/
include_once('./classes/database/Postgres73.php');
SELECT
c.contype, c.conname, pg_catalog.pg_get_constraintdef(c.oid,true) AS consrc,
ns1.nspname as p_schema, r1.relname as p_table, ns2.nspname as f_schema,
- r2.relname as f_table, f1.attname as p_field, f2.attname as f_field
+ r2.relname as f_table, f1.attname as p_field, f2.attname as f_field,
+ pg_catalog.obj_description(c.oid, \'pg_constraint\') AS constcomment
FROM
pg_catalog.pg_constraint AS c
JOIN pg_catalog.pg_class AS r1 ON (c.conrelid=r1.oid)
/**
* PostgreSQL 8.2 support
*
- * $Id: Postgres82.php,v 1.7 2007/09/21 20:00:38 ioguix Exp $
+ * $Id: Postgres82.php,v 1.8 2007/09/29 09:09:45 ioguix Exp $
*/
include_once('./classes/database/Postgres81.php');
SELECT
c.contype, c.conname, pg_catalog.pg_get_constraintdef(c.oid, true) AS consrc,
ns1.nspname as p_schema, r1.relname as p_table, ns2.nspname as f_schema,
- r2.relname as f_table, f1.attname as p_field, f2.attname as f_field
+ r2.relname as f_table, f1.attname as p_field, f2.attname as f_field,
+ pg_catalog.obj_description(c.oid, \'pg_constraint\') AS constcomment
FROM
pg_catalog.pg_constraint AS c
JOIN pg_catalog.pg_class AS r1 ON (c.conrelid=r1.oid)
/**
* List constraints on a table
*
- * $Id: constraints.php,v 1.53 2007/09/13 13:41:01 ioguix Exp $
+ * $Id: constraints.php,v 1.54 2007/09/29 09:09:45 ioguix Exp $
*/
// Include application functions
'actions' => array(
'title' => $lang['stractions'],
),
+ 'comment' => array(
+ 'title' => $lang['strcomment'],
+ 'field' => field('constcomment'),
+ ),
);
+
+ if (!$data->hasConstraintsInfo()) unset($columns['comment']);
$actions = array(
'drop' => array(
/**
* List indexes on a table
*
- * $Id: indexes.php,v 1.44 2007/08/31 18:30:11 ioguix Exp $
+ * $Id: indexes.php,v 1.45 2007/09/29 09:09:45 ioguix Exp $
*/
// Include application functions
'actions' => array(
'title' => $lang['stractions'],
),
+ 'comment' => array(
+ 'title' => $lang['strcomment'],
+ 'field' => field('idxcomment'),
+ ),
);
$actions = array(
/**
* List tables in a database
*
- * $Id: tblproperties.php,v 1.86 2007/09/28 12:05:56 ioguix Exp $
+ * $Id: tblproperties.php,v 1.87 2007/09/29 09:09:45 ioguix Exp $
*/
// Include application functions
'field' => field('comment'),
),
);
- if (!$data->hasForeignKeysInfo()) {
+ if (!$data->hasConstraintsInfo()) {
unset($columns['keyprop']);
}
else {