How to install 3rd party module for postgres pl/python?

后端 未结 3 1571
谎友^
谎友^ 2020-12-30 00:47

I need to import a 3rd party module inside my pl/python function. It seems pl/python uses an internal python that does not have any 3rd party modules.

I get this kin

3条回答
  •  梦毁少年i
    2020-12-30 01:30

    Since modifying PYTHONPATH of postgres user will likely need a server restart, it's somewhat easier to add the path from within Python, via

    from sys import path
    path.append( '/path/to/your/module' )
    

提交回复
热议问题