Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Linux Programming
  4. How add LD_LIBRARY_PATH before PostgreSQL 10.6 service start

How add LD_LIBRARY_PATH before PostgreSQL 10.6 service start

Scheduled Pinned Locked Moved Linux Programming
postgresqllinuxpythonoraclehelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Ngoc tuan nguyen
    wrote on last edited by
    #1

    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 !

    L K 2 Replies Last reply
    0
    • N Ngoc tuan nguyen

      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 !

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • N Ngoc tuan nguyen

        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 !

        K Offline
        K Offline
        k5054
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups