Search Postgresql Archives

include source file from another language into function body?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Is there an accepted way to load code in another language into a PostgreSQL
function body?

This would be really nice in several ways, for example: to run a code
checker outside of postgresql, and to make things easier for source code 
colorizers.

I have in mind something like

================================================
CREATE OR REPLACE FUNCTION
        myfunc( arg1 TEXT, arg2 INTEGER )
RETURNS VOID AS 'Conversion.py' LANGUAGE PLPYTHONU;
================================================

But when I try the above, on running the function I get an error
"could not compile...", which isn't surpising...

For C functions, there is a special form of CREATE FUNCTION ... AS that
causes an object file to be read...

(In the case of Python, one could achieve something like this effect
by using the execfile() function.  However as I understand it, this would
happen at run time...)

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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux