Re: $libdir not working

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Scott Geller <sgellergsu(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: $libdir not working
Date: 2010-03-06 15:42:06
Message-ID: 29732.1267890126@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Scott Geller <sgellergsu(at)gmail(dot)com> writes:
> I'm trying to run the code:
> CREATE FUNCTION plr_call_handler()
> RETURNS LANGUAGE_HANDLER
> AS '$libdir/plr' LANGUAGE C;

> and getting the error:
> An error occurred when executing the SQL command:
> CREATE FUNCTION plr_call_handler()
> RETURNS LANGUAGE_HANDLER
> AS '$libdir/plr' LANGUAGE C

> ERROR: could not access file "$libdir/plr": No such file or directory
> [SQL State=58P01]

> Yet, I'm able to create the function with no problem when I run:
> CREATE FUNCTION plr_call_handler()
> RETURNS LANGUAGE_HANDLER
> AS '/usr/lib/postgresql/plr' LANGUAGE C;

> I found the location by running in bash:
> pg_config --pkglibdir

Huh. "pg_config --pkglibdir" is definitely meant to print the same
directory that is substituted for "$libdir". Are you sure you are
invoking the copy of pg_config that goes with the postgres backend
executable you're using? Also, the path is usually calculated relative
to the location of the program, so putting pg_config in a different
directory than the postgres executable is in could make it give bogus
results.

> I then tried to edit postgresql.conf by adding the line:
> dynamic_library_path = '/usr/lib/postgresql:$libdir'

This setting is not relevant to your problem. The meaning of $libdir
is wired in, for a particular build and installation location.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message venkatrao.b 2010-03-08 05:10:04 How to read oracle table's data from postgre
Previous Message Michael Wood 2010-03-06 11:52:43 Re: [NOVICE] How to find details of arguments in all functions in postgre - One solution