Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id B16CED84656 for ; Fri, 8 Jun 2012 16:14:28 -0300 (ADT) Received: from mail-gg0-f174.google.com ([209.85.161.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Sd4dd-000713-On for pgsql-admin@postgresql.org; Fri, 08 Jun 2012 19:14:28 +0000 Received: by gglu4 with SMTP id u4so1535320ggl.19 for ; Fri, 08 Jun 2012 12:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=nLgcpKbhVOgcyVGiQbDoyR/LP+QTuadb+f0eUAezxw8=; b=Jg9IP3IRwl3H1ZSAfHAxzCRYq+757w61ewkm8J32nbMtMihBCyZGyA2LDzJtSqpn9M ft5DkDqvGRwZ7Izl1DG8NnULQgHCAdu5t0DMJhTaTIw9808vqHyx6RNNucWY2VYBHxjr O8OZj9+MsL0pNvfP4GcTOhELpwY4Z3AYcU66EZL22JSh2evbqiXvcZmOCPuKsGhN3h3S wuv7zvh5CtQxq14Jr6+i+2pevUMYhJfNeVxeXvmOIRL8h2GhQfwSnMYXBO1CDkXS5o96 Am1Xk/q+mbS5DqsOCJl+omCePlvezq8o6HWjbBypY63C91VIk2oZguKqP6v5IC8ahVTs t0IA== Received: by 10.236.179.106 with SMTP id g70mr8832289yhm.53.1339182853099; Fri, 08 Jun 2012 12:14:13 -0700 (PDT) Received: from [10.0.0.117] (na-201-156-19-99.static.avantel.net.mx. [201.156.19.99]) by mx.google.com with ESMTPS id r11sm10819287anj.16.2012.06.08.12.14.12 (version=SSLv3 cipher=OTHER); Fri, 08 Jun 2012 12:14:12 -0700 (PDT) Message-ID: <4FD24ED1.10201@gmail.com> Date: Fri, 08 Jun 2012 14:13:21 -0500 From: =?ISO-8859-15?Q?Ren=E9_Romero_Benavides?= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120421 Thunderbird/12.0 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: Creating a Read Only profile in 8.4 References: <11689.1339163954@sss.pgh.pa.us> In-Reply-To: <11689.1339163954@sss.pgh.pa.us> Content-Type: multipart/alternative; boundary="------------060207070909000303090801" X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201206/39 X-Sequence-Number: 39630 This is a multi-part message in MIME format. --------------060207070909000303090801 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Am 08.06.2012 08:59, schrieb Tom Lane: > "Della-Croce, Gregory" writes: >> I am new at the Postgres DBA - Admin stuff. So when asked to create a read only profile for our database in Postgres 8.4 I did the following: >> * create role RO_User password 'xxxxxxxxxxx' NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN; >> * select 'grant select on ' || tablename || ' to \"RO_User\"; 'from pg_tables where schemaname = 'public'; > Uh, that only printed the GRANT commands you needed, it didn't execute > them. > > regards, tom lane > You'll need to grant usage on the schema to your RO_User role as well. GRANT USAGE ON SCHEMA public TO RO_User; for each database you'll allow him to connect to. -- pglearn.blogspot.mx:postgresql recipes *Twitter*.You might consider to follow *@sqlhotfix* --------------060207070909000303090801 Content-Type: text/html; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Am 08.06.2012 08:59, schrieb Tom Lane:
"Della-Croce, Gregory" <Greg_Della-Croce@wycliffe.org> writes:
I am new at the Postgres DBA - Admin stuff.   So when asked to create a read only profile for our database in Postgres 8.4 I did the following:
*         create role RO_User password 'xxxxxxxxxxx' NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;

      
*         select 'grant select on ' || tablename || ' to \"RO_User\"; 'from pg_tables where schemaname = 'public';
Uh, that only printed the GRANT commands you needed, it didn't execute
them.

			regards, tom lane

You'll need to grant usage on the schema to your RO_User role as well.

GRANT USAGE ON SCHEMA public TO RO_User;
 
for each database you'll allow him to connect to.
--
pglearn.blogspot.mx:postgresql recipes
Twitter.You might consider to follow @sqlhotfix
--------------060207070909000303090801--