Unable to use pgAdmin with limited access (single database, no management database)
I have a PostgreSQL database in a shared hosting environment, where my access is limited only to a single database. I am able to get connected to the server when listing that single database as the management database, but it immediately gives permission denied for view pg_settings. This makes some sense, because I don't appear to have access to pg_settings, but at the same time, it means I cannot use pgadmin at all. Other tools like psql or DbVisualizer allow me to connect, run queries, and see the things I have access to, even though they can't show me a list of all the databases on the server for example, since I don't have access to that. Am I doing something wrong or missing something that would allow me to use pgadmin?
To Reproduce
Steps to reproduce the behavior:
- Set up a database connection in pgadmin using a username and password that only have access to a single database, and no access to the real PostgreSQL management database.
- Try to connect
- See the error
Expected behavior
I'd love to be able to connect with pgadmin, see the one database I can access, the tables in it, etc., and be able to run queries.
Error message
permission denied for view pg_settings
Screenshots
Desktop (please complete the following information):
- OS: Windows 10
- Version: 8.8
- Mode: Desktop
For developers: Please check SELECT * FROM pg_show_all_settings(); SELECT * FROM pg_settings;
For what it's worth, with the access I have to the server in question, I get an error for pg_settings:
SELECT * FROM pg_settings;
ERROR: permission denied for view pg_settings
And I get 263 lines of results from SELECT * FROM pg_show_all_settings(); so it seems likely that if the latter gives the necessary info, it would be more robust than what is currently being attempted.
Hi @macnewbold,
I tried to reproduce the issue but was unsuccessful. I followed up by creating a user and granting that user access to only one database.
Could you please share how you created the user and what permissions that user has?
The access is configured and managed by a hosting service we use, so I don't have access to it. The errors I get are related to the fact that I have no access to the management database at all, so when pgadmin tries to find pg_settings, it cannot. With your test configuration, what do you get for SELECT * FROM pg_settings; ?
Fixed and not reproducible, Verified on latest snapshot build. Mode :- Desktop OS - MacOS