Questions about PostgreSQL's PL/Python procedural language. This extension allows one to write python-based triggers and functions inside of the PostgreSQL RDBMS.
Questions tagged [plpython]
166 questions
1
vote
1 answer
from python, how to write an integer into a (hex) bytea field
issue is this: in (pl)python code, we've calculated an integer = 26663.
Can easily convert this to hex using hex(myint) = 0x6827
So far so good!
Now, how to write this value -into a concatenation of strings- into a PostgreSQL (v9) bytea field? The…

DrLou
- 649
- 5
- 21
1
vote
1 answer
How to enable hstore_plpython3u
The extension hstore_plpython3u is supposed to transform hstore to/from python dict as described in the docs, but doesn't seem to work. The hstore becomes a string (no transform seems to happen). Why, and how to fix it?
The extensions for PL/Python…

Martin
- 97
- 1
- 6
1
vote
0 answers
Global variables implementation using plperl/plpython in postgres is throwing out of memory
We are actually migrating db from oracle to postgres. We are using postgreSQL 11.
So the packages are converted to procedures/functions accordingly.
For global variables implementation we used the local configuration setting as below
SET…

Abhishek Vijendra
- 33
- 5
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
Upgrade postgresql 9.6 -> postgresql 13 blocked by missing plpython2 extension, but I can't seem to remove the extension
I'm trying to upgrade a system from Postgresql 9.6 to Postgresql 13 using pg_upgrade shipped with Postgresql 13. This upgrade fails with the error:
Your installation references loadable libraries that are missing from the new installation. You…

user3741134
- 13
- 3
1
vote
1 answer
PostgresSQL could not load library plpython3.dll
I managed to install the plpython3u extention. But when I try to use a function that uses the extension I get:
ERROR: could not load library "C:/Program Files/PostgreSQL/12/lib/plpython3.dll": unknown error 126 SQL state: 58P01
I'm using windows…

Leonel Mota
- 11
- 2
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…

jiquvox
- 11
- 3
1
vote
2 answers
PostgreSQL 11: Error [57P03]: FATAL: the database system is in recovery mode
I'm trying to get the plpython3u language working in PostgreSQL 11 (I'm working on a Windows 10 machine).
I was able to successfully install it using the following command.
CREATE EXTENSION plpython3u;
I had to download python36.dll and save it in…

Bilesh Ganguly
- 3,792
- 3
- 36
- 58
1
vote
0 answers
plpythonu how to pass a text array to a plpythonu function?
How do I pass an array of text strings (phone numbers) as a parameter - recipients - to a python function, then translate it into a json payload?
Simplified, the CREATE STATEMENT:
CREATE OR REPLACE FUNCTION skebby_send(user_key text, session_key…

DrLou
- 649
- 5
- 21
1
vote
0 answers
Plpython UDF using PostgreSQL
I have a created a function that utilizes the sqlparse module to extract all of the tables hit from any given sql statement:
create or replace function my_function(x text) returns text
as $$
import sqlparse
from collections import namedtuple
from…

SQLNOOB
- 13
- 3
1
vote
1 answer
PosgreSQL 11 lost connection when i'm trying to create function with plpython3u [WIN10, pgAdmin4 3.5]
I have always problem with PosgreSQL when new version appears. Again I'm trying to install extension plpython3u and with this hint Error during: CREATE EXTENSION plpython3u; on PostgreSQL 9.6.0 I have created extension.
I added directory to PATH and…

pyer
- 85
- 1
- 1
- 6
1
vote
2 answers
Insert statement in plpython function greenplum database
I am creating a plpython function in greenplum.
for plpy.prepare("INSERT INTO ....") fails with error:
ERROR: plpy.SPIError: function cannot execute on segment because it issues a non-SELECT statement (plpython.c:4656) (seg4 slice1…

Deepak K M
- 521
- 1
- 5
- 13
1
vote
1 answer
Postgres PL/Python Initializing record functions
Is there a way to pass into a PL function that is called to give a default value and how do I work with it, the rest of the inserted values?
CREATE TABLE tokensStore (
id SERIAL PRIMARY KEY,
users INTEGER REFERENCES users(id),
genDate…

ekiim
- 792
- 1
- 11
- 25
1
vote
1 answer
Pl/python and Pl/r extensions in compose-for-postgresql
Good time of the day, wanted to ask if someone knows what is the way to install PostgreSQL extensions (to be exact, pl/r and pl/python) on IBM Bluemix cloud? I am running compose-postgresql database there and when I issue postgresql query such as…

Šemeš Roškovanul
- 23
- 4
1
vote
2 answers
In a PostgreSQL CHECK constraint using a boolean stored procedure written in PL/Python, can the detail of the error message be updated?
The qustion's in the (albeit long) title. I have code in this fashion:
-- create the tables for models
CREATE TABLE invoice(
id SERIAL PRIMARY KEY,
value VARCHAR(8)
CONSTRAINT valid_money CHECK(validate_invoice_money(value))
);
with…

Sam Weaver
- 1,027
- 16
- 30