Thread: createlang doesn't work

createlang doesn't work

From
R.Welz
Date:
Hello.
What do I have to do to install plpgsql ?

I tried as root:
/usr/local/pgsql/bin/createlang plpgsql test
to enable plpgsql in database test, but I always get the message:
language installation failed: ERROR: could not access file
"$libdir/plpgsql": File or dir not found.

$libdir is undefined and the file plpgsql is not on my HD. Do I
eventually have to change ./configure-options somehow? I cannot find
./configure options for this, so which one can I add?

Thanks for help,
Robert


Re: createlang doesn't work

From
Tom Lane
Date:
"R.Welz" <linuxprodukte@gmx.de> writes:
> What do I have to do to install plpgsql ?

How exactly did you build and install Postgres?  Ordinarily this
should "just work", but it appears that you either do not have
plpgsql.so at all, or it's installed in the wrong place, or possibly
it's there but refers to other shared libraries that aren't there
(which would suggest that you're trying to use a plpgsql.so that
is built for a different platform).

> I tried as root:
> /usr/local/pgsql/bin/createlang plpgsql test

You should not be root for this, you should be the postgres superuser.
It's really not a good idea to use root for tasks that don't need it.

> to enable plpgsql in database test, but I always get the message:
> language installation failed: ERROR: could not access file
> "$libdir/plpgsql": File or dir not found.

$libdir here refers to the directory printed by "pg_config --pkglibdir",
and despite the lack of any .so extension on the name, postgres will
try it with .so appended (or .sl or whatever shared-library extension
your platform uses).

            regards, tom lane

Re: createlang doesn't work

From
R.Welz
Date:
Ok. It seems that I had no libs in $libdir.
I ./configure(d), make, make install again with little changes and
everything is fine now. I have just installed plpgsql to one of my
databases.

Here is what worked:
./configure --prefix=/usr/local/pgsql --enable-threads=posix
--mandir=/usr/share/man --enable-nls=de,en --with-perl
--enable-thread-safety

Here is what I had before and what delivered only a plperl.so in
/usr/lib/postgresql:

./configure --enable-threads=posix --with-local-prefix=/usr/local
--mandir=/usr/share/man --libdir=/usr/lib --enable-nls=de,en
--with-perl --enable-thread-safety

But now everything is fine, thanks for help

Greetings,
Robert