* highlight things on the info stats page
* advanced stats functions
* prevent the user from dropping all the superusers
-* getView() isn't schema-aware for 7.3+?
* rename function in 7.2 and below doesn't come back to the correct function
* 7.5 function named parameters are not supported
not want to use the same pop-up.
* Fix create table if you don't supply as many fields as you originally
specified.
+* Fix schema support for views
Translations
* Trad. Chinese from Chih-Hsin Lee
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres73.php,v 1.116 2004/06/03 06:42:20 chriskl Exp $
+ * $Id: Postgres73.php,v 1.117 2004/06/03 07:34:56 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
return $this->selectSet($sql);
}
+ /**
+ * Returns all details for a particular view
+ * @param $view The name of the view to retrieve
+ * @return View info
+ */
+ function &getView($view) {
+ $this->clean($view);
+
+ $sql = "SELECT c.relname AS viewname, pg_catalog.pg_get_userbyid(c.relowner) AS viewowner,
+ pg_catalog.pg_get_viewdef(c.oid) AS definition, pg_catalog.obj_description(c.oid, 'pg_class') AS comment
+ FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_namespace n ON (n.oid = c.relnamespace)
+ WHERE (c.relname = '$view')
+ AND n.nspname='{$this->_schema}'";
+
+ return $this->selectSet($sql);
+ }
+
/**
* Updates a view.
* @param $viewname The name fo the view to update
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres74.php,v 1.31 2004/05/19 01:28:35 soranzo Exp $
+ * $Id: Postgres74.php,v 1.32 2004/06/03 07:34:56 chriskl Exp $
*/
include_once('./classes/database/Postgres73.php');
*/
function &getView($view) {
$this->clean($view);
+
$sql = "SELECT c.relname AS viewname, pg_catalog.pg_get_userbyid(c.relowner) AS viewowner,
pg_catalog.pg_get_viewdef(c.oid, true) AS definition, pg_catalog.obj_description(c.oid, 'pg_class') AS comment
- FROM pg_catalog.pg_class c
- WHERE (c.relname = '$view')";
+ FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_namespace n ON (n.oid = c.relnamespace)
+ WHERE (c.relname = '$view')
+ AND n.nspname='{$this->_schema}'";
return $this->selectSet($sql);
}
/**
* Manage schemas within a database
*
- * $Id: database.php,v 1.46 2004/05/28 08:17:21 chriskl Exp $
+ * $Id: database.php,v 1.47 2004/06/03 07:34:56 chriskl Exp $
*/
// Include application functions
echo "\t\t\t</select>\n\t\t</td>\n\t\n";
echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strcomment']}</th>\n";
- echo "\t\t<td class=\"data1\"><input name=\"formComment\" size=\"60\" value=\"",
- htmlspecialchars($_POST['formComment']), "\" /></td>\n\t</tr>\n";
+ echo "\t\t<td class=\"data1\"><textarea name=\"formComment\" rows=\"3\" cols=\"32\" wrap=\"virtual\">",
+ htmlspecialchars($_POST['formComment']), "</textarea></td>\n\t</tr>\n";
+
echo "\t</tr>\n";
echo "</table>\n";
echo "<p>\n";
echo "<td class=\"opbutton{$id}\"><a href=\"schema.php?database=",
urlencode($_REQUEST['database']), "&schema=",
urlencode($schemas->f[$data->nspFields['nspname']]), "&action=alter\">{$lang['stralter']}</a></td>\n";
+ // Trim long comments
+ if (strlen($schemas->f[$data->nspFields['nspcomment']]) > $conf['max_chars']) {
+ $schemas->f[$data->nspFields['nspcomment']] = substr($schemas->f[$data->nspFields['nspcomment']], 0, $conf['max_chars'] - 1) . $lang['strellipsis'];
+ }
if ($conf['show_comments']) echo "<td class=\"data{$id}\">", $misc->printVal($schemas->f[$data->nspFields['nspcomment']]), "</td>\n";
echo "</tr>\n";
$schemas->moveNext();