Psql: allowed for the database "dbname" ("The user does not have the CONNECT privilege.") / "Unrecognized option of the" connect "role"

when I try to login to my database using psql by doing the following:

psql dbname --username=qgis --password >>(prompts for password, entered password) psql: FATAL: permission denied for database "gisdatabase" DETAIL: User does not have CONNECT privilege. 

I searched on Google for information about this simple problem, but did not find anyone directly talking about it.

I tried to do this:

 psql dbname >>ALTER ROLE qgis WITH CONNECT; 

But this error turned out:

 ERROR: unrecognized role option "connect" 

So, again, here, I asked another question about stackoverflow. Thank you for your time.

+6
source share
1 answer

You need to provide a privilege. Try the following:

 psql dbname >> GRANT CONNECT ON DATABASE dbname TO qgis; 

I assume that you will also need additional privileges. PostgreSQL has one of the best documentation pages of all DBMSs: http://www.postgresql.org/docs/9.0/static/sql-grant.html (you can choose the version of postgres that you use at the top of the page).

+6
source

Source: https://habr.com/ru/post/955694/


All Articles