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

From jwieck@debis.com (Jan Wieck)
Subject Re: [HACKERS] rule system, perl and other good stuff
Date
Msg-id m0y2YQL-000BFRC@orion.SAPserv.Hamburg.dsh.de
Whole thread Raw
In response to Re: [HACKERS] rule system, perl and other good stuff  (Brett McCormick <brett@work.chicken.org>)
Responses Re: [HACKERS] rule system, perl and other good stuff  (Brett McCormick <brett@work.chicken.org>)
Re: [HACKERS] rule system, perl and other good stuff  (The Hermit Hacker <scrappy@hub.org>)
List pgsql-hackers
>
>
> okay... yes it can co-exist with CREATE LANGUAGE as long as it is
> coded into the server like fmgr_dynamic is.  it will not function as a
> CREATE LANGUAGE function.  this is because all that this functionality
> appears to do is associate a single function with a language.  but it
> does not pass the prosrc attribute (or probin for that matter) to the
> function, so no matter what you say for as 'insert code here', it
> never gets to the function, so the function has no idea what to do!
>
> I must be missing something.

    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: PL/Tcl
Next
From: Jeroen van Vianen
Date:
Subject: Some cleanups/enhancements