Re: Feature request: include script file into function body - Mailing list pgsql-bugs

From Steve White
Subject Re: Feature request: include script file into function body
Date
Msg-id 20110201185004.GA7511@cashmere.aip.de
Whole thread Raw
In response to Re: Feature request: include script file into function body  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: Feature request: include script file into function body (better syntax)  (Steve White <swhite@aip.de>)
Re: Feature request: include script file into function body  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: Feature request: include script file into function body  (Gary Doades <gpd@gpdnet.co.uk>)
List pgsql-bugs
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.

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
| -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #5859: XML result in line and column
Next
From: "Kevin Grittner"
Date:
Subject: Re: Feature request: include script file into function body