Re: [HACKERS] rule system, perl and other good stuff - Mailing list pgsql-hackers

From Brett McCormick
Subject Re: [HACKERS] rule system, perl and other good stuff
Date
Msg-id 199802110938.BAA30903@abraxas.scene.com
Whole thread Raw
In response to Re: [HACKERS] rule system, perl and other good stuff  (jwieck@debis.com (Jan Wieck))
List pgsql-hackers
I certainly was.  It should be easy to switch over to using the
dynamic PL mechanism.  I hope to investing some time into it into the
next few weeks to get it up to snuff.  It will accept a package
function or an anonymous sub ref as the AS clause src.  Strings and
integers are passed as scalars, and everything else is passed as a
Postgres::Type.  I was debating whether to make them
Postgres::Type::datetime (to add type-specific methods in .pm files?)
A scalar, array or Postgres::Type can be returned and will be cast
automatically (if need be).

On Wed, 11 February 1998, at 10:25:44, Jan Wieck wrote:

>
>     Think  so.  Using the dynamic language interface, the handler
>     is called by fmgr_pl() and one of the arguments is the Oid of
>     the  called  PL  function.  So the handler has to do a system
>     cache lookup  on  pg_proc  (at  least  the  first  time  this
>     function is called) to get the prosrc attribute. The AS '...'
>     text on CREATE FUNCTION  will  be  found  there  for  dynamic
>     languages.  It's  handler  specific  what  it expects in this
>     attribute. For PL/Tcl it's the procedures body and it  builds
>     a  Tcl  proc around it after analyzing pg_proc and some other
>     system catalogs. The Tcl proc's name  contains  the  Oid,  so
>     overloading  functions with different parameter types isn't a
>     problem.
>
>     A few minutes ago I sent down the PL/Tcl  directory  to  this
>     list.  Look at it and reuse anything that might help to build
>     PL/perl.  I really hope that PL/perl and PL/Tcl appear in the
>     6.3 distribution. I'll do whatever I can to make this happen.
>
> >
> > On Tue, 10 February 1998, at 23:29:39, Brett McCormick wrote:
> >
> > > I don't see CREATE LANGUAGE in the grammar file...  are you asking if
> > > it is strictly compatible or if it uses the dynamic language interface?
> > > there's no reason it shouldn't be compatible..
> > >
> > > On Wed, 11 February 1998, at 14:26:23, Vadim B. Mikheev wrote:
> > >
> > > > One question: is your perl language support compatible with
> > > > new dynamic language interface (CREATE LANGUAGE etc) ?
> > > >
> > > > Vadim
> >
> >
>
>
> Until later, Jan
>
> --
>
> #======================================================================#
> # It's easier to get forgiveness for being wrong than for being right. #
> # Let's break this rule - forgive me.                                  #
> #======================================== jwieck@debis.com (Jan Wieck) #
>
>

pgsql-hackers by date:

Previous
From: jwieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] rule system, perl and other good stuff
Next
From: Michael Meskes
Date:
Subject: Problem with the numbers I reported yesterday