]> git.joonet.de Git - adminer.git/commitdiff
PostgreSQL: Show only accessible databases
authorjfonsato <j.fonsato@confinet.it>
Mon, 3 Mar 2025 14:03:25 +0000 (15:03 +0100)
committerJakub Vrana <jakub@vrana.cz>
Mon, 3 Mar 2025 14:34:43 +0000 (15:34 +0100)
adminer/drivers/pgsql.inc.php
changes.txt

index 0a54ee21f4856f4b61e363d16def643bc9e57e8b..7328a603a4d9a8e898a092192e0e507324266cb4 100644 (file)
@@ -291,9 +291,9 @@ if (isset($_GET["pgsql"])) {
        }
 
        function get_databases() {
-               return get_vals("SELECT d.datname FROM pg_database d JOIN pg_roles r ON d.datdba = r.oid
-WHERE d.datallowconn = TRUE AND has_database_privilege(d.datname, 'CONNECT') AND pg_has_role(r.rolname, 'USAGE')
-ORDER BY d.datname");
+               return get_vals("SELECT datname FROM pg_database
+WHERE datallowconn = TRUE AND has_database_privilege(datname, 'CONNECT')
+ORDER BY datname");
        }
 
        function limit($query, $where, $limit, $offset = 0, $separator = " ") {
index 92bfc160cb806fe300208711d540df64bf411b1d..e3c66f57b0ed7470ba626484e5f272f7de4fdf05 100644 (file)
@@ -5,6 +5,7 @@ PostgreSQL: Do not alter indexes with expressions
 PostgreSQL: Fix export of indexes with expressions (bug #768)
 PostgreSQL: Display ENUM types
 PostgreSQL: Export ENUM types (bug #587)
+PostgreSQL: Show accessible databases to non-owners (regression from 4.9.1)
 SQLite: Support CHECK constraint
 SQLite: Add command Check tables
 SQLite: Display all rows of variable values