Thread: Hello PL/Python

Hello PL/Python

From
Karel Zak
Date:
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 :-)



Re: Hello PL/Python

From
Hannu Krosing
Date:
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


Re: Hello PL/Python

From
Karel Zak
Date:
> >  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



Re: Hello PL/Python

From
Tom Lane
Date:
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


Re: Hello PL/Python

From
JanWieck@t-online.de (Jan Wieck)
Date:
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 #




Re: Hello PL/Python

From
Hannu Krosing
Date:
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


Re: Hello PL/Python

From
Tom Lane
Date:
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


Re: Hello PL/Python

From
The Hermit Hacker
Date:
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 ...




Re: Hello PL/Python

From
Bruce Momjian
Date:
> > 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,
Pennsylvania19026
 


Re: Hello PL/Python

From
Alex Pilosov
Date:
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