Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id A90352E2D56 for ; Wed, 12 Dec 2007 21:53:04 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 67216-08 for ; Wed, 12 Dec 2007 21:52:51 -0400 (AST) Received: from mail15.syd.optusnet.com.au (mail15.syd.optusnet.com.au [211.29.132.196]) by postgresql.org (Postfix) with ESMTP id 518C92E0049 for ; Wed, 12 Dec 2007 21:53:00 -0400 (AST) Received: from [127.0.0.1] (online4-new.lnk.telstra.net [139.130.169.227]) (authenticated sender plengada@optusnet.com.au) by mail15.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id lBD1qtEv027279 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 13 Dec 2007 12:52:57 +1100 Message-ID: <4760905F.2020406@reynolds.com.au> Date: Thu, 13 Dec 2007 10:52:31 +0900 From: Paul Lambert User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: pgsql admin Subject: Schema security Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/77 X-Sequence-Number: 27594 I have a schema for example called f65, and the public schema of course, in a database. I've created a user f65 to access only the f65 schema using the following: CREATE ROLE f65 LOGIN ENCRYPTED PASSWORD 'md52a630d68054defeed4b4c27cb6413ece' NOSUPERUSER NOINHERIT NOCREATEDB NOCREATEROLE; REVOKE ALL ON SCHEMA public FROM public; REVOKE ALL ON SCHEMA f65 FROM public; GRANT ALL ON SCHEMA f65 TO f65; Which gives the f65 user access to the schema, but they cannot access any of the objects within it (i.e. permission denied when trying a select from a table) testdb=> select * from f65.billing; ERROR: permission denied for relation billing I would have thought giving the user all privileges on a schema would by default add them to all objects within it, but clearly not. Do I need to explicitly go through every object within the schema and grant that user access to them or is there an easier way of doing it? Something like a "GRANT CASCADE" option? Cheers, P. -- Paul Lambert Database Administrator AutoLedgers