* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.312 2007/11/21 15:45:31 ioguix Exp $
+ * $Id: Postgres.php,v 1.313 2007/11/21 19:10:40 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,
- pg_catalog.obj_description(c.oid, 'pg_index') AS idxcomment
+ 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
";
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres73.php,v 1.177 2007/11/21 12:59:42 ioguix Exp $
+ * $Id: Postgres73.php,v 1.178 2007/11/21 19:10:40 ioguix Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
$sql = "
SELECT
- c.relname, u.usename AS relowner,
+ c.relname, n.nspname, u.usename AS relowner,
pg_catalog.obj_description(c.oid, 'pg_class') AS relcomment
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_user u ON u.usesysid = c.relowner
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind = 'r'
- AND n.nspname = '{$this->_schema}'
- AND c.relname = '{$table}'";
+ AND n.nspname = '{$this->_schema}'
+ AND c.relname = '{$table}'";
return $this->selectSet($sql);
}
/**
* Manage sequences in a database
*
- * $Id: sequences.php,v 1.47 2007/11/21 12:59:42 ioguix Exp $
+ * $Id: sequences.php,v 1.48 2007/11/21 19:10:40 ioguix Exp $
*/
// Include application functions
if (!isset($_POST['name'])) $_POST['name'] = $_REQUEST['sequence'];
if (!isset($_POST['comment'])) $_POST['comment'] = $sequence->fields['seqcomment'];
if (!isset($_POST['owner'])) $_POST['owner'] = $sequence->fields['seqowner'];
- if (!isset($_POST['newschema'])) $_POST['newschema'] = $sequence->fields['nspname'];
+ if (!isset($_POST['newschema']) && $data->hasSchemas()) $_POST['newschema'] = $sequence->fields['nspname'];
// Handle Checkbox Value
$sequence->fields['is_cycled'] = $data->phpBool($sequence->fields['is_cycled']);