Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 0513A64FC20 for ; Thu, 25 Sep 2008 17:14:56 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 01554-01-2 for ; Thu, 25 Sep 2008 17:14:49 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fetter.org (start.fetter.org [66.92.188.65]) by postgresql.org (Postfix) with ESMTP id 925A064FC36 for ; Thu, 25 Sep 2008 17:14:49 -0300 (ADT) Received: by fetter.org (Postfix, from userid 500) id A6700FBCB03; Thu, 25 Sep 2008 13:14:45 -0700 (PDT) Date: Thu, 25 Sep 2008 13:14:45 -0700 From: David Fetter To: Casey Allen Shobe Cc: Tom Lane , Bill Moran , Greg Smith , Jonathan Bond-Caron , 'Postgres General List' Subject: Re: Obfuscated stored procedures (was Re: Oracle and Postgresql) Message-ID: <20080925201445.GD4814@fetter.org> References: <1A6E6D554222284AB25ABE3229A9276201A1993B@nrtexcus702.int.asurion.com> <20080915135847.GF3666@fetter.org> <7be3f35d0809150731k575bf7aajc689a4278176b1a8@mail.gmail.com> <000001c91748$af9288b0$0eb79a10$@com> <20080915202922.1778a062.wmoran@collaborativefusion.com> <20080916005025.GE3666@fetter.org> <20080915221136.f39a284e.wmoran@collaborativefusion.com> <16972.1221531560@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/1035 X-Sequence-Number: 138042 On Thu, Sep 25, 2008 at 01:05:26PM -0700, Casey Allen Shobe wrote: > On Sep 15, 2008, at 7:19 PM, Tom Lane wrote: >> The problem is that the people who ask for this type of feature are >> usually imagining that they can put their code on >> customer-controlled machines and it will be safe from the >> customer's eyes. > > That's a broken expectation. All that can realistically be expected > is database/catalog-level constraints. It's far from clear that those offer protection of any reasonable kind. >> Well, it isn't, and I don't think Postgres should encourage them to >> think it is. > > Adding such a feature would NOT be encouraging them to think this - the > documentation could be very explicit about this fact. Maybe that's what > Oracle is selling, and that's crappy of them, but that doesn't mean we > should use that as justification to not add a more appropriate > implementation. You've got the burden of proof exactly backwards there. It's on you or anyone who cares to to explain why it might be a good idea to add this "feature," understanding that every feature has a maintenance cost and is a potential source of bugs. > As for the expectation above - could pl/pgsql be made compilable? > It would seem easy to translate pl/pgsql code into C and compile a > C function. That *could* go onto customer-controlled machines and > be safe from the customer's eyes. No, it would not. As many others have mentioned, "strings" does a pretty good job on such stuff, let alone the impossibility even in theory of hiding what a program does from someone with access to run it using arbitrary inputs, even when they have no binary to examine. > FWIW, I think most people who want to hide code aren't concerned about > IP, they're concerned about clients seeing embarrassingly bad/sloppy > code. But there *are* some very real and legitimate needs for this, > though it's a small minority of those who think they do. Please elucidate those needs in detail, then explain why it might be PostgreSQL's job to meet them. Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fetter@gmail.com Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate