Обсуждение: $libdir under linux

Поиск
Список
Период
Сортировка

$libdir under linux

От
Marios Vodas
Дата:
I want to create this function:<br /><div style="margin-left:40px;font-family:courier new,monospace">CREATE OR REPLACE
FUNCTIONmyfunction(cstring)<br />RETURNS cstring AS<br />    '$libdir/mylib','myfunction'<br /> LANGUAGE 'C' IMMUTABLE
STRICT;<br/></div><br />In windows this is working fine and $libdir is substituted by the actual path. In linux it is
notsubstituted!<br />This is the error I get:<br /><div style="margin-left: 40px; font-family: courier new,monospace;">
ERROR: could not access file "$libdir/mylib": No such file or directory<br />SQL state: 58P01<br /></div><br />How do I
fixit?  

Re: $libdir under linux

От
Tom Lane
Дата:
Marios Vodas <mvodas@gmail.com> writes:
> I want to create this function:
> CREATE OR REPLACE FUNCTION myfunction(cstring)
> RETURNS cstring AS
>     '$libdir/mylib','myfunction'
> LANGUAGE 'C' IMMUTABLE STRICT;

> In windows this is working fine and $libdir is substituted by the actual
> path. In linux it is not substituted!

I rather doubt that, considering that it works fine for everybody else.

> This is the error I get:
> ERROR:  could not access file "$libdir/mylib": No such file or directory

So is mylib.so actually there in the library directory?  (Try
"pg_config --pkglibdir" to confirm which directory that is.)
If so, try ldd on it --- maybe the problem is with some library
it references, not mylib.so itself.
        regards, tom lane