Re: Giving a user a database

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "Robert C(dot) Mosher II" <mosher(at)andrews(dot)edu>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Giving a user a database
Date: 2003-11-06 20:53:04
Message-ID: 200311061253.04619.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Boris Popov 2003-11-06 23:25:37 Help with "locking" please
Previous Message Robert C. Mosher II 2003-11-06 20:30:25 Giving a user a database