From: Gary Doades <gpd@gpdnet.co.uk>
To: pgsql-bugs@postgresql.org
Subject: Re: Feature request: include script file into function body
Date: Tue, 01 Feb 2011 18:55:20 +0000
Message-ID: <4D485718.6010402@gpdnet.co.uk> (raw)
In-Reply-To: <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>
<20110201185004.GA7511@cashmere.aip.de>
On 01/02/2011 6:50 PM, Steve White wrote:
> Hi again, all,
>
> OK I think I now know what the misunderstanding is.
>
>> [Please don't top-post. Rearranged for clarity.]
>>
>> Steve White<swhite@aip.de> wrote:
>>> On 1.02.11, Tom Lane wrote:
>>>> Steve White<swhite@aip.de> 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.
But functions *run* on the server, in the postgres server backend, so it
would have to grab files from the server, which is where the security
issue comes in.
The \i command *runs* on the client under your own account and reads
text into the *client*, not the server. The two things are completely
different and run in completely different places.
Cheers,
Gary.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: gpd@gpdnet.co.uk
Subject: Re: Feature request: include script file into function body
In-Reply-To: <4D485718.6010402@gpdnet.co.uk>
References: <20110201112120.GA1327@cashmere.aip.de> <26900.1296576145@sss.pgh.pa.us> <20110201164422.GA3023@cashmere.aip.de> <4D47EB12020000250003A0EE@gw.wicourts.gov> <20110201185004.GA7511@cashmere.aip.de> <4D485718.6010402@gpdnet.co.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox