From rjessil@yahoo.com Thu Oct 11 18:33:53 2007 Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A10389FB7CF for ; Thu, 11 Oct 2007 15:33:53 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 18650-04 for ; Thu, 11 Oct 2007 15:33:32 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from web56413.mail.re3.yahoo.com (web56413.mail.re3.yahoo.com [216.252.111.92]) by postgresql.org (Postfix) with SMTP id 6E7989FB354 for ; Thu, 11 Oct 2007 15:33:30 -0300 (ADT) Received: (qmail 19126 invoked by uid 60001); 11 Oct 2007 18:33:24 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=FpcYi6YxcU3pawwX/XkydxmCTZKBQND0N4HYvyB6kB4ea1UbOXprNK14E5s9Pzlz+3+SRJ7Af1Bojcz4qN/Vvv7dfNbokEYtpdLpck60ff1D1qSDsuWPSecK+O4uAF2ZXVBbcVmy8gDPO3xNzyNRWUC6BbJbnMm3yfs7dWVIhn4=; X-YMail-OSG: iG8e1g8VM1nA0sJVQLvF_kgBml2WFLq3lhDXufI9h329dQDTlK4RxtW4zhs4VIoXLAsKMg9Ej0IhgZnYcBg5pAT3KBl1Bl_ZsZWGv7q4RG18SwJq7fEG7cQII0MCAEBy6kYFZt6VWxWO2wWOH3QjqRe8sQ-- Received: from [198.119.134.32] by web56413.mail.re3.yahoo.com via HTTP; Thu, 11 Oct 2007 11:33:24 PDT Date: Thu, 11 Oct 2007 11:33:24 -0700 (PDT) From: Jessica Richard Subject: how to create an user with ONLY select permission and nothing else? To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1283084068-1192127604=:18517" Content-Transfer-Encoding: 8bit Message-ID: <320881.18517.qm@web56413.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/100 X-Sequence-Number: 27014 --0-1283084068-1192127604=:18517 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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! --0-1283084068-1192127604=:18517 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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! --0-1283084068-1192127604=:18517-- From milen@radev.net Thu Oct 11 20:12:04 2007 Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 115999FBB53 for ; Thu, 11 Oct 2007 17:12:04 -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 11460-01 for ; Thu, 11 Oct 2007 17:11:55 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by postgresql.org (Postfix) with ESMTP id A18549FBB42 for ; Thu, 11 Oct 2007 17:11:57 -0300 (ADT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Ig4LM-00072Q-Ma for pgsql-admin@postgresql.org; Thu, 11 Oct 2007 20:09:16 +0000 Received: from 77.70.61.39 ([77.70.61.39]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Oct 2007 20:09:16 +0000 Received: from milen by 77.70.61.39 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Oct 2007 20:09:16 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-admin@postgresql.org From: "Milen A. Radev" Subject: Re: how to create an user with ONLY select permission and nothing else? Date: Thu, 11 Oct 2007 22:35:43 +0300 Lines: 27 Message-ID: References: <320881.18517.qm@web56413.mail.re3.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 77.70.61.39 User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) In-Reply-To: <320881.18517.qm@web56413.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/103 X-Sequence-Number: 27017 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 From kevin@kevinkempterllc.com Thu Oct 11 20:04:07 2007 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; From agustingenoves@gmail.com Thu Oct 11 20:13:28 2007 Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 6EC569FBBB6 for ; Thu, 11 Oct 2007 17:13:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 56344-02 for ; Thu, 11 Oct 2007 17:13:07 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.187]) by postgresql.org (Postfix) with ESMTP id 4D6AF9FBBBF for ; Thu, 11 Oct 2007 17:13:09 -0300 (ADT) Received: by fk-out-0910.google.com with SMTP id b27so623567fka for ; Thu, 11 Oct 2007 13:13:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=y/BdEv7Vcg2Rjdz2A6I4xKEvbTR5w2KFL6uda4VDmQs=; b=KayAYHhbu3gIrSLp/jrWyV6ey2rzKSidUiQo9I8TE2Wdo3FFnAcMyXy7cCIiOQFpKdnyh5tIsDX+Y1TAAIlOnnElgzmKJXWV01o6OEmTzU/Q3+tUbFHDTdt28+hcoNumclP8+pPNvUH4H9X0ysd0mtphPnm0dbqeTM1l/n3MqmA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=T71fp36PIaIxAYFUyfm0Zp6NkZ7yAwdwSxzZq3NowqInexWcVR5SU0kMHWU6m7veTRwEOAsIYXwqkaGe4AzIbbHNG9oabQMmEXO4OYFt99Qmhjv8r6oIoZpL9qI+YEnw0lHXQ6xEJns4CUZhsitg8PTVMFzAilMGqS+z48BS4yk= Received: by 10.82.182.1 with SMTP id e1mr3900781buf.1192133586749; Thu, 11 Oct 2007 13:13:06 -0700 (PDT) Received: by 10.82.120.10 with HTTP; Thu, 11 Oct 2007 13:13:06 -0700 (PDT) Message-ID: Date: Thu, 11 Oct 2007 17:13:06 -0300 From: "Agustin Ignacio Genoves" To: "Jessica Richard" , pgsql-admin@postgresql.org Subject: Re: how to create an user with ONLY select permission and nothing else? In-Reply-To: <320881.18517.qm@web56413.mail.re3.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <320881.18517.qm@web56413.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/104 X-Sequence-Number: 27018 With this you give permission to a table GRANT SELECT ON TABLE table TO user; 2007/10/11, Jessica Richard : > 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! > >