Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id C96AC2E3004 for ; Tue, 18 Dec 2007 14:52:45 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 44418-06 for ; Tue, 18 Dec 2007 14:52:30 -0400 (AST) Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by postgresql.org (Postfix) with ESMTP id 324932E3187 for ; Tue, 18 Dec 2007 14:52:41 -0400 (AST) Received: from perhan.alvh.no-ip.org (200-126-76-117.bk5-dsl.surnet.cl [200.126.76.117]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id lBIIqMuD028199 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 18 Dec 2007 10:52:24 -0800 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 3D4EB47C88; Tue, 18 Dec 2007 15:52:23 -0300 (CLST) Date: Tue, 18 Dec 2007 15:52:23 -0300 From: Alvaro Herrera To: "Roberts, Jon" Cc: "'Kris Jurka'" , Merlin Moncure , "Jonah H. Harris" , Bill Moran , "Joshua D. Drake" , pgsql-performance@postgresql.org Subject: Re: viewing source code Message-ID: <20071218185223.GD8088@alvh.no-ip.org> References: <1A6E6D554222284AB25ABE3229A92762112A25@nrtexcus702.int.asurion.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1A6E6D554222284AB25ABE3229A92762112A25@nrtexcus702.int.asurion.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Tue, 18 Dec 2007 10:52:24 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/271 X-Sequence-Number: 28087 Roberts, Jon escribió: > So you are saying I need to create a view per user to achieve this? That > isn't practical for an enterprise level database. No -- that would be quite impractical indeed. I'm talking about something like revoke all privileges on pg_proc from public; create view limited_pg_proc as select * from pg_proc where proowner = (select oid from pg_authid where rolname = current_user); grant select on limited_pg_proc to public; Of course, it is only a rough sketch. It needs to be improved in a number of ways. But it shows that even with pure SQL the solution is not far; with backend changes it is certainly doable (for example invent a separate "view source" privilege for functions). -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.