Re: CurrentMemoryContext - Mailing list pgsql-general

From Tom Lane
Subject Re: CurrentMemoryContext
Date
Msg-id 5919.973609407@sss.pgh.pa.us
Whole thread Raw
In response to CurrentMemoryContext  (Bob Parkinson <rwp@biome.ac.uk>)
Responses Re: CurrentMemoryContext  (Bob Parkinson <rwp@biome.ac.uk>)
List pgsql-general
Bob Parkinson <rwp@biome.ac.uk> writes:
> Is CurrentMemoryContext a postgres symbol that I can link against?

Yes, it should be accessible to shared libs that are loaded into a
backend.

> accessable to postgres, as a .so, and perl. The .so bit works, but I'm
> trying to now build the Perl module calling the C code. I'm getting

> Undefined symbol "CurrentMemoryContext"

If I'm visualizing your setup correctly, you are trying to load this
code into a Perl executable?  It's not going to work to load backend
code into Perl, because none of the backend support routines are going
to be accessible.  Probably CurrentMemoryContext is just by chance the
first unresolvable symbol the linker found --- there'll be more if you
get past that one.

Code that's supposed to go into non-backend contexts shouldn't be using
any Postgres-specific include files...

            regards, tom lane

pgsql-general by date:

Previous
From: Ned Lilly
Date:
Subject: announce list?
Next
From: Bob Parkinson
Date:
Subject: Re: CurrentMemoryContext