Questions tagged [postgres-plpython]

16 questions
5
votes
1 answer

could not load library plpython3.dll

I am getting an error while creating an extension in Postgresql version 10 could not load library "C:/Program Files/PostgreSQL/10/lib/plpython3.dll": The specified module could not be found CREATE EXTENSION plpython3u; Note: Using Postgresql 10…
Rahul Gour
  • 487
  • 2
  • 7
  • 21
3
votes
1 answer

Can python venv be used with plpython3u for postgresql?

I would like plpython3u to use a virtual environment for python. I have seen some (old and not particularly clear) instructions for virtualenv at PostgreSQL PL/Python: call stored procedure in virtualenv. However I havent seen anything for python…
3
votes
1 answer

Use PostgreSQL plpython3u function to return a table

I wanna return table. The function get an array(the query is 'select function_name(array_agg(column_name)) from table_name') I coded below: create type pddesctype as( count float, mean float, std float, min float ); create function…
siena
  • 39
  • 3
3
votes
0 answers

server closed the connection unexpectedly in postgresql while compiling plpytghon3u function

While defining a PL/Python function in psql, I get the error: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The function: CREATE OR REPLACE…
Rahul Gour
  • 487
  • 2
  • 7
  • 21
2
votes
1 answer

problem to access of the properties of an edge when using plpython3u in PostgreSQL to create functions

I implement python function for for the following query and i get correct answer, but when i try to create functions in postgreSQL by using plpython3u extension, it doesn't have any error but still doesn't return the results to the table. Also, I…
2
votes
4 answers

Install PL/Python on Windows for PostgreSQL 12

I've been working on FHIR for a project and we are using PostgreSQL as a database. While reading docs, I've come to know about PL/Python and decided to give it a shot but I am unable to install the python extension. When I run the command CREATE…
Khizar Iqbal
  • 435
  • 2
  • 11
  • 18
2
votes
2 answers

Handling backslashes in plpython

CREATE OR REPLACE FUNCTION CLEAN_STRING(in_str varchar) returns varchar AS $$ def strip_slashes(in_str): while in_str.endswith("\\") or in_str.endswith("/"): in_str = in_str[:-1] in_str = in_str.replace("\\", "/") return…
Deepak K M
  • 521
  • 1
  • 5
  • 13
1
vote
1 answer

PostgreSQL: PL/Python function not taking ARRAY input parameter

Objective: Creating a full text search engine using PostgreSQL FTS. Populating tsvector: I have a tsvector column. To populate tsvector column, I am executing a trigger which calls a procedure which executes a custom PL/Python function. Steps…
Kaushik Acharya
  • 1,520
  • 2
  • 16
  • 25
1
vote
1 answer

Cannot install plpython for postgres 12

First off , my question is posted after reading many other questions like this one Install PL/Python on Windows for PostgreSQL 12 and various trials of previous methods and comments. But I ve been stuck for about a month and half now when trying to…
1
vote
0 answers

PL/Python is not able to access system variables (LD_LIBRARY_PATH)

I've been trying to create some custom functions in postgresql using PL/Python. However some python libraries import fail because PL/Python has no access to the LD_LIBRARY_PATH variable: CREATE OR REPLACE FUNCTION pyfunc(smiles text) RETURNS…
dvidmon
  • 11
  • 2
0
votes
0 answers

Using dask delayed function from within postgresql plpython with "plpy.execute"

The below example demonstrates using dask delayed funtions (ref) from within postgres plpython while using "plpy.execute" (ref) to query the database. It returns an error: ERROR: spiexceptions.StatementTooComplex: stack depth limit exceeded Any…
Shadi
  • 9,742
  • 4
  • 43
  • 65
0
votes
1 answer

plpython3: can a function return a 'class' or 'generator' object to a query

I am running a docker container with a postgres image. The image includes python3, pandas, and networkx. The combination allows me to construct a graph from the db data all within the postgres environment. I want to be able to retrieve the graph…
MikeB2019x
  • 823
  • 8
  • 23
0
votes
0 answers

Error while running plpython function in postgresql

I have Postgresql 12.8.1 version and python 3.7.6 version installed on my system. I want to create a trigger function using plpython so I created plpython3 extension using CREATE EXTENSION plpython3u . While trying to compile the trigger function, I…
0
votes
0 answers

two dimensional arrays not supported in postgresql 9x

Following is the Pl/Python function return 2D array: CREATE FUNCTION return_multidim_py_array(x int4[]) RETURNS int4[] AS $$ plpy.info(x, type(x)) return x $$ LANGUAGE plpythonu; SELECT * FROM return_multidim_py_array(ARRAY[[1,2,3],…
0
votes
1 answer

How to update a Postgresql table using a composite type

I am trying to update a table using a composite key, and can't figure out the syntax. I have a table defined as: create schema test; create type test.ra_dec as (f1 double precision, f2 double precision); create table test.pos_vel( xp double…
Greg Hennessy
  • 467
  • 3
  • 5
  • 17
1
2