With extension plpython3u.
docker run -p 5432:5432 lwzm/postgres
Enable plpython3u:
create extension plpython3u;
Test function:
CREATE OR REPLACE FUNCTION pymax (a integer, b integer)
RETURNS integer
AS $$
if a > b:
return a
return b
$$ LANGUAGE plpython3u;
create or replace function t() returns trigger language plpython3u as $$
import time
import requests
import os
time.sleep(1)
with open("/tmp/debug", "a") as f:
print(dir(), file=f)
print(globals(), file=f)
print(TD, file=f)
print(requests, file=f)
print(os.getcwd(), file=f)
$$;
Content type
Image
Digest
sha256:1b4032d83…
Size
151.2 MB
Last updated
almost 3 years ago
docker pull lwzm/postgres