1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-11 09:04:02 +02:00

PostgreSQL: Adjusted detection of materialized views support

This commit is contained in:
Rossler Jan
2014-05-11 12:20:08 +02:00
committed by Jakub Vrana
parent 933f041f4d
commit 7a370e7885
3 changed files with 10 additions and 4 deletions

View File

@@ -225,12 +225,16 @@ if (isset($_GET["pgsql"])) {
}
function tables_list() {
return get_key_vals("SELECT table_name, table_type FROM information_schema.tables WHERE table_schema = current_schema()
$query = "SELECT table_name, table_type FROM information_schema.tables WHERE table_schema = current_schema()";
if (support('materializedview')) {
$query .= "
UNION ALL
SELECT matviewname, 'MATERIALIZED VIEW'
FROM pg_matviews
WHERE schemaname = current_schema()
ORDER BY table_name");
ORDER BY table_name";
}
return get_key_vals($query);
}
function count_tables($databases) {
@@ -619,7 +623,8 @@ AND typelem = 0"
}
function support($feature) {
return preg_match('~^(database|table|columns|sql|indexes|comment|view|materializedview|scheme|processlist|sequence|trigger|type|variables|drop_col)$~', $feature); //! routine|
global $connection;
return preg_match('~^(database|table|columns|sql|indexes|comment|view|' . ($connection->server_info >= 9.3 ? 'materializedview|' : '') . 'scheme|processlist|sequence|trigger|type|variables|drop_col)$~', $feature); //! routine|
}
$jush = "pgsql";