Sample Header Ad - 728x90

Is there an efficient way to use 3rd party packages in PL/Python?

0 votes
1 answer
130 views
I've found examples of people importing 3rd party packages into PL/Python scripts, but it seems to me that re-importing libraries upon every run of a stored procedure is terribly inefficient. Does Postgres maintain a process-wide python interpreter that's re-used for subsequent PL/Python script executions? If so, is there any way to have it execute import statements in that context BEFORE a PL/Python procedure runs? Alternatively, would it be possible/practical to provide a C-compatible dynamically-linked library that hosts a persistent Python interpreter?
Asked by feuGene (101 rep)
May 16, 2020, 03:43 AM
Last activity: May 16, 2020, 03:46 PM