Re: User Management, drop users - Mailing list pgsql-admin

From Tom Lane
Subject Re: User Management, drop users
Date
Msg-id 12933.1168805515@sss.pgh.pa.us
Whole thread Raw
In response to User Management, drop users  (Sven Sporer <s.sporer@gmx.net>)
List pgsql-admin
Sven Sporer <s.sporer@gmx.net> writes:
> 2) How do you restrict the users of a specific database to touch only
> the objects in their database?

They *are* so restricted.  Your problem is that roles are
installation-wide, not local to a particular database, and
so you cannot enforce the restriction you hope for: CREATEROLE
privilege is inherently to do with installation-wide actions.

A possible workaround is to ensure that every user owns at least
one object in "his" database -- table, function, whatever.  Then
it's not possible to drop the user without having first gotten
into that database.  (As of 8.1 or so --- this wasn't enforced
before that.)  However a user with CREATEROLE can still cause all
sorts of mischief with ALTER USER, so preventing only the DROP case
probably isn't that helpful.  Bottom line is you don't give out that
privilege to people you don't trust.

If you need better separation among groups of users, give them each
their own installation (postmaster).

            regards, tom lane

pgsql-admin by date:

Previous
From: Sven Sporer
Date:
Subject: User Management, drop users
Next
From: Adam Radłowski
Date:
Subject: Re: Pg_dump postgreSQL 8.1.3-1 and win2k