X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C1BAA53884 for ; Fri, 22 Apr 2005 09:29:46 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13718-10 for ; Fri, 22 Apr 2005 12:29:38 +0000 (GMT) Received: from mail.99main.com (mail.99main.com [208.28.184.11]) by svr1.postgresql.org (Postfix) with ESMTP id B05DA536D4 for ; Fri, 22 Apr 2005 09:29:36 -0300 (ADT) Received: from 99main.com (localhost [127.0.0.1]) by mail.99main.com (8.12.8+Sun/8.12.8) with ESMTP id j3MCTdrX019475 for ; Fri, 22 Apr 2005 08:29:39 -0400 (EDT) From: "Keith Worthington" To: PostgreSQL Interfaces Reply-To: KeithW@narrowpathinc.com Subject: Re: plperl user function Date: Fri, 22 Apr 2005 08:29:39 -0400 Message-Id: <20050422121739.M32137@narrowpathinc.com> In-Reply-To: <42680F29.4030907@commandprompt.com> References: <20050421194438.M68704@narrowpathinc.com> <42680480.7080805@commandprompt.com> <20050421200109.M30783@narrowpathinc.com> <42680F29.4030907@commandprompt.com> X-Mailer: Open WebMail 2.50 20050106 X-OriginatingIP: 68.235.22.242 (npkeithw) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.01 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/72 X-Sequence-Number: 5488 > > This leaves me with two questions. > > 1) Why can I not use "use strict;" or "use warnings;" as they are > > apparently good perl programming practice. I say apparently > > because if you remember I started learning this language 3 days > > ago and must be considered a neophyte. :-) > You can't use "use" instruction for security reason. All disk access > are denied and use need a disk access. > > I think you need to use plperlu. Yes. That fixed my use problems. I am not sure I like the idea of using an untrusted language. I wonder if it causes a potential security issue. > 2) What is wrong with the use of RETURN? According to Michael (whose email I can't access at the moment) it has to be lowercase. I never dreamed Perl would be case sensitive but after changing the case, voila! :-) > > Another question: Is there an issue with using the untrusted perl > > language? > > IIRC you have to be a postgresql superuser (postgres) to execute an > untrusted language function. I just tested the untrusted function using a normal user and it worked. > > If the code is tested and working is there any real reason to > > continue to have "use strict;" and "use warnings;" in the function? > > Only for manageability in the future. Hmmm well I have this gut feeling that it is better to use a trusted language than an untrusted one but I have no idea if that is supported by fact. My inclination is that now that the function is working and tested that I should comment out the two "use" commands and recreate the function with the trusted version. Kind Regards, Keith