leave out database sizes for databases the user cannot connect to
this prevents permissions errors.
This commit is contained in:
parent
fd5ad9bbf0
commit
5a70749308
2 changed files with 4 additions and 2 deletions
|
|
@ -157,6 +157,7 @@ QVariant DatabasesTableModel::getData(const QModelIndex &index) const
|
|||
v = db.description;
|
||||
break;
|
||||
case SizeCol:
|
||||
if (db.sizeBytes >= 0)
|
||||
v = db.sizeBytes;
|
||||
break;
|
||||
case AclCol:
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ std::string PgDatabaseContainer::getLoadQuery() const
|
|||
{
|
||||
return
|
||||
"SELECT pg_database.oid, datname, datdba, encoding, pg_encoding_to_char(encoding), datcollate,\n"
|
||||
" datctype, datistemplate, datallowconn, datconnlimit, dattablespace, pg_database_size(pg_database.oid),\n"
|
||||
" datctype, datistemplate, datallowconn, datconnlimit, dattablespace, \n"
|
||||
" case when has_database_privilege(current_role, oid, 'connect') then pg_database_size(oid) else -1 end,\n"
|
||||
" d.description, datacl\n"
|
||||
"FROM pg_database\n"
|
||||
" LEFT JOIN pg_catalog.pg_shdescription AS d ON (objoid=pg_database.oid)";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue