Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 69E6E1337999 for ; Tue, 1 Feb 2011 14:14:55 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 70661-02 for ; Tue, 1 Feb 2011 18:14:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id E1A6E13364DE for ; Tue, 1 Feb 2011 14:14:47 -0400 (AST) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id p11ICFx11142; Tue, 1 Feb 2011 13:12:15 -0500 (EST) From: Bruce Momjian Message-Id: <201102011812.p11ICFx11142@momjian.us> Subject: Re: Feature request: include script file into function body In-Reply-To: <20110201175718.GB6707@cashmere.aip.de> To: Steve White Date: Tue, 1 Feb 2011 13:12:15 -0500 (EST) CC: Kevin Grittner , Tom Lane , pgsql-bugs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" 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/12 X-Sequence-Number: 29284 Steve White wrote: > Hi Kevin, > > On 1.02.11, Kevin Grittner wrote: > > [Please don't top-post. Rearranged for clarity.] > > > As you like. > > > 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. > > Sorry I don't understand this remark. > > Are you saying that \i is disabled to user postgres? > Just tried: it isn't. > Are you saying that as a normal user I can use \i to load a file that I > don't normally have access to? > Just tried: nope -- permission denied. > > What scenario do you have in mind? \i is a psql client command, not something the backend runs. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +