Re: [HACKERS] rule system, perl and other good stuff

From: jwieck(at)debis(dot)com (Jan Wieck)
To: brett(at)work(dot)chicken(dot)org (Brett McCormick)
Cc: vadim(at)sable(dot)krasnoyarsk(dot)su, pgsql-hackers(at)hub(dot)org
Subject: Re: [HACKERS] rule system, perl and other good stuff
Date: 1998-02-11 09:25:44
Message-ID: m0y2YQL-000BFRC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)debis(dot)com (Jan Wieck) #

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 1998-02-11 09:36:03 Problem with the numbers I reported yesterday
Previous Message Jeroen van Vianen 1998-02-11 09:22:05 Some cleanups/enhancements