Skip to content

Commit

Permalink
Vacuum for PostgreSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
vrana committed Mar 1, 2012
1 parent a25fa67 commit 4cc29e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions adminer/db.inc.php
Expand Up @@ -26,8 +26,11 @@
$result = drop_tables($_POST["tables"]);
}
$message = lang('Tables have been dropped.');
} elseif ($jush == "sqlite") {
$result = queries("VACUUM");
} elseif ($jush != "sql") {
$result = ($jush == "sqlite"
? queries("VACUUM")
: apply_queries("VACUUM" . ($_POST["optimize"] ? "" : " ANALYZE"), $_POST["tables"])
);
$message = lang('Tables have been optimized.');
} elseif ($_POST["tables"] && ($result = queries(($_POST["optimize"] ? "OPTIMIZE" : ($_POST["check"] ? "CHECK" : ($_POST["repair"] ? "REPAIR" : "ANALYZE"))) . " TABLE " . implode(", ", array_map('idf_escape', $_POST["tables"]))))) {
while ($row = $result->fetch_assoc()) {
Expand Down Expand Up @@ -94,7 +97,7 @@
echo "</table>\n";
echo "<script type='text/javascript'>tableCheck();</script>\n";
if (!information_schema(DB)) {
echo "<p>" . (ereg('^(sql|sqlite)$', $jush)
echo "<p>" . (ereg('^(sql|sqlite|pgsql)$', $jush)
? ($jush != "sqlite" ? "<input type='submit' value='" . lang('Analyze') . "'> " : "")
. "<input type='submit' name='optimize' value='" . lang('Optimize') . "'> " : ""
) . ($jush == "sql" ? "<input type='submit' name='check' value='" . lang('Check') . "'> <input type='submit' name='repair' value='" . lang('Repair') . "'> " : "") . "<input type='submit' name='truncate' value='" . lang('Truncate') . "'" . confirm("formChecked(this, /tables/)") . "> <input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm("formChecked(this, /tables|views/)", 1) . ">\n"; // 1 - eventStop
Expand Down
2 changes: 1 addition & 1 deletion changes.txt
Expand Up @@ -11,7 +11,7 @@ Don't quote bit type in export
Ability to disable export (customization)
Extensible list of databases (customization)
MySQL: set autocommit after connect
SQLite: vacuum
SQLite, PostgreSQL: vacuum
PostgreSQL: fix alter foreign key
PostgreSQL, SQLite: don't use LIKE for numbers (bug #3420408)
PostgreSQL over PDO: connect if the eponymous database does not exist (bug #3391619)
Expand Down

0 comments on commit 4cc29e0

Please sign in to comment.