20 questions
0
votes
0
answers
140
views
python function for plpython3u
I have a python function that works perfectly, but I need to pass it to plpython3u (don't ask me why, juniors only obey)
python function:
import cryptography.hazmat.primitives.serialization.pkcs12 ...
0
votes
0
answers
269
views
how to download modules to use with plpython postgresql
I'm trying to use plpython3u with postgresql on windows 11, and I want to use the requests library to make http requests..
So I did this test function:
CREATE OR REPLACE FUNCTION teste()
...
0
votes
0
answers
453
views
ERROR: could not load library plpython3u postgresql
I'm trying to install the plpython3u extension in my postgresql with this command: CREATE EXTENSION plpython3u;
mas eu recebo este erro:
ERROR: could not load library "C:/Program Files/PostgreSQL/...
1
vote
0
answers
74
views
plpython3u anaconda environment
I am trying to use an anaconda environment inside my plpython3u function in postgres 15.
Here is what I tried so far:
DROP FUNCTION use_anaconda_env();
CREATE OR REPLACE FUNCTION use_anaconda_env()
...
2
votes
1
answer
196
views
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 ...
0
votes
0
answers
42
views
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: ...
0
votes
1
answer
108
views
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 ...
0
votes
0
answers
494
views
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 ....
1
vote
1
answer
399
views
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 ...
1
vote
1
answer
1k
views
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 ...
6
votes
1
answer
786
views
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 ...
3
votes
4
answers
7k
views
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 ...
0
votes
0
answers
261
views
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 * ...
1
vote
0
answers
148
views
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 ...
3
votes
1
answer
3k
views
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,
...
2
votes
2
answers
187
views
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]
...
3
votes
0
answers
1k
views
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 ...
5
votes
1
answer
14k
views
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 ...
0
votes
1
answer
2k
views
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 ...
0
votes
1
answer
104
views
Simple PLPythonu function not visible
I'm working with PLPython3u in Postgres 9.6. I have installed the extra package under Ubuntu and this code runs:
response = db.query([[
CREATE or REPLACE FUNCTION bytea_import() RETURNS void as $$
...