Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 6861B9FBADC for ; Thu, 11 Oct 2007 17:04:07 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 06938-03 for ; Thu, 11 Oct 2007 17:03:59 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from outbound-mail-45.bluehost.com (outbound-mail-45.bluehost.com [69.89.18.14]) by postgresql.org (Postfix) with SMTP id 28D609F9EF8 for ; Thu, 11 Oct 2007 17:03:55 -0300 (ADT) Received: (qmail 23753 invoked by uid 0); 11 Oct 2007 20:03:28 -0000 Received: from unknown (HELO box54.bluehost.com) (69.89.20.54) by mailproxy3.bluehost.com with SMTP; 11 Oct 2007 20:03:28 -0000 Received: from corp.messageone.com ([66.219.55.2] helo=ematt.austin.messageone.com) by box54.bluehost.com with esmtp (Exim 4.68) (envelope-from ) id 1Ig4Fi-0005jS-NU for pgsql-admin@postgresql.org; Thu, 11 Oct 2007 14:03:26 -0600 From: Kevin Kempter To: pgsql-admin@postgresql.org Subject: Re: how to create an user with ONLY select permission and nothing else? Date: Thu, 11 Oct 2007 14:02:45 -0600 User-Agent: KMail/1.9.7 References: <320881.18517.qm@web56413.mail.re3.yahoo.com> In-Reply-To: <320881.18517.qm@web56413.mail.re3.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200710111402.45409.kevin@kevinkempterllc.com> X-Identified-User: {840:box54.bluehost.com:kevinkem:kevinkempterllc.com} {sentby:bopbeforesmtp 66.219.55.2 authed with kevinkempterllc.com} X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/102 X-Sequence-Number: 27016 On Thursday 11 October 2007 12:33:24 Jessica Richard wrote: > I created a test user with the following command: > > $ createuser test > Shall the new role be a superuser? (y/n) n > Shall the new role be allowed to create databases? (y/n) n > Shall the new role be allowed to create more new roles? (y/n) n > CREATE ROLE > > This user at the moment does not have permission to look at any existing > tables, but it can create a table: > > > $ psql -Utest -d postgres > Password for user test: > > postgres=> create table test(x int); > CREATE TABLE > > > Two questions: > > 1. How do I create a user with ONLY select permission but nothing else (not > even creating any new tables)? > > 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. > > Thanks, > Jessica > > > > --------------------------------- > Shape Yahoo! in your own image. Join our Network Research Panel today! ALTER USER username SET default_transaction_read_only to true;