Re: Giving a user a database - Mailing list pgsql-novice

From Josh Berkus
Subject Re: Giving a user a database
Date
Msg-id 200311061253.04619.josh@agliodbs.com
Whole thread Raw
In response to Giving a user a database  ("Robert C. Mosher II" <mosher@andrews.edu>)
List pgsql-novice
Robert,

> I need to give a user a single database that they will have full control
> over. I am assuming this means giving them ownership of the database,
> but I have no idea how to do that, even after looking through the manual
> and the mailing list archive. How do I give a user ownership of a
> database? Or if there's a better way of granting them full access
> (creating and editing tables, etc.) what is it, and how do I do it?

CREATE USER joe WITH PASSWORD 'jehosaphat' CREATEDB;
\c - joe
CREATE DATABASE joes_db;
\c - postgres
ALTER USER joe WITH NOCREATEDB;

then edit pg_hba.conf to have a line where joe can only connect to joes_db.

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco


pgsql-novice by date:

Previous
From: "Robert C. Mosher II"
Date:
Subject: Giving a user a database
Next
From: Boris Popov
Date:
Subject: Help with "locking" please