Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id D18021337BE8 for ; Tue, 1 Feb 2011 14:50:15 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 37483-03 for ; Tue, 1 Feb 2011 18:50:07 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail0.aip.de (maigret.aip.de [141.33.160.2]) by mail.postgresql.org (Postfix) with SMTP id AA5B01337BA1 for ; Tue, 1 Feb 2011 14:50:05 -0400 (AST) Received: (qmail 27687 invoked from network); 1 Feb 2011 17:44:33 -0000 Received: from cashmere.aip.de (141.33.4.98) by mailout.aip.de with SMTP; 1 Feb 2011 17:44:33 -0000 Received: from cashmere.aip.de (localhost.localdomain [127.0.0.1]) by cashmere.aip.de (8.13.8/8.13.8) with ESMTP id p11Io4JX007617; Tue, 1 Feb 2011 19:50:04 +0100 Received: (from swhite@localhost) by cashmere.aip.de (8.13.8/8.13.8/Submit) id p11Io4YD007616; Tue, 1 Feb 2011 19:50:04 +0100 X-Authentication-Warning: cashmere.aip.de: swhite set sender to swhite@aip.de using -f Date: Tue, 1 Feb 2011 19:50:04 +0100 From: Steve White To: Kevin Grittner Cc: Tom Lane , pgsql-bugs@postgresql.org Subject: Re: Feature request: include script file into function body Message-ID: <20110201185004.GA7511@cashmere.aip.de> References: <20110201112120.GA1327@cashmere.aip.de> <26900.1296576145@sss.pgh.pa.us> <20110201164422.GA3023@cashmere.aip.de> <4D47EB12020000250003A0EE@gw.wicourts.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D47EB12020000250003A0EE@gw.wicourts.gov> User-Agent: Mutt/1.4.2.2i "Organization: Astrophysikalisches Institut Potsdam" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/14 X-Sequence-Number: 29286 Hi again, all, OK I think I now know what the misunderstanding is. > [Please don't top-post. Rearranged for clarity.] > > Steve White wrote: > > On 1.02.11, Tom Lane wrote: > >> Steve White writes: > >>> It would be really nice to have a way to load script (especially > >>> Python and Perl) from a separate file into a function body. > >> > >> This seems like a security hole, ie, you could use it to read any > >> file the backend has access to. > > > Isn't the \i command a similar security hole? > > That is run by a client program on a client machine. If that is > what you had in mind, a modification to the CREATE FUNCTION syntax > is probably not the way to go. Just to throw a hypothetical out > there, were you looking to effectively do a \i inside the string > literal which is the function body, picking up a *client-side* file? > > That has its own problems, of course, but I'm just trying to get us > onto the same page. > > -Kevin > I guess the "FROM filename" syntax wasn't a great choice, as it suggests something completely different from what I was otherwise describing. (In my own defense: I repeatedly qualified the syntax as a suggestion.) I *DO NOT MEAN* that a query should run about grabbing files off the server, or wherever. I meant something like the replacement that happens with the \i command in loading SQL, and under similar circumstances, except that somehow non-SQL code is loadad in a function body. Again, this would greatly facilitate programming mixed-language programming. Thanks! -- | - - - - - - - - - - - - - - - - - - - - - - - - - | Steve White +49(331)7499-202 | E-Science Zi. 27 Villa Turbulenz | - - - - - - - - - - - - - - - - - - - - - - - - - | Astrophysikalisches Institut Potsdam (AIP) | An der Sternwarte 16, D-14482 Potsdam | | Vorstand: Prof. Dr. Matthias Steinmetz, Peter A. Stolz | | Stiftung privaten Rechts, Stiftungsverzeichnis Brandenburg: III/7-71-026 | - - - - - - - - - - - - - - - - - - - - - - - - -