Ovenstående fejl kastet, da jeg forsøgte at oprette sprog plperlu. Det indikerer, at der mangler et bibliotek libperl.so. Tjek de trin, der er udført for at løse dette problem og oprette plperlu-sproget i PostgreSQL.
Metode 1 (finde libperl.so og lave softlink til den placering)
postgres=# create LANGUAGE plperlu;
ERROR: could not load library "/opt/PostgreSQL/9.0/lib/postgresql/plperl.so": libperl.so: cannot open shared object file: No such file or directory
postgres=# q
Søg nu efter filen libperl.so på din boks og tilføj denne placering til din LD_LIBRARY PATH. Glem ikke at skifte bruger til postgres.
[root@localhost /]# find -name libperl.so
./usr/lib/perl5/5.10.0/i386-linux-thread-multi/CORE/libperl.so
./usr/lib/perl5/CORE/libperl.so
./usr/lib/perl5/5.10.0/i386-linux-thread-multi/CORE
[root@localhost /]# su - postgres
Indstil LD_LIBRARY_PATH
-bash-4.1$ export LD_LIBRARY_PATH=/usr/lib/perl5/5.10.0/i386-linux-thread-multi/CORE:$LD_LIBRARY_PATH
Genstart klyngen for at udføre ændringerne.
-bash-4.1$ pg_ctl restart
waiting for server to shut down....... done
server stopped
server starting
Du er nu klar til at oprette sproget.
-bash-4.1$ psql
psql (9.0.1)
Type "help" for help.
postgres=# create LANGUAGE plperlu;
CREATE LANGUAGE
Metode 2 (Ved at installere den seneste ActivePerl)
Trin 1:
Når du har installeret ActivePerl, skal du indstille LD_LIBRARY_PATH.
postgres@localhost:/opt/ActivePerl-5.12/lib/CORE> export LD_LIBRARY_PATH=/opt/ActivePerl-5.12/lib/CORE:/opt/PostgreSQL/9.0/lib/postgresql
Trin 2:
postgres@localhost:/opt/PostgreSQL/9.0/lib/postgresql> ldd plperl.so
linux-vdso.so.1 => (0x00007fff8cf79000)
libperl.so => /opt/ActivePerl-5.12/lib/CORE/libperl.so (0x00007fbd3d654000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x00007fbd3d40a000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fbd3d206000)
libm.so.6 => /lib64/libm.so.6 (0x00007fbd3cfb0000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fbd3cd74000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007fbd3cb71000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fbd3c954000)
libc.so.6 => /lib64/libc.so.6 (0x00007fbd3c5f5000)
/lib64/ld-linux-x86-64.so.2 (0x00007fbd3dad8000)
Trin 3:
postgres@localhost:/opt/PostgreSQL/9.0/lib/postgresql> pg_ctl restart
postgres@localhost:/opt/PostgreSQL/9.0/lib/postgresql> psql
psql (9.0.2)
Type "help" for help.
postgres=# create language plperlu;
CREATE LANGUAGE
Send dine kommentarer.