Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created a role that many users can share:

> create role foo_read_only connection limit 5;

I have then assigned permissions to that role:

> grant select on table1 to foo_read_only;

Then I have assigned that role to people:

> grant foo_read_only to fred;
> grant foo_read_only to ginger;

Question: Do both fred and ginger get a connection limit of 5, or would that limit be shared between them?


share|improve this question

The CONNECTION LIMIT attribute only affects roles that are able to log in (that is "users", or those roles which have the LOGIN attribute set).

Roles that are a member of another role with a CONNECTION LIMIT do not inherit that limit, so in the situation you describe above fred and ginger would have the default connection limit of -1 (unlimited).

To limit fred and ginger you would need to specifically set a CONNECTION LIMIT on those roles.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.