* 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
Miscellaneous
-------------
+* Support 7.5 functions for killing backend processes
+* Printable view of things
* Allow simultaneous logins to different clusters (mark gibson)
* Show comments for all objects (Dan Boren)
* Allow setting/dropping comments for all objects (Dan Boren)
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.219 2004/06/03 03:48:22 chriskl Exp $
+ * $Id: Postgres.php,v 1.220 2004/06/03 06:42:20 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
* @return A recordset
*/
function &getSequence($sequence) {
+ $temp = $sequence;
+ // Need both field cleaned and literal cleaned versions
$this->fieldClean($sequence);
+ $this->clean($temp);
- $sql = "SELECT sequence_name AS relname, * FROM \"{$sequence}\"";
+ $sql = "SELECT sequence_name AS relname, *,
+ (SELECT description FROM pg_description pd WHERE pd.objoid=(SELECT oid FROM pg_class WHERE relname='{$temp}')) AS seqcomment
+ FROM \"{$sequence}\" AS s";
return $this->selectSet( $sql );
}
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres73.php,v 1.115 2004/05/31 13:25:49 chriskl Exp $
+ * $Id: Postgres73.php,v 1.116 2004/06/03 06:42:20 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
/**
* Returns properties of a single sequence
+ * @param $sequence Sequence name
* @return A recordset
*/
function &getSequence($sequence) {
$this->fieldClean($sequence);
-
- $sql = "SELECT sequence_name AS relname, * FROM \"{$sequence}\"";
+
+ $sql = "SELECT sequence_name AS relname, *, pg_catalog.obj_description(s.tableoid, 'pg_class') AS seqcomment FROM \"{$sequence}\" AS s";
return $this->selectSet( $sql );
}
/**
* Manage domains in a database
*
- * $Id: domains.php,v 1.12 2004/05/31 13:25:49 chriskl Exp $
+ * $Id: domains.php,v 1.13 2004/06/03 06:42:20 chriskl Exp $
*/
// Include application functions
echo "<td class=\"data{$id}\">", $misc->printVal($domains->f['domowner']), "</td>\n";
echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=properties&{$misc->href}&domain=", urlencode($domains->f['domname']), "\">{$lang['strproperties']}</a></td>\n";
echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=confirm_drop&{$misc->href}&domain=", urlencode($domains->f['domname']), "\">{$lang['strdrop']}</a></td>\n";
+ // Trim long comments
+ if (strlen($domains->f['domcomment']) > $conf['max_chars']) {
+ $domains->f['domcomment'] = substr($domains->f['domcomment'], 0, $conf['max_chars'] - 1) . $lang['strellipsis'];
+ }
if ($conf['show_comments']) echo "<td class=\"data{$id}\">", $misc->printVal($domains->f['domcomment']), "</td>\n";
echo "</tr>\n";
$domains->moveNext();
/**
* Manage functions in a database
*
- * $Id: functions.php,v 1.31 2004/05/31 13:25:49 chriskl Exp $
+ * $Id: functions.php,v 1.32 2004/06/03 06:42:20 chriskl Exp $
*/
// Include application functions
$funcs->f[$data->fnFields['fnoid']], "&type=function\">{$lang['strprivileges']}</a></td>\n";
}
else echo "<td></td>";
+ // Trim long comments
+ if (strlen($funcs->f['funccomment']) > $conf['max_chars']) {
+ $funcs->f['funccomment'] = substr($funcs->f['funccomment'], 0, $conf['max_chars'] - 1) . $lang['strellipsis'];
+ }
if ($conf['show_comments']) echo "<td class=\"data{$id}\">", $misc->printVal($funcs->f['funccomment']), "</td>\n";
echo "</tr>\n";
$funcs->moveNext();
/**
* Manage sequences in a database
*
- * $Id: sequences.php,v 1.19 2004/05/09 02:00:25 chriskl Exp $
+ * $Id: sequences.php,v 1.20 2004/06/03 06:42:20 chriskl Exp $
*/
// Include application functions
echo "<td class=\"opbutton{$id}\">";
echo "<a href=\"privileges.php?{$misc->href}&object=", urlencode($sequences->f[$data->sqFields['seqname']]),
"&type=sequence\">{$lang['strprivileges']}</td>\n";
+ // Trim long comments
+ if (strlen($sequences->f['seqcomment']) > $conf['max_chars']) {
+ $sequences->f['seqcomment'] = substr($sequences->f['seqcomment'], 0, $conf['max_chars'] - 1) . $lang['strellipsis'];
+ }
if ($conf['show_comments']) echo "<td class=\"data{$id}\">", $misc->printVal($sequences->f['seqcomment']), "</td>\n";
echo "</tr>\n";
$sequences->movenext();
// Fetch the sequence information
$sequence = &$data->getSequence($_REQUEST['sequence']);
- if (is_object($sequence) && $sequence->recordCount() > 0) {
+ if (is_object($sequence) && $sequence->recordCount() > 0) {
$sequence->f[$data->sqFields['iscycled']] = $data->phpBool($sequence->f[$data->sqFields['iscycled']]);
$sequence->f[$data->sqFields['iscalled']] = $data->phpBool($sequence->f[$data->sqFields['iscalled']]);
+
+ // Show comment if any
+ if ($sequence->f['seqcomment'] !== null)
+ echo "<p class=\"comment\">", $misc->printVal($sequence->f['seqcomment']), "</p>\n";
+
echo "<table border=\"0\">";
echo "<tr><th class=\"data\">{$lang['strname']}</th><th class=\"data\">{$lang['strlastvalue']}</th>";
echo "<th class=\"data\">{$lang['strincrementby']}</th><th class=\"data\">{$lang['strmaxvalue']}</th>";
/**
* List tables in a database
*
- * $Id: tables.php,v 1.52 2004/05/31 13:34:40 chriskl Exp $
+ * $Id: tables.php,v 1.53 2004/06/03 06:42:20 chriskl Exp $
*/
// Include application functions
$status = $data->createTable($_REQUEST['name'], $_REQUEST['fields'], $_REQUEST['field'],
$_REQUEST['type'], $_REQUEST['array'], $_REQUEST['length'], $_REQUEST['notnull'], $_REQUEST['default'],
isset($_REQUEST['withoutoids']), $_REQUEST['colcomment'], $_REQUEST['tblcomment']);
+
if ($status == 0) {
$_reload_browser = true;
doDefault($lang['strtablecreated']);
urlencode($tables->f[$data->tbFields['tbname']]), "\">{$lang['strempty']}</a></td>\n";
echo "\t<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=confirm_drop&{$misc->href}&table=",
urlencode($tables->f[$data->tbFields['tbname']]), "\">{$lang['strdrop']}</a></td>\n";
+ // Trim long comments
+ if (strlen($tables->f['tablecomment']) > $conf['max_chars']) {
+ $tables->f['tablecomment'] = substr($tables->f['tablecomment'], 0, $conf['max_chars'] - 1) . $lang['strellipsis'];
+ }
if ($conf['show_comments']) echo "\t<td class=\"data{$id}\">", $misc->printVal($tables->f['tablecomment']), "</td>\n";
echo "</tr>\n";
$tables->moveNext();
/**
* Manage views in a database
*
- * $Id: views.php,v 1.40 2004/05/31 13:34:40 chriskl Exp $
+ * $Id: views.php,v 1.41 2004/06/03 06:42:20 chriskl Exp $
*/
// Include application functions
echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=confselectrows&{$misc->href}&view=", urlencode($views->f[$data->vwFields['vwname']]), "\">{$lang['strselect']}</a></td>\n";
echo "<td class=\"opbutton{$id}\"><a href=\"viewproperties.php?{$misc->href}&view=", urlencode($views->f[$data->vwFields['vwname']]), "\">{$lang['strproperties']}</a></td>\n";
echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=confirm_drop&{$misc->href}&view=", urlencode($views->f[$data->vwFields['vwname']]), "\">{$lang['strdrop']}</a></td>\n";
+ // Trim long comments
+ if (strlen($views->f[$data->vwFields['vwcomment']]) > $conf['max_chars']) {
+ $views->f[$data->vwFields['vwcomment']] = substr($views->f[$data->vwFields['vwcomment']], 0, $conf['max_chars'] - 1) . $lang['strellipsis'];
+ }
if ($conf['show_comments']) echo "<td class=\"data{$id}\">", $misc->printVal($views->f[$data->vwFields['vwcomment']]), "</td>\n";
echo "</tr>\n";
$views->moveNext();