Questions tagged [plpython]
An extension which allows one to write Python-based triggers and functions inside of the PostgreSQL RDBMS. Use this tag for questions about PostgreSQL's PL/Python Procedural Language.
27 questions
0
votes
0
answers
33
views
Streaming dataframe in pl/python from postgres?
The current reporting software we use only interacts with SQL databases. However, many of our datasets are now stored in formats other than SQL. I was thinking if it's possible to directly load and ...
1
vote
0
answers
51
views
Any issues with EDB Postgres, plpython3u, Psycopg on Apple Silicon?
I currently have an old Intel i7 based iMac. I plan to upgrade to the M4 Mac Mini (Apple silicon).
I am running Postgres and use plPython (plpython3u) internally for procedures and triggers. ...
0
votes
1
answer
129
views
After upgrade Postgres python is the same version
I upgraded my postgres from 13.5 to 16.2 version (and the RHEL from 7.5 to 8.9).
The problem is, python was not upgraded.
I created procedure pyver():
CREATE OR REPLACE FUNCTION pyver ()
RETURNS TEXT
...
-1
votes
1
answer
48
views
Incremental learning PLPython(3)u
Is there a way to use incremental machine learning with plpython3u in postgres database?
1
vote
1
answer
161
views
How to improve custom aggregate function performance & identify bottlenecks
This is a continuation of a question I asked on the best way to compute statistics on a list of rows unique per column, which can be found here (along with the table schema)
I have a table, which ...
0
votes
0
answers
83
views
Calculating aggregates grouped by column WITHOUT aggregate functions
I have a table which contains stock data for various companies. The data goes back as far as 2003, and there are approx 40M rows for each timeframe.
CREATE TABLE stocks_data.bars (
timeframe ...
0
votes
0
answers
82
views
PostgreSQL: Python UDF not shown in query plan obtained by EXPLAIN ANALYZE
I have a question regarding the execution of a Python UDF. Let's suppose I have a UDF named testUDF(...) and I apply it to table "testtable". When I run the query SELECT testUDF(...) from ...
3
votes
1
answer
4k
views
Extension "plpythonu" is not supported by Amazon RDS
I am trying to install extension "plpython3u" that supports writing python in postgresql.
CREATE EXTENSION plpython3u;
Error:
SQL Error [22023]: ERROR: Extension "plpythonu" is ...
0
votes
1
answer
199
views
Can you run PL/Python or PL/v8 code from the database itself?
It it possible to run code that is stored in the database, on the database.
For example, I'd like a trigger to execute a function whose Javascript code is stored in the same database. (Normally, ...
0
votes
1
answer
272
views
Passing a python list into plpy execute for the in operator without string interpolation
I have a plpython query for an 'in' where clause
user_ids = [1,2,3]
query = "SELECT department from users where id in ($1)"
prepared_query = plpy.prepare(query, ['bigint'])
...
6
votes
2
answers
5k
views
When (or why even) use PLPython(3)u
As I gain more experience with PostgreSQL I start to question the existence of PLPython. It's considered an "untrusted" language https://www.postgresql.org/docs/10/plpython.html
What I am ...
0
votes
1
answer
146
views
Is there an efficient way to use 3rd party packages in PL/Python?
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 ...
0
votes
1
answer
544
views
how can I divide log files for specific DB queries?
Currently my db has a couple of triggers for some (not all) tables that get executed when a specific number of columns has been updated. I keep track if the triggers for those rows on a boolean column ...
2
votes
1
answer
607
views
Can plpython3u open files on the file system?
I am trying to write a plpython3u function that should open a file in the file system and read some values out of it that get returned by a query. But I am getting a permission denied error when doing ...
1
vote
3
answers
997
views
How to get YAML Python Library in PostgreSQL
I would like to use YAML in some plpython code, but YAML is not included in the python3 extension for PostgreSQL.
My 'import yaml' gets an error that it cannot find yaml.
On my regular Python3 ...