summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJehan-Guillaume (ioguix) de Rorthais2010-02-06 12:23:55 +0000
committerJehan-Guillaume (ioguix) de Rorthais2010-02-06 12:23:55 +0000
commit6ec5a61290c1a18168dfbec4ff647a1ca3bd4fbb (patch)
tree56a15e45a18bd56265d653608bb89d3290b53d34
parentae0bac832fd101f0687c5edc20ce9bdc2e989191 (diff)
housecleaning: remove all useless hasXXX() functions since we drop support for pg < 7.3
-rw-r--r--aggregates.php5
-rw-r--r--classes/Misc.php8
-rwxr-xr-xclasses/database/Postgres.php42
-rw-r--r--colproperties.php2
-rw-r--r--constraints.php7
-rwxr-xr-xdatabase.php36
-rw-r--r--display.php2
-rw-r--r--domains.php10
-rw-r--r--fulltext.php10
-rw-r--r--functions.php9
-rw-r--r--indexes.php19
-rw-r--r--info.php343
-rw-r--r--operators.php5
-rw-r--r--rules.php5
-rwxr-xr-xschemas.php5
-rw-r--r--sequences.php5
-rw-r--r--sqledit.php6
-rw-r--r--tables.php13
-rw-r--r--tblproperties.php9
-rw-r--r--tests/selenium/src/10-table.php32
-rw-r--r--triggers.php7
-rw-r--r--types.php8
-rw-r--r--users.php6
-rwxr-xr-xviewproperties.php18
-rw-r--r--views.php5
25 files changed, 245 insertions, 372 deletions
diff --git a/aggregates.php b/aggregates.php
index e571915c..3f55f295 100644
--- a/aggregates.php
+++ b/aggregates.php
@@ -185,10 +185,7 @@
echo "<p>", sprintf($lang['strconfdropaggregate'], htmlspecialchars($_REQUEST['aggrname'])), "</p>\n";
echo "<form action=\"aggregates.php\" method=\"post\">\n";
- // Show cascade drop option if supportd
- if ($data->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<p><input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
echo "<input type=\"hidden\" name=\"aggrname\" value=\"", htmlspecialchars($_REQUEST['aggrname']), "\" />\n";
echo "<input type=\"hidden\" name=\"aggrtype\" value=\"", htmlspecialchars($_REQUEST['aggrtype']), "\" />\n";
diff --git a/classes/Misc.php b/classes/Misc.php
index a037db6c..59f9e4a1 100644
--- a/classes/Misc.php
+++ b/classes/Misc.php
@@ -621,7 +621,6 @@
'title' => $lang['strvariables'],
'url' => 'database.php',
'urlvars' => array('subject' => 'database', 'action' => 'variables'),
- 'hide' => (!$data->hasVariables()),
'help' => 'pg.variable',
'tree' => false,
'icon' => 'Variables',
@@ -630,7 +629,6 @@
'title' => $lang['strprocesses'],
'url' => 'database.php',
'urlvars' => array('subject' => 'database', 'action' => 'processes'),
- 'hide' => (!$data->hasProcesses()),
'help' => 'pg.process',
'tree' => false,
'icon' => 'Processes',
@@ -639,7 +637,6 @@
'title' => $lang['strlocks'],
'url' => 'database.php',
'urlvars' => array('subject' => 'database', 'action' => 'locks'),
- 'hide' => (!$data->hasLocksView()),
'help' => 'pg.locks',
'tree' => false,
'icon' => 'Key',
@@ -672,7 +669,7 @@
'title' => $lang['strcasts'],
'url' => 'casts.php',
'urlvars' => array('subject' => 'database'),
- 'hide' => ($hide_advanced || !$data->hasCasts()),
+ 'hide' => ($hide_advanced),
'help' => 'pg.cast',
'icon' => 'Casts',
),
@@ -737,7 +734,6 @@
'title' => $lang['strdomains'],
'url' => 'domains.php',
'urlvars' => array('subject' => 'schema'),
- 'hide' => (!$data->hasDomains()),
'help' => 'pg.domain',
'icon' => 'Domains',
),
@@ -777,7 +773,7 @@
'title' => $lang['strconversions'],
'url' => 'conversions.php',
'urlvars' => array('subject' => 'schema'),
- 'hide' => ($hide_advanced || !$data->hasConversions()),
+ 'hide' => $hide_advanced,
'help' => 'pg.conversion',
'icon' => 'Conversions',
),
diff --git a/classes/database/Postgres.php b/classes/database/Postgres.php
index fb524824..e16cb087 100755
--- a/classes/database/Postgres.php
+++ b/classes/database/Postgres.php
@@ -3229,9 +3229,9 @@ class Postgres extends ADODB_base {
}
// Predicate
- if ($this->hasPartialIndexes() && trim($where) != '') {
+ if (trim($where) != '') {
$sql .= " WHERE ({$where})";
- }
+ }
return $this->execute($sql);
}
@@ -5948,9 +5948,9 @@ class Postgres extends ADODB_base {
* @return All users
*/
function getUsers() {
- $sql = "SELECT usename, usesuper, usecreatedb, valuntil AS useexpires";
- if ($this->hasUserSessionDefaults()) $sql .= ", useconfig";
- $sql .= " FROM pg_user ORDER BY usename";
+ $sql = "SELECT usename, usesuper, usecreatedb, valuntil AS useexpires, useconfig
+ FROM pg_user
+ ORDER BY usename";
return $this->selectSet($sql);
}
@@ -5963,9 +5963,9 @@ class Postgres extends ADODB_base {
function getUser($username) {
$this->clean($username);
- $sql = "SELECT usename, usesuper, usecreatedb, valuntil AS useexpires";
- if ($this->hasUserSessionDefaults()) $sql .= ", useconfig";
- $sql .= " FROM pg_user WHERE usename='{$username}'";
+ $sql = "SELECT usename, usesuper, usecreatedb, valuntil AS useexpires, useconfig
+ FROM pg_user
+ WHERE usename='{$username}'";
return $this->selectSet($sql);
}
@@ -7601,10 +7601,7 @@ class Postgres extends ADODB_base {
else $orderby = '';
// Actually retrieve the rows, with offset and limit
- if ($this->hasFullSubqueries())
- $rs = $this->selectSet("SELECT * FROM ({$query}) AS sub {$orderby} LIMIT {$page_size} OFFSET " . ($page - 1) * $page_size);
- else
- $rs = $this->selectSet("{$query} LIMIT {$page_size} OFFSET " . ($page - 1) * $page_size);
+ $rs = $this->selectSet("SELECT * FROM ({$query}) AS sub {$orderby} LIMIT {$page_size} OFFSET " . ($page - 1) * $page_size);
$status = $this->endTransaction();
if ($status != 0) {
$this->rollbackTransaction();
@@ -7763,15 +7760,9 @@ class Postgres extends ADODB_base {
function hasAlterSchemaOwner() { return true; }
function hasAlterSequenceProps() { return true; }
function hasAlterSequenceSchema() { return true; }
- function hasAlterTableOwner() { return true; }
function hasAlterTableSchema() { return true; }
- function hasAlterTrigger() { return true; }
- function hasAnalyze() { return true; }
function hasAutovacuum() { return true; }
function hasAutovacuumSysTable() { return false; }
- function hasCasts() { return true; }
- function hasCompositeTypes() { return true; }
- function hasConversions() { return true; }
function hasCreateTableLike() { return true; }
function hasCreateTableLikeWithConstraints() { return true; }
function hasCreateTableLikeWithIndexes() { return true; }
@@ -7779,39 +7770,24 @@ class Postgres extends ADODB_base {
function hasDisableTriggers() { return true; }
function hasAlterDomains() { return true; }
function hasDomainConstraints() { return true; }
- function hasDomains() { return true; }
- function hasDropBehavior() { return true; }
- function hasDropColumn() { return true; }
function hasEnumTypes() { return true; }
function hasFTS() { return true; }
- function hasFullSubqueries() { return true; }
- function hasFullVacuum() { return true; }
- function hasFuncPrivs() { return true; }
function hasFunctionAlterOwner() { return true; }
function hasFunctionAlterSchema() { return true; }
function hasFunctionCosting() { return true; }
function hasFunctionGUC() { return true; }
function hasGrantOption() { return true; }
- function hasIsClustered() { return true; }
- function hasLocksView() { return true; }
function hasNamedParams() { return true; }
- function hasPartialIndexes() { return true; }
function hasPrepare() { return true; }
function hasPreparedXacts() { return true; }
- function hasProcesses() { return true; }
function hasReadOnlyQueries() { return true; }
function hasRecluster() { return true; }
function hasRoles() { return true; }
function hasServerAdminFuncs() { return true; }
function hasSharedComments() { return true; }
function hasQueryCancel() { return true; }
- function hasStatsCollector() { return true; }
function hasTablespaces() { return true; }
- function hasUserAndDbVariables() { return true; }
function hasUserRename() { return true; }
- function hasUserSessionDefaults() { return true; }
- function hasVariables() { return true; }
- function hasViewColumnRename() { return true; }
function hasVirtualTransactionId() { return true; }
function hasAlterDatabase() { return $this->hasAlterDatabaseRename(); }
function hasDatabaseCollation() { return true; }
diff --git a/colproperties.php b/colproperties.php
index dc582a0d..00ce9d12 100644
--- a/colproperties.php
+++ b/colproperties.php
@@ -243,8 +243,6 @@
echo "\t<li><a href=\"colproperties.php?action=properties&amp;{$misc->href}&amp;table=", urlencode($_REQUEST['table']),
"&amp;column=", urlencode($_REQUEST['column']) . "\">{$lang['stralter']}</a></li>\n";
- /* Delete link */
- if ($data->hasDropColumn())
echo "\t<li><a href=\"tblproperties.php?action=confirm_drop&amp;{$misc->href}&amp;table=", urlencode($_REQUEST['table']),
"&amp;column=" . urlencode($_REQUEST['column']) . "\">{$lang['strdrop']}</a></li>\n";
} else {
diff --git a/constraints.php b/constraints.php
index 99298c27..f966f48d 100644
--- a/constraints.php
+++ b/constraints.php
@@ -407,10 +407,7 @@
echo "<input type=\"hidden\" name=\"constraint\" value=\"", htmlspecialchars($_REQUEST['constraint']), "\" />\n";
echo "<input type=\"hidden\" name=\"type\" value=\"", htmlspecialchars($_REQUEST['type']), "\" />\n";
echo $misc->form;
- // Show cascade drop option if supportd
- if ($data->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" />\n";
echo "</form>\n";
@@ -473,8 +470,6 @@
),
);
- if (!$data->hasIsClustered()) unset($columns['clustered']);
-
$misc->printTable($constraints, $columns, $actions, $lang['strnoconstraints'], 'cnPre');
echo "<ul class=\"navlink\">\n\t<li><a href=\"constraints.php?action=add_check&amp;{$misc->href}&amp;table=", urlencode($_REQUEST['table']),
diff --git a/database.php b/database.php
index a22b98bb..71d2f0e2 100755
--- a/database.php
+++ b/database.php
@@ -59,15 +59,13 @@
echo "\t<option value=\"TRIGGER\"", ($_REQUEST['filter'] == 'TRIGGER') ? ' selected="selected"' : '', ">{$lang['strtriggers']}</option>\n";
echo "\t<option value=\"CONSTRAINT\"", ($_REQUEST['filter'] == 'CONSTRAINT') ? ' selected="selected"' : '', ">{$lang['strconstraints']}</option>\n";
echo "\t<option value=\"FUNCTION\"", ($_REQUEST['filter'] == 'FUNCTION') ? ' selected="selected"' : '', ">{$lang['strfunctions']}</option>\n";
- if ($data->hasDomains())
- echo "\t<option value=\"DOMAIN\"", ($_REQUEST['filter'] == 'DOMAIN') ? ' selected="selected"' : '', ">{$lang['strdomains']}</option>\n";
+ echo "\t<option value=\"DOMAIN\"", ($_REQUEST['filter'] == 'DOMAIN') ? ' selected="selected"' : '', ">{$lang['strdomains']}</option>\n";
if ($conf['show_advanced']) {
echo "\t<option value=\"AGGREGATE\"", ($_REQUEST['filter'] == 'AGGREGATE') ? ' selected="selected"' : '', ">{$lang['straggregates']}</option>\n";
echo "\t<option value=\"TYPE\"", ($_REQUEST['filter'] == 'TYPE') ? ' selected="selected"' : '', ">{$lang['strtypes']}</option>\n";
echo "\t<option value=\"OPERATOR\"", ($_REQUEST['filter'] == 'OPERATOR') ? ' selected="selected"' : '', ">{$lang['stroperators']}</option>\n";
echo "\t<option value=\"OPCLASS\"", ($_REQUEST['filter'] == 'OPCLASS') ? ' selected="selected"' : '', ">{$lang['stropclasses']}</option>\n";
- if ($data->hasConversions())
- echo "\t<option value=\"CONVERSION\"", ($_REQUEST['filter'] == 'CONVERSION') ? ' selected="selected"' : '', ">{$lang['strconversions']}</option>\n";
+ echo "\t<option value=\"CONVERSION\"", ($_REQUEST['filter'] == 'CONVERSION') ? ' selected="selected"' : '', ">{$lang['strconversions']}</option>\n";
echo "\t<option value=\"LANGUAGE\"", ($_REQUEST['filter'] == 'LANGUAGE') ? ' selected="selected"' : '', ">{$lang['strlanguages']}</option>\n";
}
echo "</select>\n";
@@ -561,11 +559,9 @@
echo "<th class=\"data\">";
$misc->printHelp($lang['strvacuum'],'pg.admin.vacuum')."</th>\n";
echo "</th>";
- if ($data->hasAnalyze()){
- echo "<th class=\"data\">";
- $misc->printHelp($lang['stranalyze'],'pg.admin.analyze');
- echo "</th>";
- }
+ echo "<th class=\"data\">";
+ $misc->printHelp($lang['stranalyze'],'pg.admin.analyze');
+ echo "</th>";
if ($data->hasRecluster()){
echo "<th class=\"data\">";
$misc->printHelp($lang['strclusterindex'],'pg.index.cluster');
@@ -581,10 +577,8 @@
echo "<td class=\"data1\" style=\"text-align: center; vertical-align: bottom\">\n";
echo "<form action=\"database.php\" method=\"post\">\n";
echo "<p><input type=\"checkbox\" id=\"vacuum_analyze\" name=\"vacuum_analyze\" /><label for=\"vacuum_analyze\">{$lang['stranalyze']}</label>\n";
- if ($data->hasFullVacuum()) {
- echo "<br /><input type=\"checkbox\" id=\"vacuum_full\" name=\"vacuum_full\" /><label for=\"vacuum_full\">{$lang['strfull']}</label>\n";
- echo "<br /><input type=\"checkbox\" id=\"vacuum_freeze\" name=\"vacuum_freeze\" /><label for=\"vacuum_freeze\">{$lang['strfreeze']}</label>\n";
- }
+ echo "<br /><input type=\"checkbox\" id=\"vacuum_full\" name=\"vacuum_full\" /><label for=\"vacuum_full\">{$lang['strfull']}</label>\n";
+ echo "<br /><input type=\"checkbox\" id=\"vacuum_freeze\" name=\"vacuum_freeze\" /><label for=\"vacuum_freeze\">{$lang['strfreeze']}</label>\n";
echo "<input type=\"hidden\" name=\"action\" value=\"vacuum\" />\n";
echo $misc->form;
echo "<br /><input type=\"submit\" value=\"{$lang['strvacuum']}\" /></p>\n";
@@ -592,15 +586,13 @@
echo "</td>\n";
// Analyze
- if ($data->hasAnalyze()) {
- echo "<td class=\"data1\" style=\"text-align: center; vertical-align: bottom\">\n";
- echo "<form action=\"database.php\" method=\"post\">\n";
- echo "<p><input type=\"hidden\" name=\"action\" value=\"analyze\" />\n";
- echo $misc->form;
- echo "<input type=\"submit\" value=\"{$lang['stranalyze']}\" /></p>\n";
- echo "</form>\n";
- echo "</td>\n";
- }
+ echo "<td class=\"data1\" style=\"text-align: center; vertical-align: bottom\">\n";
+ echo "<form action=\"database.php\" method=\"post\">\n";
+ echo "<p><input type=\"hidden\" name=\"action\" value=\"analyze\" />\n";
+ echo $misc->form;
+ echo "<input type=\"submit\" value=\"{$lang['stranalyze']}\" /></p>\n";
+ echo "</form>\n";
+ echo "</td>\n";
// Recluster
if ($data->hasRecluster()){
diff --git a/display.php b/display.php
index f38360ec..1b9f0b55 100644
--- a/display.php
+++ b/display.php
@@ -362,7 +362,7 @@
$finfo = $rs->fetchField($j);
// Display column headers with sorting options, unless we're PostgreSQL
// 7.0 and it's a non-TABLE mode
- if (!$data->hasFullSubqueries() && $type != 'TABLE') {
+ if ($type != 'TABLE') {
echo "<th class=\"data\">", $misc->printVal($finfo->name), "</th>\n";
}
else {
diff --git a/domains.php b/domains.php
index ab4c7132..197e410e 100644
--- a/domains.php
+++ b/domains.php
@@ -151,10 +151,7 @@
echo "<input type=\"hidden\" name=\"domain\" value=\"", htmlspecialchars($_REQUEST['domain']), "\" />\n";
echo "<input type=\"hidden\" name=\"constraint\" value=\"", htmlspecialchars($_REQUEST['constraint']), "\" />\n";
echo $misc->form;
- // Show cascade drop option if supportd
- if ($data->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" />\n";
echo "</form>\n";
@@ -254,10 +251,7 @@
echo "<p>", sprintf($lang['strconfdropdomain'], $misc->printVal($_REQUEST['domain'])), "</p>\n";
echo "<form action=\"domains.php\" method=\"post\">\n";
- // Show cascade drop option if supportd
- if ($data->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /><label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /><label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<p><input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
echo "<input type=\"hidden\" name=\"domain\" value=\"", htmlspecialchars($_REQUEST['domain']), "\" />\n";
echo $misc->form;
diff --git a/fulltext.php b/fulltext.php
index 46c63736..9098b827 100644
--- a/fulltext.php
+++ b/fulltext.php
@@ -75,10 +75,7 @@
echo "<p>", sprintf($lang['strconfdropftsconfig'], $misc->printVal($_REQUEST['ftscfg'])), "</p>\n";
echo "<form action=\"fulltext.php\" method=\"post\">\n";
- // Show cascade drop option if supported
- if ($data->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<p><input type=\"hidden\" name=\"action\" value=\"dropconfig\" />\n";
echo "<input type=\"hidden\" name=\"database\" value=\"", htmlspecialchars($_REQUEST['database']), "\" />\n";
echo "<input type=\"hidden\" name=\"ftscfg\" value=\"", htmlspecialchars($_REQUEST['ftscfg']), "\" />\n";
@@ -110,10 +107,7 @@
echo "<p>", sprintf($lang['strconfdropftsdict'], $misc->printVal($_REQUEST['ftsdict'])), "</p>\n";
echo "<form action=\"fulltext.php\" method=\"post\">\n";
- // Show cascade drop option if supported
- if ($data->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<p><input type=\"hidden\" name=\"action\" value=\"dropdict\" />\n";
echo "<input type=\"hidden\" name=\"database\" value=\"", htmlspecialchars($_REQUEST['database']), "\" />\n";
echo "<input type=\"hidden\" name=\"ftsdict\" value=\"", htmlspecialchars($_REQUEST['ftsdict']), "\" />\n";
diff --git a/functions.php b/functions.php
index acbb4da2..7a64c1fa 100644
--- a/functions.php
+++ b/functions.php
@@ -369,10 +369,7 @@
echo "<input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
echo $misc->form;
- // Show cascade drop option if supportd
- if ($data->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /><label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /><label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" />\n";
echo "</form>\n";
@@ -826,9 +823,7 @@
),
);
- if ( !$data->hasFuncPrivs() ) {
- unset($actions['privileges']);
- }
+ unset($actions['privileges']);
$misc->printTable($funcs, $columns, $actions, $lang['strnofunctions']);
diff --git a/indexes.php b/indexes.php
index a3756b2d..0d57d39e 100644
--- a/indexes.php
+++ b/indexes.php
@@ -135,13 +135,11 @@
echo "<th class=\"data left\" scope=\"row\"><label for=\"formUnique\">{$lang['strunique']}</label></th>";
echo "<td class=\"data1\"><input type=\"checkbox\" id=\"formUnique\" name=\"formUnique\"", (isset($_POST['formUnique']) ? 'checked="checked"' : ''), " /></td>";
echo "</tr>";
- if ($data->hasPartialIndexes()) {
- echo "<tr>";
- echo "<th class=\"data left\" scope=\"row\">{$lang['strwhere']}</th>";
- echo "<td class=\"data1\">(<input name=\"formWhere\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
- htmlspecialchars($_POST['formWhere']), "\" />)</td>";
- echo "</tr>";
- }
+ echo "<tr>";
+ echo "<th class=\"data left\" scope=\"row\">{$lang['strwhere']}</th>";
+ echo "<td class=\"data1\">(<input name=\"formWhere\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
+ htmlspecialchars($_POST['formWhere']), "\" />)</td>";
+ echo "</tr>";
// Tablespace (if there are any)
if ($data->hasTablespaces() && $tablespaces->recordCount() > 0) {
@@ -222,10 +220,7 @@
echo "<input type=\"hidden\" name=\"table\" value=\"", htmlspecialchars($_REQUEST['table']), "\" />\n";
echo "<input type=\"hidden\" name=\"index\" value=\"", htmlspecialchars($_REQUEST['index']), "\" />\n";
echo $misc->form;
- // Show cascade drop option if supportd
- if ($data->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" />\n";
echo "</form>\n";
@@ -314,8 +309,6 @@
),
);
- if (!$data->hasIsClustered()) unset($columns['clustered']);
-
$misc->printTable($indexes, $columns, $actions, $lang['strnoindexes'], 'indPre');
echo "<p><a class=\"navlink\" href=\"indexes.php?action=create_index&amp;{$misc->href}&amp;table=",
diff --git a/info.php b/info.php
index 98ae6d5a..f8beb7df 100644
--- a/info.php
+++ b/info.php
@@ -29,19 +29,16 @@
$referrers = $data->getReferrers($_REQUEST['table']);
$parents = $data->getTableParents($_REQUEST['table']);
$children = $data->getTableChildren($_REQUEST['table']);
- if ($data->hasStatsCollector()) {
- $tablestatstups = $data->getStatsTableTuples($_REQUEST['table']);
- $tablestatsio = $data->getStatsTableIO($_REQUEST['table']);
- $indexstatstups = $data->getStatsIndexTuples($_REQUEST['table']);
- $indexstatsio = $data->getStatsIndexIO($_REQUEST['table']);
- }
+ $tablestatstups = $data->getStatsTableTuples($_REQUEST['table']);
+ $tablestatsio = $data->getStatsTableIO($_REQUEST['table']);
+ $indexstatstups = $data->getStatsIndexTuples($_REQUEST['table']);
+ $indexstatsio = $data->getStatsIndexIO($_REQUEST['table']);
// Check that there is some info
if (($referrers === -99 || ($referrers !== -99 && $referrers->recordCount() == 0))
&& $parents->recordCount() == 0 && $children->recordCount() == 0
- && (!$data->hasStatsCollector() ||
- ($tablestatstups->recordCount() == 0 && $tablestatsio->recordCount() == 0
- && $indexstatstups->recordCount() == 0 && $indexstatsio->recordCount() == 0))) {
+ && ($tablestatstups->recordCount() == 0 && $tablestatsio->recordCount() == 0
+ && $indexstatstups->recordCount() == 0 && $indexstatsio->recordCount() == 0)) {
$misc->printMsg($lang['strnoinfo']);
}
else {
@@ -129,171 +126,169 @@
echo "</table>\n";
}
- if ($data->hasStatsCollector()) {
- // Row performance
- if ($tablestatstups->recordCount() > 0) {
- echo "<h3>{$lang['strrowperf']}</h3>\n";
-
- echo "<table>\n";
- echo "\t<tr>\n";
- echo "\t\t<th class=\"data\" colspan=\"2\">{$lang['strsequential']}</th>\n";
- echo "\t\t<th class=\"data\" colspan=\"2\">{$lang['strindex']}</th>\n";
- echo "\t\t<th class=\"data\" colspan=\"3\">{$lang['strrows2']}</th>\n";
- echo "\t</tr>\n";
- echo "\t<tr>\n";
- echo "\t\t<th class=\"data\">{$lang['strscan']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strread']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strscan']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strfetch']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strinsert']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strupdate']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strdelete']}</th>\n";
- echo "\t</tr>\n";
- $i = 0;
-
- while (!$tablestatstups->EOF) {
- $id = ( ($i % 2 ) == 0 ? '1' : '2' );
- echo "\t<tr>\n";
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatstups->fields['seq_scan'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatstups->fields['seq_tup_read'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatstups->fields['idx_scan'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatstups->fields['idx_tup_fetch'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatstups->fields['n_tup_ins'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatstups->fields['n_tup_upd'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatstups->fields['n_tup_del'], 'int4', $shownull), "</td>\n";
- echo "\t</tr>\n";
- $tablestatstups->movenext();
- $i++;
- }
-
- echo "</table>\n";
- }
-
- // I/O performance
- if ($tablestatsio->recordCount() > 0) {
- echo "<h3>{$lang['strioperf']}</h3>\n";
-
- echo "<table>\n";
- echo "\t<tr>\n";
- echo "\t\t<th class=\"data\" colspan=\"3\">{$lang['strheap']}</th>\n";
- echo "\t\t<th class=\"data\" colspan=\"3\">{$lang['strindex']}</th>\n";
- echo "\t\t<th class=\"data\" colspan=\"3\">{$lang['strtoast']}</th>\n";
- echo "\t\t<th class=\"data\" colspan=\"3\">{$lang['strtoastindex']}</th>\n";
- echo "\t</tr>\n";
- echo "\t<tr>\n";
- echo "\t\t<th class=\"data\">{$lang['strdisk']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strcache']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strpercent']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strdisk']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strcache']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strpercent']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strdisk']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strcache']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strpercent']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strdisk']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strcache']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strpercent']}</th>\n";
- echo "\t</tr>\n";
- $i = 0;
-
- while (!$tablestatsio->EOF) {
- $id = ( ($i % 2 ) == 0 ? '1' : '2' );
- echo "\t<tr>\n";
-
- $total = $tablestatsio->fields['heap_blks_hit'] + $tablestatsio->fields['heap_blks_read'];
- if ($total > 0) $percentage = round(($tablestatsio->fields['heap_blks_hit'] / $total) * 100);
- else $percentage = 0;
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatsio->fields['heap_blks_read'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatsio->fields['heap_blks_hit'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">({$percentage}{$lang['strpercent']})</td>\n";
-
- $total = $tablestatsio->fields['idx_blks_hit'] + $tablestatsio->fields['idx_blks_read'];
- if ($total > 0) $percentage = round(($tablestatsio->fields['idx_blks_hit'] / $total) * 100);
- else $percentage = 0;
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatsio->fields['idx_blks_read'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatsio->fields['idx_blks_hit'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">({$percentage}{$lang['strpercent']})</td>\n";
-
- $total = $tablestatsio->fields['toast_blks_hit'] + $tablestatsio->fields['toast_blks_read'];
- if ($total > 0) $percentage = round(($tablestatsio->fields['toast_blks_hit'] / $total) * 100);
- else $percentage = 0;
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatsio->fields['toast_blks_read'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatsio->fields['toast_blks_hit'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">({$percentage}{$lang['strpercent']})</td>\n";
-
- $total = $tablestatsio->fields['tidx_blks_hit'] + $tablestatsio->fields['tidx_blks_read'];
- if ($total > 0) $percentage = round(($tablestatsio->fields['tidx_blks_hit'] / $total) * 100);
- else $percentage = 0;
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatsio->fields['tidx_blks_read'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatsio->fields['tidx_blks_hit'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">({$percentage}{$lang['strpercent']})</td>\n";
- echo "\t</tr>\n";
- $tablestatsio->movenext();
- $i++;
- }
-
- echo "</table>\n";
- }
-
- // Index row performance
- if ($indexstatstups->recordCount() > 0) {
- echo "<h3>{$lang['stridxrowperf']}</h3>\n";
-
- echo "<table>\n";
- echo "\t<tr>\n";
- echo "\t\t<th class=\"data\">{$lang['strindex']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strscan']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strread']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strfetch']}</th>\n";
- echo "\t</tr>\n";
- $i = 0;
-
- while (!$indexstatstups->EOF) {
- $id = ( ($i % 2 ) == 0 ? '1' : '2' );
- echo "\t<tr>\n";
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($indexstatstups->fields['indexrelname']), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($indexstatstups->fields['idx_scan'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($indexstatstups->fields['idx_tup_read'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($indexstatstups->fields['idx_tup_fetch'], 'int4', $shownull), "</td>\n";
- echo "\t</tr>\n";
- $indexstatstups->movenext();
- $i++;
- }
-
- echo "</table>\n";
- }
-
- // Index I/0 performance
- if ($indexstatsio->recordCount() > 0) {
- echo "<h3>{$lang['stridxioperf']}</h3>\n";
-
- echo "<table>\n";
- echo "\t<tr>\n";
- echo "\t\t<th class=\"data\">{$lang['strindex']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strdisk']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strcache']}</th>\n";
- echo "\t\t<th class=\"data\">{$lang['strpercent']}</th>\n";
- echo "\t</tr>\n";
- $i = 0;
-
- while (!$indexstatsio->EOF) {
- $id = ( ($i % 2 ) == 0 ? '1' : '2' );
- echo "\t<tr>\n";
- $total = $indexstatsio->fields['idx_blks_hit'] + $indexstatsio->fields['idx_blks_read'];
- if ($total > 0) $percentage = round(($indexstatsio->fields['idx_blks_hit'] / $total) * 100);
- else $percentage = 0;
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($indexstatsio->fields['indexrelname']), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($indexstatsio->fields['idx_blks_read'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">", $misc->printVal($indexstatsio->fields['idx_blks_hit'], 'int4', $shownull), "</td>\n";
- echo "\t\t<td class=\"data{$id}\">({$percentage}{$lang['strpercent']})</td>\n";
- echo "\t</tr>\n";
- $indexstatsio->movenext();
- $i++;
- }
-
- echo "</table>\n";
- }
- }
+ // Row performance
+ if ($tablestatstups->recordCount() > 0) {
+ echo "<h3>{$lang['strrowperf']}</h3>\n";
+
+ echo "<table>\n";
+ echo "\t<tr>\n";
+ echo "\t\t<th class=\"data\" colspan=\"2\">{$lang['strsequential']}</th>\n";
+ echo "\t\t<th class=\"data\" colspan=\"2\">{$lang['strindex']}</th>\n";
+ echo "\t\t<th class=\"data\" colspan=\"3\">{$lang['strrows2']}</th>\n";
+ echo "\t</tr>\n";
+ echo "\t<tr>\n";
+ echo "\t\t<th class=\"data\">{$lang['strscan']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strread']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strscan']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strfetch']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strinsert']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strupdate']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strdelete']}</th>\n";
+ echo "\t</tr>\n";
+ $i = 0;
+
+ while (!$tablestatstups->EOF) {
+ $id = ( ($i % 2 ) == 0 ? '1' : '2' );
+ echo "\t<tr>\n";
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatstups->fields['seq_scan'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatstups->fields['seq_tup_read'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatstups->fields['idx_scan'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatstups->fields['idx_tup_fetch'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatstups->fields['n_tup_ins'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatstups->fields['n_tup_upd'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatstups->fields['n_tup_del'], 'int4', $shownull), "</td>\n";
+ echo "\t</tr>\n";
+ $tablestatstups->movenext();
+ $i++;
+ }
+
+ echo "</table>\n";
+ }
+
+ // I/O performance
+ if ($tablestatsio->recordCount() > 0) {
+ echo "<h3>{$lang['strioperf']}</h3>\n";
+
+ echo "<table>\n";
+ echo "\t<tr>\n";
+ echo "\t\t<th class=\"data\" colspan=\"3\">{$lang['strheap']}</th>\n";
+ echo "\t\t<th class=\"data\" colspan=\"3\">{$lang['strindex']}</th>\n";
+ echo "\t\t<th class=\"data\" colspan=\"3\">{$lang['strtoast']}</th>\n";
+ echo "\t\t<th class=\"data\" colspan=\"3\">{$lang['strtoastindex']}</th>\n";
+ echo "\t</tr>\n";
+ echo "\t<tr>\n";
+ echo "\t\t<th class=\"data\">{$lang['strdisk']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strcache']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strpercent']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strdisk']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strcache']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strpercent']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strdisk']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strcache']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strpercent']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strdisk']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strcache']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strpercent']}</th>\n";
+ echo "\t</tr>\n";
+ $i = 0;
+
+ while (!$tablestatsio->EOF) {
+ $id = ( ($i % 2 ) == 0 ? '1' : '2' );
+ echo "\t<tr>\n";
+
+ $total = $tablestatsio->fields['heap_blks_hit'] + $tablestatsio->fields['heap_blks_read'];
+ if ($total > 0) $percentage = round(($tablestatsio->fields['heap_blks_hit'] / $total) * 100);
+ else $percentage = 0;
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatsio->fields['heap_blks_read'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatsio->fields['heap_blks_hit'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">({$percentage}{$lang['strpercent']})</td>\n";
+
+ $total = $tablestatsio->fields['idx_blks_hit'] + $tablestatsio->fields['idx_blks_read'];
+ if ($total > 0) $percentage = round(($tablestatsio->fields['idx_blks_hit'] / $total) * 100);
+ else $percentage = 0;
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatsio->fields['idx_blks_read'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatsio->fields['idx_blks_hit'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">({$percentage}{$lang['strpercent']})</td>\n";
+
+ $total = $tablestatsio->fields['toast_blks_hit'] + $tablestatsio->fields['toast_blks_read'];
+ if ($total > 0) $percentage = round(($tablestatsio->fields['toast_blks_hit'] / $total) * 100);
+ else $percentage = 0;
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatsio->fields['toast_blks_read'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatsio->fields['toast_blks_hit'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">({$percentage}{$lang['strpercent']})</td>\n";
+
+ $total = $tablestatsio->fields['tidx_blks_hit'] + $tablestatsio->fields['tidx_blks_read'];
+ if ($total > 0) $percentage = round(($tablestatsio->fields['tidx_blks_hit'] / $total) * 100);
+ else $percentage = 0;
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatsio->fields['tidx_blks_read'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($tablestatsio->fields['tidx_blks_hit'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">({$percentage}{$lang['strpercent']})</td>\n";
+ echo "\t</tr>\n";
+ $tablestatsio->movenext();
+ $i++;
+ }
+
+ echo "</table>\n";
+ }
+
+ // Index row performance
+ if ($indexstatstups->recordCount() > 0) {
+ echo "<h3>{$lang['stridxrowperf']}</h3>\n";
+
+ echo "<table>\n";
+ echo "\t<tr>\n";
+ echo "\t\t<th class=\"data\">{$lang['strindex']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strscan']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strread']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strfetch']}</th>\n";
+ echo "\t</tr>\n";
+ $i = 0;
+
+ while (!$indexstatstups->EOF) {
+ $id = ( ($i % 2 ) == 0 ? '1' : '2' );
+ echo "\t<tr>\n";
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($indexstatstups->fields['indexrelname']), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($indexstatstups->fields['idx_scan'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($indexstatstups->fields['idx_tup_read'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($indexstatstups->fields['idx_tup_fetch'], 'int4', $shownull), "</td>\n";
+ echo "\t</tr>\n";
+ $indexstatstups->movenext();
+ $i++;
+ }
+
+ echo "</table>\n";
+ }
+
+ // Index I/0 performance
+ if ($indexstatsio->recordCount() > 0) {
+ echo "<h3>{$lang['stridxioperf']}</h3>\n";
+
+ echo "<table>\n";
+ echo "\t<tr>\n";
+ echo "\t\t<th class=\"data\">{$lang['strindex']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strdisk']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strcache']}</th>\n";
+ echo "\t\t<th class=\"data\">{$lang['strpercent']}</th>\n";
+ echo "\t</tr>\n";
+ $i = 0;
+
+ while (!$indexstatsio->EOF) {
+ $id = ( ($i % 2 ) == 0 ? '1' : '2' );
+ echo "\t<tr>\n";
+ $total = $indexstatsio->fields['idx_blks_hit'] + $indexstatsio->fields['idx_blks_read'];
+ if ($total > 0) $percentage = round(($indexstatsio->fields['idx_blks_hit'] / $total) * 100);
+ else $percentage = 0;
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($indexstatsio->fields['indexrelname']), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($indexstatsio->fields['idx_blks_read'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">", $misc->printVal($indexstatsio->fields['idx_blks_hit'], 'int4', $shownull), "</td>\n";
+ echo "\t\t<td class=\"data{$id}\">({$percentage}{$lang['strpercent']})</td>\n";
+ echo "\t</tr>\n";
+ $indexstatsio->movenext();
+ $i++;
+ }
+
+ echo "</table>\n";
+ }
}
}
diff --git a/operators.php b/operators.php
index 0426b782..555ba0ac 100644
--- a/operators.php
+++ b/operators.php
@@ -76,10 +76,7 @@
echo "<p>", sprintf($lang['strconfdropoperator'], $misc->printVal($_REQUEST['operator'])), "</p>\n";
echo "<form action=\"operators.php\" method=\"post\">\n";
- // Show cascade drop option if supportd
- if ($data->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<p><input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
echo "<input type=\"hidden\" name=\"operator\" value=\"", htmlspecialchars($_REQUEST['operator']), "\" />\n";
echo "<input type=\"hidden\" name=\"operator_oid\" value=\"", htmlspecialchars($_REQUEST['operator_oid']), "\" />\n";
diff --git a/rules.php b/rules.php
index cd0b15bd..871dd199 100644
--- a/rules.php
+++ b/rules.php
@@ -102,10 +102,7 @@
"\" value=\"", htmlspecialchars($_REQUEST[$_REQUEST['reltype']]), "\" />\n";
echo "<input type=\"hidden\" name=\"rule\" value=\"", htmlspecialchars($_REQUEST['rule']), "\" />\n";
echo $misc->form;
- // Show cascade drop option if supportd
- if ($data->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<input type=\"submit\" name=\"yes\" value=\"{$lang['stryes']}\" />\n";
echo "<input type=\"submit\" name=\"no\" value=\"{$lang['strno']}\" />\n";
echo "</form>\n";
diff --git a/schemas.php b/schemas.php
index 9a22f52a..bd2cdfe7 100755
--- a/schemas.php
+++ b/schemas.php
@@ -251,10 +251,7 @@
echo "<input type=\"hidden\" name=\"nsp\" value=\"", htmlspecialchars($_REQUEST['nsp']), "\" />\n";
}
- // Show cascade drop option if supportd
- if ($data->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<p><input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
echo "<input type=\"hidden\" name=\"database\" value=\"", htmlspecialchars($_REQUEST['database']), "\" />\n";
echo $misc->form;
diff --git a/sequences.php b/sequences.php
index 2333878f..75ee4c48 100644
--- a/sequences.php
+++ b/sequences.php
@@ -189,10 +189,7 @@
echo "<input type=\"hidden\" name=\"sequence\" value=\"", htmlspecialchars($_REQUEST['sequence']), "\" />\n";
}
- // Show cascade drop option if supportd
- if ($data->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<p><input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
echo $misc->form;
echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
diff --git a/sqledit.php b/sqledit.php
index 10abcc1d..5beb2437 100644
--- a/sqledit.php
+++ b/sqledit.php
@@ -69,15 +69,13 @@
echo "\t<option value=\"TRIGGER\"", ($_REQUEST['filter'] == 'TRIGGER') ? ' selected="selected"' : '', ">{$lang['strtriggers']}</option>\n";
echo "\t<option value=\"CONSTRAINT\"", ($_REQUEST['filter'] == 'CONSTRAINT') ? ' selected="selected"' : '', ">{$lang['strconstraints']}</option>\n";
echo "\t<option value=\"FUNCTION\"", ($_REQUEST['filter'] == 'FUNCTION') ? ' selected="selected"' : '', ">{$lang['strfunctions']}</option>\n";
- if ($data->hasDomains())
- echo "\t<option value=\"DOMAIN\"", ($_REQUEST['filter'] == 'DOMAIN') ? ' selected="selected"' : '', ">{$lang['strdomains']}</option>\n";
+ echo "\t<option value=\"DOMAIN\"", ($_REQUEST['filter'] == 'DOMAIN') ? ' selected="selected"' : '', ">{$lang['strdomains']}</option>\n";
if ($conf['show_advanced']) {
echo "\t<option value=\"AGGREGATE\"", ($_REQUEST['filter'] == 'AGGREGATE') ? ' selected="selected"' : '', ">{$lang['straggregates']}</option>\n";
echo "\t<option value=\"TYPE\"", ($_REQUEST['filter'] == 'TYPE') ? ' selected="selected"' : '', ">{$lang['strtypes']}</option>\n";
echo "\t<option value=\"OPERATOR\"", ($_REQUEST['filter'] == 'OPERATOR') ? ' selected="selected"' : '', ">{$lang['stroperators']}</option>\n";
echo "\t<option value=\"OPCLASS\"", ($_REQUEST['filter'] == 'OPCLASS') ? ' selected="selected"' : '', ">{$lang['stropclasses']}</option>\n";
- if ($data->hasConversions())
- echo "\t<option value=\"CONVERSION\"", ($_REQUEST['filter'] == 'CONVERSION') ? ' selected="selected"' : '', ">{$lang['strconversions']}</option>\n";
+ echo "\t<option value=\"CONVERSION\"", ($_REQUEST['filter'] == 'CONVERSION') ? ' selected="selected"' : '', ">{$lang['strconversions']}</option>\n";
echo "\t<option value=\"LANGUAGE\"", ($_REQUEST['filter'] == 'LANGUAGE') ? ' selected="selected"' : '', ">{$lang['strlanguages']}</option>\n";
}
echo "</select>\n";
diff --git a/tables.php b/tables.php
index d91fd6bf..af01e52a 100644
--- a/tables.php
+++ b/tables.php
@@ -749,10 +749,7 @@
echo "<input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
echo $misc->form;
- // Show cascade drop option if supportd
- if ($data->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" />\n";
echo "</form>\n";
@@ -827,11 +824,8 @@
}
echo "<input type=\"hidden\" name=\"action\" value=\"vacuum\" />\n";
echo $misc->form;
- // Show vacuum full option if supportd
- if ($data->hasFullVacuum()) {
- echo "<p><input type=\"checkbox\" id=\"vacuum_full\" name=\"vacuum_full\" /> <label for=\"vacuum_full\">{$lang['strfull']}</label></p>\n";
- echo "<p><input type=\"checkbox\" id=\"vacuum_analyze\" name=\"vacuum_analyze\" /> <label for=\"vacuum_analyze\">{$lang['stranalyze']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"vacuum_full\" name=\"vacuum_full\" /> <label for=\"vacuum_full\">{$lang['strfull']}</label></p>\n";
+ echo "<p><input type=\"checkbox\" id=\"vacuum_analyze\" name=\"vacuum_analyze\" /> <label for=\"vacuum_analyze\">{$lang['stranalyze']}</label></p>\n";
echo "<input type=\"submit\" name=\"vacuum\" value=\"{$lang['strvacuum']}\" />\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" />\n";
echo "</form>\n";
@@ -1027,7 +1021,6 @@
),
);
- if (!$data->hasAnalyze()) unset($actions['analyze'], $multiactions['actions']['analyze']);
if (!$data->hasTablespaces()) unset($columns['tablespace']);
$misc->printTable($tables, $columns, $actions, $lang['strnotables']);
diff --git a/tblproperties.php b/tblproperties.php
index c08b76d8..a2e9bb8c 100644
--- a/tblproperties.php
+++ b/tblproperties.php
@@ -79,7 +79,7 @@
htmlspecialchars($_POST['name'], ENT_QUOTES), "\" /></td></tr>\n";
$server_info = $misc->getServerInfo();
- if ($data->hasAlterTableOwner() && $data->isSuperUser($server_info['username'])) {
+ if ($data->isSuperUser($server_info['username'])) {
echo "<tr><th class=\"data left required\">{$lang['strowner']}</th>\n";
echo "<td class=\"data1\"><select name=\"owner\">";
while (!$users->EOF) {
@@ -376,10 +376,7 @@
echo "<input type=\"hidden\" name=\"table\" value=\"", htmlspecialchars($_REQUEST['table']), "\" />\n";
echo "<input type=\"hidden\" name=\"column\" value=\"", htmlspecialchars($_REQUEST['column']), "\" />\n";
echo $misc->form;
- // Show cascade drop option if supportd
- if ($data->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\"> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\"> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" />\n";
echo "</form>\n";
@@ -563,8 +560,6 @@
),
);
- if (!$data->hasDropColumn()) unset($actions['drop']);
-
$misc->printTable($attrs, $columns, $actions, null, 'attPre');
echo "<ul class=\"navlink\">\n";
diff --git a/tests/selenium/src/10-table.php b/tests/selenium/src/10-table.php
index 7396bb88..37675bdb 100644
--- a/tests/selenium/src/10-table.php
+++ b/tests/selenium/src/10-table.php
@@ -135,20 +135,18 @@
$t->assertText("//p[@class='comment']", 'altered comment');
/*table owner*/
- if ($data->hasAlterTableOwner()) {
- $t->addComment('4.3. alter table owner');
- $t->clickAndWait("//div[@class='trail']/descendant::a[@title='{$lang['strdatabase']}']/span[@class='label' and text()='{$testdb}']");
- $t->clickAndWait("link={$lang['strschemas']}");
- $t->clickAndWait("link=test_schema");
- $t->clickAndWait("link={$lang['strtables']}");
- $t->clickAndWait("//tr/td/a[text()='test_renamed']/../../td/a[text()='{$lang['stralter']}']"); /*alter using the link in the table list page*/
- $t->select('owner', "label={$user}");
- $t->clickAndWait('alter');
- $t->assertText("//p[@class='message']", $lang['strtablealtered']);
- $t->clickAndWait("//div[@class='trail']/descendant::a[@title='{$lang['strschema']}']/span[@class='label' and text()='test_schema']");
- $t->clickAndWait("link={$lang['strtables']}");
- $t->assertText("//tr/td[2]/a[text()='test_renamed']/../../td[3]", $user);
- }
+ $t->addComment('4.3. alter table owner');
+ $t->clickAndWait("//div[@class='trail']/descendant::a[@title='{$lang['strdatabase']}']/span[@class='label' and text()='{$testdb}']");
+ $t->clickAndWait("link={$lang['strschemas']}");
+ $t->clickAndWait("link=test_schema");
+ $t->clickAndWait("link={$lang['strtables']}");
+ $t->clickAndWait("//tr/td/a[text()='test_renamed']/../../td/a[text()='{$lang['stralter']}']"); /*alter using the link in the table list page*/
+ $t->select('owner', "label={$user}");
+ $t->clickAndWait('alter');
+ $t->assertText("//p[@class='message']", $lang['strtablealtered']);
+ $t->clickAndWait("//div[@class='trail']/descendant::a[@title='{$lang['strschema']}']/span[@class='label' and text()='test_schema']");
+ $t->clickAndWait("link={$lang['strtables']}");
+ $t->assertText("//tr/td[2]/a[text()='test_renamed']/../../td[3]", $user);
/*alter schema*/
if ($data->hasAlterTableSchema()) {
@@ -181,8 +179,7 @@
$t->type('comment', 'normal comment');
if ($data->hasAlterTableSchema())
$t->select('newschema', 'label=test_schema');
- if ($data->hasAlterTableOwner())
- $t->select('owner', "label={$admin_user}");
+ $t->select('owner', "label={$admin_user}");
$t->clickAndWait('alter');
$t->assertText("//p[@class='message']", $lang['strtablealtered']);
$t->assertText("//div[@class='trail']/descendant::a[@title='{$lang['strtable']}']/span[@class='label']", 'test');
@@ -190,8 +187,7 @@
$t->assertText("//div[@class='trail']/descendant::a[@title='{$lang['strschema']}']/span[@class='label']", 'test_schema');
$t->clickAndWait("//div[@class='trail']/descendant::a[@title='{$lang['strschema']}']/span[@class='label' and text()='test_schema']");
$t->clickAndWait("link={$lang['strtables']}");
- if ($data->hasAlterTableOwner())
- $t->assertText("//tr/td[2]/a[text()='test']/../../td[3]", $admin_user);
+ $t->assertText("//tr/td[2]/a[text()='test']/../../td[3]", $admin_user);
$t->logout();
$t->writeTests("{$test_static_dir}/{$server['desc']}/table.html", $testsuite_file);
diff --git a/triggers.php b/triggers.php
index d597b63d..9aa8c87c 100644
--- a/triggers.php
+++ b/triggers.php
@@ -79,10 +79,7 @@
echo "<input type=\"hidden\" name=\"table\" value=\"", htmlspecialchars($_REQUEST['table']), "\" />\n";
echo "<input type=\"hidden\" name=\"trigger\" value=\"", htmlspecialchars($_REQUEST['trigger']), "\" />\n";
echo $misc->form;
- // Show cascade drop option if supportd
- if ($data->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<input type=\"submit\" name=\"yes\" value=\"{$lang['stryes']}\" />\n";
echo "<input type=\"submit\" name=\"no\" value=\"{$lang['strno']}\" />\n";
echo "</form>\n";
@@ -330,8 +327,6 @@
}
}
- if (!$data->hasAlterTrigger()) unset($actions['alter']);
-
$misc->printTable($triggers, $columns, $actions, $lang['strnotriggers'], 'tgPre');
echo "<p><a class=\"navlink\" href=\"triggers.php?action=create&amp;{$misc->href}&amp;table=", urlencode($_REQUEST['table']), "\">{$lang['strcreatetrigger']}</a></p>\n";
diff --git a/types.php b/types.php
index 7357b256..6b28e6f2 100644
--- a/types.php
+++ b/types.php
@@ -104,10 +104,7 @@
echo "<p>", sprintf($lang['strconfdroptype'], $misc->printVal($_REQUEST['type'])), "</p>\n";
echo "<form action=\"types.php\" method=\"post\">\n";
- // Show cascade drop option if supportd
- if ($data->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<p><input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
echo "<input type=\"hidden\" name=\"type\" value=\"", htmlspecialchars($_REQUEST['type']), "\" />\n";
echo $misc->form;
@@ -579,8 +576,7 @@
$misc->printTable($types, $columns, $actions, $lang['strnotypes']);
echo "<ul class=\"navlink\">\n\t<li><a href=\"types.php?action=create&amp;{$misc->href}\">{$lang['strcreatetype']}</a></li>\n";
- if ($data->hasCompositeTypes())
- echo "\t<li><a href=\"types.php?action=create_comp&amp;{$misc->href}\">{$lang['strcreatecomptype']}</a></li>\n";
+ echo "\t<li><a href=\"types.php?action=create_comp&amp;{$misc->href}\">{$lang['strcreatecomptype']}</a></li>\n";
if ($data->hasEnumTypes())
echo "\t<li><a href=\"types.php?action=create_enum&amp;{$misc->href}\">{$lang['strcreateenumtype']}</a></li>\n";
echo "</ul>\n";
diff --git a/users.php b/users.php
index 378165b7..1a0c20d3 100644
--- a/users.php
+++ b/users.php
@@ -36,13 +36,13 @@
$userdata->fields['usecreatedb'] = $data->phpBool($userdata->fields['usecreatedb']);
echo "<table>\n";
echo "<tr><th class=\"data\">{$lang['strusername']}</th><th class=\"data\">{$lang['strsuper']}</th><th class=\"data\">{$lang['strcreatedb']}</th><th class=\"data\">{$lang['strexpires']}</th>";
- if ($data->hasUserSessionDefaults()) echo "<th class=\"data\">{$lang['strsessiondefaults']}</th>";
+ echo "<th class=\"data\">{$lang['strsessiondefaults']}</th>";
echo "</tr>\n";
echo "<tr>\n\t<td class=\"data1\">", $misc->printVal($userdata->fields['usename']), "</td>\n";
echo "\t<td class=\"data1\">", $misc->printVal($userdata->fields['usesuper'], 'yesno'), "</td>\n";
echo "\t<td class=\"data1\">", $misc->printVal($userdata->fields['usecreatedb'], 'yesno'), "</td>\n";
echo "\t<td class=\"data1\">", ($userdata->fields['useexpires'] == 'infinity' || is_null($userdata->fields['useexpires']) ? $lang['strnever'] : $misc->printVal($userdata->fields['useexpires'])), "</td>\n";
- if ($data->hasUserSessionDefaults()) echo "\t<td class=\"data1\">", $misc->printVal($userdata->fields['useconfig']), "</td>\n";
+ echo "\t<td class=\"data1\">", $misc->printVal($userdata->fields['useconfig']), "</td>\n";
echo "</tr>\n</table>\n";
}
else echo "<p>{$lang['strnodata']}</p>\n";
@@ -328,8 +328,6 @@
),
);
- if (!$data->hasUserSessionDefaults()) unset($columns['defaults']);
-
$misc->printTable($users, $columns, $actions, $lang['strnousers']);
echo "<p><a class=\"navlink\" href=\"users.php?action=create&amp;{$misc->href}\">{$lang['strcreateuser']}</a></p>\n";
diff --git a/viewproperties.php b/viewproperties.php
index d0c8f148..c52110c7 100755
--- a/viewproperties.php
+++ b/viewproperties.php
@@ -186,14 +186,9 @@
$_REQUEST['comment'] = $column->fields['comment'];
}
- // If name of view column is editable, make it a field
- if ($data->hasViewColumnRename()) {
- echo "<tr><td><input name=\"field\" size=\"32\" value=\"",
- htmlspecialchars($_REQUEST['field']), "\" /></td>";
- }
- else {
- echo "<tr><td>", htmlspecialchars($column->fields['attname']), "</td>";
- }
+ echo "<tr><td><input name=\"field\" size=\"32\" value=\"",
+ htmlspecialchars($_REQUEST['field']), "\" /></td>";
+
echo "<td>", $misc->printVal($data->formatType($column->fields['type'], $column->fields['atttypmod'])), "</td>";
echo "<td><input name=\"default\" size=\"20\" value=\"",
htmlspecialchars($_REQUEST['default']), "\" /></td>";
@@ -216,15 +211,12 @@
global $data, $lang;
// Check inputs
- if ($data->hasViewColumnRename() && trim($_REQUEST['field']) == '') {
+ if (trim($_REQUEST['field']) == '') {
$_REQUEST['stage'] = 1;
doProperties($lang['strcolneedsname']);
return;
}
- // If we aren't able to rename view columns, set new name to equal old name always
- if (!$data->hasViewColumnRename()) $_REQUEST['field'] = $_REQUEST['column'];
-
// Alter the view column
$status = $data->alterColumn($_REQUEST['view'], $_REQUEST['column'], $_REQUEST['field'],
false, false, $_REQUEST['default'], $_REQUEST['olddefault'],
@@ -267,7 +259,7 @@
htmlspecialchars($_POST['name']), "\" /></td></tr>\n";
$server_info = $misc->getServerInfo();
- if ($data->hasAlterTableOwner() && $data->isSuperUser($server_info['username'])) {
+ if ($data->isSuperUser($server_info['username'])) {
// Fetch all users
$users = $data->getUsers();
diff --git a/views.php b/views.php
index 056b8fc6..60d559d7 100644
--- a/views.php
+++ b/views.php
@@ -156,10 +156,7 @@
echo "<input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
echo $misc->form;
- // Show cascade drop option if supportd
- if ($data->hasDropBehavior()) {
- echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
- }
+ echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" />\n";
echo "</form>\n";