Re: Role Membership - Mailing list pgsql-general

From Carlos Mennens
Subject Re: Role Membership
Date
Msg-id AANLkTi==GN3EzeRopD4QrJyrooZiRXdk5jUgc=Ra+MQW@mail.gmail.com
Whole thread Raw
In response to Re: Role Membership  (Scott Marlowe <scott.marlowe@gmail.com>)
Responses Re: Role Membership
List pgsql-general
On Mon, Dec 20, 2010 at 1:32 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
> No user, no group, they're al roles.  Roles are both / either.

Ah now I understand. Thank you!

> You grant them that:
>
> grant rolename to username;
>
> Then you only ever have to grant / revoke a role to change
> permissions, no need to do a million grants all over the place on each
> table.  Just grant it once to the role, grant the role to the user,
> viola, you're done.

OK I now understand:

postgres=# \l
                                  List of databases
   Name    |   Owner   | Encoding |  Collation  |    Ctype    |
Access privileges
-----------+-----------+----------+-------------+-------------+-----------------------
 caldega   | cmennens  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 tiburon   | cmennens  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 ide       | cmennens  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 orlando   | jmadeline | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 postgres  | postgres  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 software  | mwilshaw  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 template0 | postgres  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
=c/postgres          +
           |           |          |             |             |
postgres=CTc/postgres
 template1 | postgres  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
=c/postgres          +
           |           |          |             |             |
postgres=CTc/postgres
(8 rows)

postgres=# ALTER DATABASE ide OWNER TO it;
ALTER DATABASE

postgres=# \l
                                  List of databases
   Name    |   Owner   | Encoding |  Collation  |    Ctype    |
Access privileges
-----------+-----------+----------+-------------+-------------+-----------------------
 caldega   | cmennens  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 tiburon   | cmennens  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 ide       | it        | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 orlando   | jmadeline | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 postgres  | postgres  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 software  | mwilshaw  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 template0 | postgres  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
=c/postgres          +
           |           |          |             |             |
postgres=CTc/postgres
 template1 | postgres  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
=c/postgres          +
           |           |          |             |             |
postgres=CTc/postgres

Thanks for helping me out!

-Carlos

pgsql-general by date:

Previous
From: Kenneth Buckler
Date:
Subject: PostgreSQL Trusted Startup
Next
From: Adrian Klaver
Date:
Subject: Re: Role Membership