X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 916FCD1E12D for ; Thu, 19 Feb 2004 19:27:21 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 90053-03 for ; Thu, 19 Feb 2004 15:27:17 -0400 (AST) Received: from davinci.ethosmedia.com (server228.ethosmedia.com [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id EF1CDD1E138 for ; Thu, 19 Feb 2004 15:27:15 -0400 (AST) Received: from [63.195.55.98] (HELO 192.168.1.29) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 4457863; Thu, 19 Feb 2004 11:28:24 -0800 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: "Rodrigo Sakai" , pgsql-sql@postgresql.org Subject: Re: Compiling pl/pgsql functions Date: Thu, 19 Feb 2004 11:26:26 -0800 User-Agent: KMail/1.5.4 References: <20040219180521.31448.qmail@hm10.locaweb.com.br> In-Reply-To: <20040219180521.31448.qmail@hm10.locaweb.com.br> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402191126.26465.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/284 X-Sequence-Number: 16974 Rodrigo, > I insist in my question, is there a way to compile the plpgsql codes or something like that, or its better to think about writting this postgres functions in C?????? No, there is not. Nor is there likely to be for any PL, as it would add significant overhead for no real gain. You have, as I see it, 3 choices: 1) You can give up on code obfuscation and simply provide the functions normally, and rely on your contracts and copyright law to protect your code. This is what I do, and I feel pretty strongly that code obfuscation is a dumb and ineffective way to protect copyright. Personally, I find it hard to believe that any of my PL/SQL functions (or yours) are so brilliant that they need trade secret protection. 2) You can write your functions in C and compile them. 3) You can carefully engineer your database permissions so that the user can have almost full DBA powers without being the superuser, and deny them direct access to the pg_proc table. This would be a real PITA, though. -- -Josh Berkus Aglio Database Solutions San Francisco