pgadmin-org / pgadmin4

pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
https://www.pgadmin.org
Other
2.27k stars 611 forks source link

Unable to use pgAdmin with limited access (single database, no management database) #7571

Open macnewbold opened 2 weeks ago

macnewbold commented 2 weeks ago

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:

  1. 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.
  2. Try to connect
  3. 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

image

Desktop (please complete the following information):

akshay-joshi commented 1 week ago

For developers: Please check SELECT FROM pg_show_all_settings(); SELECT FROM pg_settings;

macnewbold commented 5 days ago

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.