Score:0

Postgres Role required to grant CONNECT on a specific database

cn flag

I am trying to GRANT CONNECT on a DATABASE to a user as a schema owner in that database.

The schema owner is not a superuser.

Do I need to be the owner of a database to execute

GRANT CONNECT ON DATABASE DBXXX TO USER_YYY; ??

What role should a user be granted other than superuser to allow it to grant connect?

us flag
If you're using psql you can do `\h grant` to see the full syntax for grant.
cn flag
Yeah, the with grant option was not super clear to me in the docs but it made sense
Score:0
us flag

If you were given CONNECT WITH GRANT OPTION you can then grant connect to others.

If you were not given connect with grant option, you cannot grant it, you will need a superuser to grant you CONNECT GRANT OPTION, or to grant connect to the new user.

A superuser (or database owner) would use this command to grant grant option for connect:

GRANT CONNECT ON DATABASE database_name TO your_username WITH GRANT OPTION;

As a schema owner you can grant usage on your schema to others.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.