[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

create and run a plpgsql function in postgresql

This is Debian Woody.

Package: postgresql Version: 6.5.3-12
Package: postgresql-pl Version: 6.5.3-12

I can't get the functions in plpgsql to work. Is it a Debian
problem, a postgresql problem or is it a beginner error from my
part? Details:

First I  try to create and run a simple function:
tstlang=> create function en() returns int as '
tstlang'> begin return 1; end;
tstlang'> ' language 'plpgsql';
tstlang=> select en() as result;
ERROR:  stat failed on file '@expanded_libdir@/plpgsql@DLSUFFIX@': No such file or directory
tstlang=> \q

i notice that function plpgsql_call_handler() is suspiciously  
defined as:

with locate i found the library in

I tried to change the function 

tstlang=> drop function plpgsql_call_handler();
tstlang=> CREATE FUNCTION plpgsql_call_handler () RETURNS OPAQUE AS
tstlang-> '/usr/lib/postgresql/lib/plpgsql.so' LANGUAGE 'C';

After that, I get..

tstlang=> select en() as result;
ERROR:  fmgr_info: function 18496: cache lookup failed

If I drop and recreate the function after this, I get the same
error including the same number(18496)

Any ideas?

Johan Ur Riise

Reply to: