Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id CEDB52E3594 for ; Thu, 20 Dec 2007 13:43:28 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 49761-05 for ; Thu, 20 Dec 2007 13:43:19 -0400 (AST) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.187]) by postgresql.org (Postfix) with ESMTP id AA0462E3371 for ; Thu, 20 Dec 2007 13:43:18 -0400 (AST) Received: by nf-out-0910.google.com with SMTP id f5so1582050nfh.23 for ; Thu, 20 Dec 2007 09:43:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=WGtjmi359ZUg6cEHNh3DoqqEojFlqS137d+zDw0SOdk=; b=BR+mt04cWra5lQwhdB/67E63eaMOiNAL1ZMLS1L0lKOC8gV30tdSvr2lCeDotAYngV7hCeI27OcxvkkI8TxRcypkqnWc0ikd8yNBZpOzDRl9UTbDhJbw7HqLw6ICwtvJkBKhp3Qsz0FulRragiwc+4N5a0aTxnlJn/TMBN8JJ3I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WyOfRhAdO3Ue++GSDJ2WO/b9zJU8OV6J0vbtkXqC3T2el8MWZrWOim/FQcJaBow8mLoDW+0vr5GLT58p8Dr1oC1BKYVt62gtiAi55NB0/cCp1sPriG0bqCayDbX9GYgoYHWRGaGinHUAfhVrhetcT8a+QUz7KM0Pmdsxh0kHrJQ= Received: by 10.78.133.2 with SMTP id g2mr464595hud.26.1198172596336; Thu, 20 Dec 2007 09:43:16 -0800 (PST) Received: by 10.78.18.2 with HTTP; Thu, 20 Dec 2007 09:43:16 -0800 (PST) Message-ID: Date: Thu, 20 Dec 2007 12:43:16 -0500 From: "Merlin Moncure" To: "Roberts, Jon" Subject: Re: viewing source code Cc: "Alvaro Herrera" , "Trevor Talbot" , "Joshua D. Drake" , "Kris Jurka" , "Jonah H. Harris" , "Bill Moran" , pgsql-performance@postgresql.org In-Reply-To: <1A6E6D554222284AB25ABE3229A92762112A49@nrtexcus702.int.asurion.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1A6E6D554222284AB25ABE3229A92762112A49@nrtexcus702.int.asurion.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/312 X-Sequence-Number: 28128 On Dec 20, 2007 11:30 AM, Roberts, Jon wrote: > > -----Original Message----- > > From: Merlin Moncure [mailto:mmoncure@gmail.com] > > Sent: Thursday, December 20, 2007 8:30 AM > > To: Roberts, Jon > > Cc: Alvaro Herrera; Trevor Talbot; Joshua D. Drake; Kris Jurka; Jonah H. > > Harris; Bill Moran; pgsql-performance@postgresql.org > > Subject: Re: [PERFORM] viewing source code > > > > > On Dec 20, 2007 9:07 AM, Roberts, Jon wrote: > > > 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 > > > > This solution will not work. It requires cooperation from pgAdmin > > which is not going to happen and does nothing about psql or direct > > queries from within pgadmin. Considered from a security/obfuscation > > perspective, its completely ineffective. As I've said many times, > > there are only two solutions to this problem: > > > > 1. disable permissions to pg_proc and deal with the side effects > > (mainly, pgadmin being broken). > > > > 2. wrap procedure languages in encrypted handler (pl/pgsql_s) so that > > the procedure code is encrypted in pg_proc. this is an ideal > > solution, but the most work. > > > > I think there is an option 3. Enhance the db to have this feature built in > which is more inline with commercial databases. This feature would drive > adoption of PostgreSQL. It isn't feasible in most companies to allow > everyone with access to the database to view all code written by anyone and > everyone. option 3 is really option 2. having this option is all the flexibility you need. i understand in certain cases you want to prevent code from being available to see from certain users, but i don't buy the adoption argument...most people dont actually become aware of implications of pg_proc until after development has started. simply having a choice, either directly community supported or maintained outside in pgfoundry should be enough. in the majority of cases, who can see the code doesn't matter. i do however strongly disagree that hiding the code is bad in principle... i was in the past in this exact situation for business reasons out of my control (this is why I know the pgadmin route wont work, i've chased down that angle already), so i'm highly sympathetic to people who need to do this. i opted for revoke from pg_proc route, which, while crude was highly effective. merlin