Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 3BA419FA178; Fri, 1 Dec 2006 11:37:37 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 20978-01; Fri, 1 Dec 2006 11:37:30 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from rwcrmhc14.comcast.net (rwcrmhc14.comcast.net [216.148.227.154]) by postgresql.org (Postfix) with ESMTP id 5F1AD9FA12B; Fri, 1 Dec 2006 11:37:30 -0400 (AST) Received: from [192.168.0.9] (c-24-17-161-80.hsd1.wa.comcast.net[24.17.161.80]) by comcast.net (rwcrmhc14) with ESMTP id <20061201153727m1400c4i12e>; Fri, 1 Dec 2006 15:37:27 +0000 From: Adrian Klaver Reply-To: aklaver@comcast.net To: pgsql-sql@postgresql.org Subject: Re: [SQL] Grants Date: Fri, 1 Dec 2006 07:42:10 -0800 User-Agent: KMail/1.6.2 Cc: "Ezequias Rodrigues da Rocha" , imad , Pgadmin-Support References: <55c095e90611301141n16b8f278n43f65ce5613e663d@mail.gmail.com> <1f30b80c0611301224r135849ffg2426291a42afa29@mail.gmail.com> <55c095e90612010603r11d2b1e0ibecc0fdee900f679@mail.gmail.com> In-Reply-To: <55c095e90612010603r11d2b1e0ibecc0fdee900f679@mail.gmail.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200612010742.10553.aklaver@comcast.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/9 X-Sequence-Number: 6276 On Friday 01 December 2006 06:03 am, Ezequias Rodrigues da Rocha wrote: > > 2006/11/30, imad : > > You did not grant access privileges to schema. > > Also GRANT administrators on the base schema as you did for the table. > > > > --Imad > > www.EnterpriseDB.com > > > > On 12/1/06, Ezequias Rodrigues da Rocha wrote: > > > Hi list, > > > > > > I am having problem with grants and users on PostgreSQL. > > > > > > I am using pgAdmin to connect like other user to test my permissions. > > > > > > As the owner of the database I have criated two roles: > > > > > > administrators (cannot connect) > > > ezequias (can connect) > > > > > > I give permissions to a table I have: > > > GRANT SELECT, UPDATE, INSERT ON TABLE base.table1 TO administrators; > > > > > > > > > My user: > > > CREATE ROLE ezequias LOGIN > > > NOSUPERUSER NOINHERIT NOCREATEDB NOCREATEROLE; > > > GRANT administradores TO ezequias; > > > > > > My group > > > CREATE ROLE administradores > > > NOSUPERUSER NOINHERIT NOCREATEDB NOCREATEROLE; > > > > > > When I try to access the table base.table1 with ezequias login the > > > pgAdmin reports: > > > (see attached image) > > > > > > Could someone tell me what I did wrong ? > > > Ezequias > > > > > > > > > > > > ---------------------------(end of > > > broadcast)--------------------------- TIP 5: don't forget to increase > > > your free space map settings > ####Schema grants#### > > CREATE SCHEMA base > AUTHORIZATION root; > GRANT ALL ON SCHEMA base TO root; > GRANT USAGE ON SCHEMA base TO administrators; > > ####Table grants#### > GRANT ALL ON TABLE base."local" TO root; > GRANT SELECT, UPDATE, INSERT ON TABLE base."local" TO administrators; > > Still the same problem. :( Two things I see. The first may only be a translation artifact. You have CREATE ROLE administradores and then GRANT to administrators on the table. Second in the CREATE ROLE ezequias you have NOINHERIT. This means ezequias does not automatically assume the privileges of the ROLES it belongs to. To acquire the privileges you have to do a SET ROLE administrators at the connection. -- Adrian Klaver aklaver@comcast.net