Re: symbol not found in plpgsql.so - Mailing list pgsql-hackers

From Tom Lane
Subject Re: symbol not found in plpgsql.so
Date
Msg-id 10610.970777591@sss.pgh.pa.us
Whole thread Raw
In response to symbol not found in plpgsql.so  ("Frederick W. Reimer" <fwr@ga.prestige.net>)
Responses Re: symbol not found in plpgsql.so  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
"Frederick W. Reimer" <fwr@ga.prestige.net> writes:
> I'm getting the following error when I add a row to a table that has a
> trigger set for a plpgsql function.  I did a nm on the plpgsql.so file and
> it lists CurrentMemoryContext as being in there, so I don't know why it
> can't find it.
> "DBD::Pg::st execute failed: ERROR:  Load of file
> /usr/local/pgsql/lib/plpgsql.so failed: ld.so.1:
> /usr/local/pgsql/bin/postmaster: fatal: relocation error: file
> /usr/local/pgsql/lib/plpgsql.so: symbol CurrentMemoryContext: referenced
> symbol not found"

No, you're interpreting this backward: the linker is complaining because
it can't find a CurrentMemoryContext symbol in the main program to bind
the .so's reference to.

You didn't say what platform you're on, but on lots of platforms it's
necessary to do something special to ensure that all symbols in a main
program are exported so that dynamically loaded shared libs can see
them.  (That's not normally the default behavior because the symbol
table space would be wasted in most programs, which don't do dynamic
loading of random .so files.)  On HPUX, for example, the loader has to
be given a -E switch when linking the postgres executable.  Dunno what
the incantation is where you live...

            regards, tom lane

pgsql-hackers by date:

Previous
From: "Frederick W. Reimer"
Date:
Subject: RE: [PORTS] symbol not found in plpgsql.so
Next
From: Peter Eisentraut
Date:
Subject: RE: New unified regression test driver