Reputation: 6314
How can I create a postgres user who has admin access only to one database but cannot inspect or interfere with other databases in the postgres instance? The use case is I'm creating a multitenant application
EDIT: Added more constraints
Upvotes: 2
Views: 2799
Reputation: 246493
That's fairly trivial:
CREATE DATABASE newdb;
GRANT CREATE ON DATABASE newdb TO newdba;
Add pg_hba.conf
entries to allow newdba
to connect to newdb
only.
Upvotes: 4