How add LD_LIBRARY_PATH before PostgreSQL 10.6 service start
-
Dear, i set up python 3.4 and PostgreSQL 10.6 on Oracle Linux 7.4. when i create plpython3u it's error. could not load library "/u01/PostgreSQL/10/lib/postgresql/plpython3.so": libpython3.4m.so.1.0: cannot open shared object file: No such file or directory then i add export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH in file ~/bash_profile Finally, i have to restart services postgreSQL : pg_ctl restart ==> it's ok. but when i reboot linux , it will be error again, i guess LD_LIBRARY_PATH load after service postgres start. How i Can resolve it ? Thank you !
-
Dear, i set up python 3.4 and PostgreSQL 10.6 on Oracle Linux 7.4. when i create plpython3u it's error. could not load library "/u01/PostgreSQL/10/lib/postgresql/plpython3.so": libpython3.4m.so.1.0: cannot open shared object file: No such file or directory then i add export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH in file ~/bash_profile Finally, i have to restart services postgreSQL : pg_ctl restart ==> it's ok. but when i reboot linux , it will be error again, i guess LD_LIBRARY_PATH load after service postgres start. How i Can resolve it ? Thank you !
There should be some information in the PostgreSQL installation guide as to how to set this up. But if not then I would guess it needs to be set in one of the /etc/rc startup scripts. You will need to check the Linux man pages to decide which one you should use.
-
Dear, i set up python 3.4 and PostgreSQL 10.6 on Oracle Linux 7.4. when i create plpython3u it's error. could not load library "/u01/PostgreSQL/10/lib/postgresql/plpython3.so": libpython3.4m.so.1.0: cannot open shared object file: No such file or directory then i add export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH in file ~/bash_profile Finally, i have to restart services postgreSQL : pg_ctl restart ==> it's ok. but when i reboot linux , it will be error again, i guess LD_LIBRARY_PATH load after service postgres start. How i Can resolve it ? Thank you !
You will need to add LD_LIBRARY_PATH to the startup script for postgres. It looks like Oracle Linux 7.4 is using systemd, so try adding the line
Environment=LD_LIBRARY_PATH=/u01/PostgreSQL/10/lib/postgresql
to /lib/systemd/system/postgresql.service. The best place for that would be right after the line that says Export=PGDATA=path-to-pgdata Meanwhile, I would follow Richard's advice and contact the PostgreSQL mailing list and ask there. They may have a better solution so that when you update to PGSQL 10.XX or 11.XX, you won't have to continually remember to edit the startup script.