From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Alexander James Spence [axs] <axs@aber.ac.uk>
To: 'pgsql-admin@postgresql.org' <pgsql-admin@postgresql.org>
Subject: Re: Privileges question
Date: Tue, 18 Oct 2011 11:27:06 -0500
Message-ID: <4E9D628A0200002500042183@gw.wicourts.gov> (raw)
In-Reply-To: <8EDB6E83019BEC4B9153122CFB928AF001F6463C4B5D@MAILBOX.staff.aber.ac.uk>
References: <8EDB6E83019BEC4B9153122CFB928AF001F6463C4B5D@MAILBOX.staff.aber.ac.uk>
"Alexander James Spence [axs]" <axs@aber.ac.uk> wrote:
> will have to create around 200+ users and user databases for
> student project use. I have tried all sorts of GRANT and REVOKE
> combinations but for the life of me cannot stop other users from
> creating tables in a database that is not their own.
test=# create user xxx;
CREATE ROLE
test=# create database xxx owner xxx;
CREATE DATABASE
test=# \c xxx
You are now connected to database "xxx" as user "kgrittn".
xxx=# revoke create on database xxx from public;
REVOKE
xxx=# revoke create on schema public from public;
REVOKE
xxx=# grant create on schema public to xxx;
GRANT
You might also want to limit connection rights in pg_hba.conf
-Kevin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, axs@aber.ac.uk
Subject: Re: Privileges question
In-Reply-To: <4E9D628A0200002500042183@gw.wicourts.gov>
References: <8EDB6E83019BEC4B9153122CFB928AF001F6463C4B5D@MAILBOX.staff.aber.ac.uk> <4E9D628A0200002500042183@gw.wicourts.gov>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox