Take the 2-minute tour ×
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. It's 100% free, no registration required.

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?

Thanks!

share|improve this question

1 Answer 1

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

 
discard

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.