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 $$
print("foo")
$$ LANGUAGE plpython3u;
]])
response = db.query("SELECT bytea_import();")
The second line runs the code without error but if I look in Postgres after running this code, with \df <schema>.*
the function does not exist. Once defined, should the function not be in the database?
List of functions
Schema | Name | Result data type | Argument data types | Type
--------+------+------------------+---------------------+------
(0 rows)
The function can be viewed with
\df+ bytea_import
. And it can be dropped withDROP FUNCTION bytea_import();
. If there are parameters, these need to be listed in the DROP FUNCTION as well.