Re: Package support for Postgres - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Package support for Postgres
Date
Msg-id Pine.LNX.4.30.0110191909270.640-100000@peter.localdomain
Whole thread Raw
In response to Re: Package support for Postgres  (Bill Studenmund <wrstuden@netbsd.org>)
Responses Re: Package support for Postgres
List pgsql-hackers
Bill Studenmund writes:

> > create function produce(text) returns text as '
> >     GD["key"] = args[0]
> > ' language plpython;
> >
> > create function consume() returns text as '
> >     return GD["key"]
> > ' language plpython;
> >
> > There is also a dictionary for private data.
>
> Private to what?

Private to the procedure, but saved across calls (during one session).

> Oh, by shared memory, do you mean SYSV Shared Memory (like how the
> backends talk) or just memory shared between routines? I ask as part of
> the idea with these variables is that they are backend-specific. So C
> routines actually should NOT used SYSV Shared Mem. :-)

Yes, you're right.  Actually, sharing data across PostgreSQL C functions
is trivial because you can just use global variables in your dlopen
modules.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter



pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: Catalogs design question
Next
From: Peter Eisentraut
Date:
Subject: Re: Compiling on Solaris with Sun compiler