Hello PL/Python

Started by Karel Zakover 25 years ago10 messages
#1Karel Zak
zakkr@zf.jcu.cz

Today afternoon I a little study libpython1.5 and I mean create
new PL language is not a problem.

I a little play with it, and here is effect:

test=# CREATE FUNCTION py_test() RETURNS text AS '
test'# a = ''Hello '';
test'# b = ''PL/Python'';
test'# plpython.retval( a + b );
test'# ' LANGUAGE 'plpython';
CREATE
test=#
test=#
test=# SELECT py_test();
py_test
-----------------
Hello PL/Python
(1 row)

Comments? Works on this already anyone?

Karel

PS. I'am not Python guru, I love 'C' and good shared libs only :-)

#2Hannu Krosing
hannu@tm.ee
In reply to: Karel Zak (#1)
Re: Hello PL/Python

Karel Zak wrote:

Today afternoon I a little study libpython1.5 and I mean create
new PL language is not a problem.

I a little play with it, and here is effect:

test=# CREATE FUNCTION py_test() RETURNS text AS '
test'# a = ''Hello '';
test'# b = ''PL/Python'';
test'# plpython.retval( a + b );
test'# ' LANGUAGE 'plpython';
CREATE
test=#
test=#
test=# SELECT py_test();
py_test
-----------------
Hello PL/Python
(1 row)

Comments? Works on this already anyone?

There is a semi-complete implementation (i.e. no trigger procedures)
by Vello Kadarpik (vello@pyystel.ee).

He is probably waiting for fmgr redesign or somesuch to complete before
releasing it.

---------
Hannu

#3Karel Zak
zakkr@zf.jcu.cz
In reply to: Hannu Krosing (#2)
Re: Hello PL/Python

Comments? Works on this already anyone?

There is a semi-complete implementation (i.e. no trigger procedures)
by Vello Kadarpik (vello@pyystel.ee).

Cool! Is anywhere available this implementation?

Thanks.

Karel

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hannu Krosing (#2)
Re: Hello PL/Python

Hannu Krosing <hannu@tm.ee> writes:

There is a semi-complete implementation (i.e. no trigger procedures)
by Vello Kadarpik (vello@pyystel.ee).

He is probably waiting for fmgr redesign or somesuch to complete before
releasing it.

fmgr redesign is done as far as PL language handlers need be concerned.
I still have to turn the crank on converting individual old-style
functions to new-style (about half of the builtin functions are done
so far ... man, we have got a lot of them ...). But PL and trigger
handlers were done a couple months ago.

regards, tom lane

#5Noname
JanWieck@t-online.de
In reply to: Tom Lane (#4)
Re: Hello PL/Python

Tom Lane wrote:

Hannu Krosing <hannu@tm.ee> writes:

There is a semi-complete implementation (i.e. no trigger procedures)
by Vello Kadarpik (vello@pyystel.ee).

He is probably waiting for fmgr redesign or somesuch to complete before
releasing it.

fmgr redesign is done as far as PL language handlers need be concerned.
I still have to turn the crank on converting individual old-style
functions to new-style (about half of the builtin functions are done
so far ... man, we have got a lot of them ...). But PL and trigger
handlers were done a couple months ago.

PL/pgSQL (what you did) and PL/Tcl (done lately) are
converted to the new FMGR NULL-capabilities.

Dunno about PL/Perl.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #

#6Hannu Krosing
hannu@tm.ee
In reply to: Karel Zak (#1)
Re: Hello PL/Python

Tom Lane wrote:

Hannu Krosing <hannu@tm.ee> writes:

There is a semi-complete implementation (i.e. no trigger procedures)
by Vello Kadarpik (vello@pyystel.ee).

He is probably waiting for fmgr redesign or somesuch to complete before
releasing it.

fmgr redesign is done as far as PL language handlers need be concerned.
I still have to turn the crank on converting individual old-style
functions to new-style (about half of the builtin functions are done
so far ... man, we have got a lot of them ...). But PL and trigger
handlers were done a couple months ago.

Is some documentation available or just the source ?

Is the -fmgr mailing-list actually there ?
I got some cryptic messages when I tried to subscribe a while ago.

----------
Hannu

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hannu Krosing (#6)
Re: Hello PL/Python

Hannu Krosing <hannu@tm.ee> writes:

Tom Lane wrote:

fmgr redesign is done as far as PL language handlers need be concerned.

Is some documentation available or just the source ?

src/backend/utils/fmgr/README is all there is at the moment. Updating
the SGML docs is still on the to-do list.

Is the -fmgr mailing-list actually there ?

Darn if I know. I'm not on it ...

regards, tom lane

#8The Hermit Hacker
scrappy@hub.org
In reply to: Tom Lane (#7)
Re: Hello PL/Python

On Fri, 21 Jul 2000, Tom Lane wrote:

Hannu Krosing <hannu@tm.ee> writes:

Tom Lane wrote:

fmgr redesign is done as far as PL language handlers need be concerned.

Is some documentation available or just the source ?

src/backend/utils/fmgr/README is all there is at the moment. Updating
the SGML docs is still on the to-do list.

Is the -fmgr mailing-list actually there ?

Darn if I know. I'm not on it ...

it is actually there ... the only one of the new ones that has been seeing
any traffic, though, is the -oo one ...

#9Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Noname (#5)
Re: Hello PL/Python

handlers were done a couple months ago.

PL/pgSQL (what you did) and PL/Tcl (done lately) are
converted to the new FMGR NULL-capabilities.

Dunno about PL/Perl.

I don't think anyone knows about PL/Perl. :-) (It is broken on many
platforms.)

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#10Alex Pilosov
alex@pilosoft.com
In reply to: Bruce Momjian (#9)
Re: Hello PL/Python

On Wed, 26 Jul 2000, Bruce Momjian wrote:

handlers were done a couple months ago.

PL/pgSQL (what you did) and PL/Tcl (done lately) are
converted to the new FMGR NULL-capabilities.

Dunno about PL/Perl.

I don't think anyone knows about PL/Perl. :-) (It is broken on many
platforms.)

I believe that plperl failures are related to building perl as a shared
library which isn't done in many platforms. PL/Perl by itself seems pretty
darn stable to me.

Now, when PL/Perl will have some sort of SPI interface...That'd rock ;)
My idea was to implement SPI as a DBD driver, such as DBD::PgSPI, but I
don't have time to implement it...

-alex