Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id BD8F42E4087 for ; Thu, 20 Dec 2007 14:30:15 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 37711-07 for ; Thu, 20 Dec 2007 14:30:06 -0400 (AST) Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by postgresql.org (Postfix) with ESMTP id F11CF2E406A for ; Thu, 20 Dec 2007 14:30:06 -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 lBKITp9G027833 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 20 Dec 2007 10:29:54 -0800 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 43FB647C88; Thu, 20 Dec 2007 15:29:52 -0300 (CLST) Date: Thu, 20 Dec 2007 15:29:52 -0300 From: Alvaro Herrera To: "Roberts, Jon" Cc: "'Trevor Talbot'" , "Joshua D. Drake" , Kris Jurka , Merlin Moncure , "Jonah H. Harris" , Bill Moran , pgsql-performance@postgresql.org Subject: Re: viewing source code Message-ID: <20071220182952.GB10849@alvh.no-ip.org> References: <1A6E6D554222284AB25ABE3229A92762112A42@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: <1A6E6D554222284AB25ABE3229A92762112A42@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]); Thu, 20 Dec 2007 10:29:55 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/314 X-Sequence-Number: 28130 Roberts, Jon escribió: > So your suggestion is first to come up with a query that dynamically checks > permissions and create a view for it. Secondly, change pgAdmin to reference > this view in place of pg_proc. Actually, it should be extended to all > objects in the database, not just pg_proc. If you don't have this > dictionary role, you shouldn't be able to look at any of the objects in the > database unless you own the object or have been granted rights to the > object. Right. Another thing that just occured to me was to rename pg_proc to something else, and create the restricted view using the pg_proc name. This sounds dangerous in terms of internals, but actually the system catalogs are invoked by OID not name, so maybe it will still work. You do need to make sure that superusers continue to see all functions though ... (the view test should really be "does the current user have access to this function".) -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.