Thread: stat failed on /usr/lib/pgsql/plpgsql.so; no file or directory

stat failed on /usr/lib/pgsql/plpgsql.so; no file or directory

From
"Ed Bras"
Date:

I am using psql for about the first time and created some tables and triggers with their functions written in PL/pgSQL... No errors so far.

I loaded the plpgsql.so (which I wrote down at het bottom of the mail) with neither an error.

However when I ecxute a very simple short function which has the language set to plpgsql it gives me the following error: "stat failed on /usr/lib/pgsql/plpgsql.so; no file or directory"

Anyone an idea what the problem is ?? The directory /usr/lib/pgsql/ excits but has the owner set to root. I changed the owner of the file to postgres, but as postgres executing the small program it still gave me the same error (postgres had read and write error to the file but not to the directory)

It is probably a "right error" but which rights should I give the directory without everyone accessing them ?

But when it can locate the file, then why doen't it give the same error when you declare the pl/pgsql handler ?

Can someone tell me where he has this file located and who are the owner of the file and path as well as the rights ?

I noticed that in the example in the documentation they locate the plpgsql.so file in /usr/local/pgsql/lib/, which is not were it resides on my machine !!

Regards,

Ed Bras

 

CREATE FUNCTION plpgsql_call_handler () RETURNS OPAQUE AS

'/usr/lib/pgsql/plpgsql.so ' LANGUAGE 'C';

CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'

HANDLER plpgsql_call_handler

LANCOMPILER 'PL/pgSQL';----

RE: stat failed on /usr/lib/pgsql/plpgsql.so; no file or directory

From
"Ed Bras"
Date:
I can do a ls /usr/lib/pgsql/plpgsql.so with no problem.
By the way:
1: I am using Red hat 6.0 with kernel 2.2.52.
2: What shloud be the rights and the ownership of the plpgsql file and those
of the directories where it in ? (I haven't changed any of these after the
installation).

Please let me know if anyone has any ideas ?

Regards,
Ed Bras


-----Original Message-----
From: mack@ips.cs.tu-bs.de [mailto:mack@ips.cs.tu-bs.de]
Sent: vrijdag 21 januari 2000 14:24
To: e.bras@hccnet.nl
Subject: Re: stat failed on /usr/lib/pgsql/plpgsql.so; no file or
directory


> I am using psql for about the first time and created some tables and
triggers with their functions written in PL/pgSQL... No errors so far.
>
> I loaded the plpgsql.so (which I wrote down at het bottom of the mail)
with neither an error.
>
> However when I ecxute a very simple short function which has the language
set to plpgsql it gives me the following error: "stat failed on
/usr/lib/pgsql/plpgsql.so; no file or directory"
>
Try: ls /usr/lib/pgsql/plpgsql.so as user postgres.
If it doesn't show you the file, the problem should be clear.

Otherwise? Don't know for the moment...

Thomas Mack
TU Braunschweig, Abt. Informationssysteme


Hello Ed,

Once, Friday, January 21, 2000, 11:47:07 PM, you wrote:

EB> I can do a ls /usr/lib/pgsql/plpgsql.so with no problem.
EB> By the way:
EB> 1: I am using Red hat 6.0 with kernel 2.2.52.
EB> 2: What shloud be the rights and the ownership of the plpgsql file and those
EB> of the directories where it in ? (I haven't changed any of these after the
EB> installation).

EB> Please let me know if anyone has any ideas ?

EB> Regards,
EB> Ed Bras


EB> -----Original Message-----
EB> From: mack@ips.cs.tu-bs.de [mailto:mack@ips.cs.tu-bs.de]
EB> Sent: vrijdag 21 januari 2000 14:24
EB> To: e.bras@hccnet.nl
EB> Subject: Re: stat failed on /usr/lib/pgsql/plpgsql.so; no file or
EB> directory


>> I am using psql for about the first time and created some tables and
EB> triggers with their functions written in PL/pgSQL... No errors so far.
>>
>> I loaded the plpgsql.so (which I wrote down at het bottom of the mail)
EB> with neither an error.
>>
>> However when I ecxute a very simple short function which has the language
EB> set to plpgsql it gives me the following error: "stat failed on
EB> /usr/lib/pgsql/plpgsql.so; no file or directory"
>>
EB> Try: ls /usr/lib/pgsql/plpgsql.so as user postgres.
EB> If it doesn't show you the file, the problem should be clear.

EB> Otherwise? Don't know for the moment...

EB> Thomas Mack
EB> TU Braunschweig, Abt. Informationssysteme


EB> ************

I had the same problem and I resolved it by changing mklang_pl.sql
file in /usr/lib/postgresql/lib. I have changed there path to
plpgsql.so, there was something like

create function plpgsql_call_handler() returns opaque
        as '$POSTGRESDIR/plpgsql.so'
        language 'C';

and I have changed this to

create function plpgsql_call_handler() returns opaque
        as '/usr/lib/postgresql/lib/plpgsql.so'
        language 'C';

and then droped pgsql language and reran mklang_pl.sql

Best regards,
 Yury  ICQ 11831432
 mailto:yura@vpcit.ru