pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Milen A. Radev <milen@radev.net>
To: pgsql-admin@postgresql.org
Subject: Re: how to create an user with ONLY select permission and nothing else?
Date: Thu, 11 Oct 2007 22:35:43 +0300
Message-ID: <feltug$ejn$1@sea.gmane.org> (raw)
In-Reply-To: <320881.18517.qm@web56413.mail.re3.yahoo.com>
References: <320881.18517.qm@web56413.mail.re3.yahoo.com>

Jessica Richard написа:
[...]
> Two questions:
> 
> 1. How do I create a user with ONLY select permission but nothing else (not even creating any new tables)?


You could not create a read-only role by just using CREATE ROLE - you
could control the privileges that role has on particular DB objects.

When you create DB objects (schemas, tables, functions etc.) revoke all
privileges from PUBLIC, because every authenticated user is (part of)
PUBLIC. Then give some privileges to those roles that need them - like
"SELECT" for the role in question.

> 
> 2. How do I check to see what permissions a particular user currently has?
> 
> I know that \z tablename can show who has what permissions on a  table, but it does not tell if a user has "create table" permission or not. 

Tables are created in schemas so you need to check if the role has
"CREATE" privilege for the particular schema. Check also the "CREATE"
privilege for that role on the DB.


-- 
Milen A. Radev




view thread (4+ messages)  latest in thread

Message-ID: <feltug$ejn$1@sea.gmane.org>
Permalink:  ../feltug$ejn$1@sea.gmane.org/
Also on:    postgresql.org/message-id/feltug$ejn$1@sea.gmane.org

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: milen@radev.net
  Subject: Re: how to create an user with ONLY select permission and nothing else?
  In-Reply-To: <feltug$ejn$1@sea.gmane.org>

* 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