* Fix table export problems pre 7.3
* Fix join clause created by view wizard for pre 7.3
* Fix reindex of mixed case indexes
+* Show domains in type lists in appropriate places
Version 3.4
-----------
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.226 2004/06/28 01:22:58 chriskl Exp $
+ * $Id: Postgres.php,v 1.227 2004/06/28 02:26:57 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
/**
* Returns a list of all types in the database
* @param $all If true, will find all available functions, if false just those in search path
+ * @param $tabletypes If true, will include table types
+ * @param $domains Ignored
* @return A recordet
*/
- function &getTypes($all = false, $tabletypes = false) {
+ function &getTypes($all = false, $tabletypes = false, $domains = false) {
global $conf;
if ($all || $conf['show_system']) {
// Never show system table types
$where2 = "AND c.oid > '{$this->_lastSystemOID}'::oid";
+ // Create type filter
+ $tqry = "'c'";
if ($tabletypes)
- $tqry = "'c', 'r', 'v'";
- else
- $tqry = "'c'";
+ $tqry .= ", 'r', 'v'";
$sql = "SELECT
pt.typname AS basename,
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres72.php,v 1.70 2004/06/11 05:08:26 xzilla Exp $
+ * $Id: Postgres72.php,v 1.71 2004/06/28 02:26:57 chriskl Exp $
*/
/**
* Returns a list of all types in the database
* @param $all If true, will find all available functions, if false just those in search path
+ * @param $tabletypes If true, will include table types
+ * @param $domains Ignored
* @return A recordet
*/
- function &getTypes($all = false, $tabletypes = false) {
+ function &getTypes($all = false, $tabletypes = false, $domains = false) {
global $conf;
if ($all || $conf['show_system']) {
// Never show system table types
$where2 = "AND c.oid > '{$this->_lastSystemOID}'::oid";
+ // Create type filter
+ $tqry = "'c'";
if ($tabletypes)
- $tqry = "'c', 'r', 'v'";
- else
- $tqry = "'c'";
+ $tqry .= ", 'r', 'v'";
$sql = "SELECT
pt.typname AS basename,
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres73.php,v 1.121 2004/06/11 05:08:27 xzilla Exp $
+ * $Id: Postgres73.php,v 1.122 2004/06/28 02:26:57 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
/**
* Returns a list of all types in the database
* @param $all If true, will find all available functions, if false just those in search path
- * @param $tabletypes If true, will include table types, false will not.
+ * @param $tabletypes If true, will include table types
+ * @param $domains If true, will include domains
* @return A recordet
*/
- function &getTypes($all = false, $tabletypes = false) {
+ function &getTypes($all = false, $tabletypes = false, $domains = false) {
if ($all)
$where = 'pg_catalog.pg_type_is_visible(t.oid)';
else
// Never show system table types
$where2 = "AND c.relnamespace NOT IN (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname LIKE 'pg\\\\_%')";
+ // Create type filter
+ $tqry = "'c'";
if ($tabletypes)
- $tqry = "'c', 'r', 'v'";
- else
- $tqry = "'c'";
+ $tqry .= ", 'r', 'v'";
+
+ // Create domain filter
+ if (!$domains)
+ $where .= " AND t.typtype != 'd'";
$sql = "SELECT
t.typname AS basename,
LEFT JOIN pg_catalog.pg_user pu ON t.typowner = pu.usesysid
WHERE (t.typrelid = 0 OR (SELECT c.relkind IN ({$tqry}) FROM pg_catalog.pg_class c WHERE c.oid = t.typrelid {$where2}))
AND t.typname !~ '^_'
- AND {$where}
- AND t.typtype != 'd'
+ AND {$where}
ORDER BY typname
";
/**
* Manage functions in a database
*
- * $Id: functions.php,v 1.32 2004/06/03 06:42:20 chriskl Exp $
+ * $Id: functions.php,v 1.33 2004/06/28 02:26:56 chriskl Exp $
*/
// Include application functions
if (!isset($_POST['formProperties'])) $_POST['formProperties'] = $data->defaultprops;
if (!isset($_POST['formSetOf'])) $_POST['formSetOf'] = '';
if (!isset($_POST['formArray'])) $_POST['formArray'] = '';
-
- $types = &$data->getTypes(true, true);
+
+ $types = &$data->getTypes(true, true, true);
$langs = &$data->getLanguages(true);
echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strfunctions']}: {$lang['strcreatefunction']}</h2>\n";
/**
* List tables in a database
*
- * $Id: tables.php,v 1.56 2004/06/26 22:24:09 xzilla Exp $
+ * $Id: tables.php,v 1.57 2004/06/28 02:26:56 chriskl Exp $
*/
// Include application functions
return;
}
- $types = &$data->getTypes(true);
+ $types = &$data->getTypes(true, false, true);
$misc->printTitle(array($misc->printVal($_REQUEST['database']), $lang['strtables'], $lang['strcreatetable']), 'create_table');
$misc->printMsg($msg);
/**
* List tables in a database
*
- * $Id: tblproperties.php,v 1.50 2004/06/26 22:24:09 xzilla Exp $
+ * $Id: tblproperties.php,v 1.51 2004/06/28 02:26:57 chriskl Exp $
*/
// Include application functions
if (!isset($_POST['comment'])) $_POST['comment'] = '';
// Fetch all available types
- $types = &$data->getTypes(true);
+ $types = &$data->getTypes(true, false, true);
echo "<h2>", $misc->printVal($_REQUEST['database']), ": ",
$misc->printVal($_REQUEST['table']), ": {$lang['straddcolumn']}</h2>\n";
// Column type. On 7.5+ this can be altered
if ($data->hasAlterColumnType()) {
// Fetch all available types
- $types = &$data->getTypes(true);
+ $types = &$data->getTypes(true, false, true);
echo "<td><select name=\"type\">\n";
// Output any "magic" types. This came in with Alter Column Type so we don't need to check that