From: | Steve White <swhite(at)aip(dot)de> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Feature request: include script file into function body |
Date: | 2011-02-01 11:21:20 |
Message-ID: | 20110201112120.GA1327@cashmere.aip.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Hi
I asked on pgsql-general 31 Jan 2011 if there were a way to do this, and got
no response, so let's make it a feature request.
It would be really nice to have a way to load script (especially Python
and Perl) from a separate file into a function body. Some advantages would
be: to run a code checker outside of Postgresql, and to make things easier
for source code colorizers.
I have in mind syntax something like
================================================
CREATE OR REPLACE FUNCTION
myfunc( ... )
RETURNS VOID FROM 'ScriptFile.py' LANGUAGE PLPYTHONU;
================================================
I think the FROM keyword fits here, and serves to distinguish behavior
from AS. This is just a suggestion though.
The file name ought to work in the usual way: without a leading slash
to be interpreted as a path relative to the current directory (in case the
command is inside an .sql file, that would be the directory containing the
.sql file). With a leading slash, it would be taken as an absolute path.
For distribution purposes, it would also be nice to have some portable means
of indicating the installation directory of the running PostgreSQL, perhaps
with an environment variable replacement (e.g. $LIBDIR).
Cheers!
--
| - - - - - - - - - - - - - - - - - - - - - - - - -
| 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
| - - - - - - - - - - - - - - - - - - - - - - - - -
From | Date | Subject | |
---|---|---|---|
Next Message | Steve White | 2011-02-01 11:31:09 | Portable, simple means of determining distribution directory |
Previous Message | depstein | 2011-02-01 09:55:49 | pg_dump doesn't save altered column information for inherited columns |