是否可以通过plpgsql function
功能拨打PostgreSQL function
(或任何PL/Python
)?
所以,像这样:
CREATE FUNCTION somefunc() RETURNS void AS $$
DECLARE
...
BEGIN
...
END;
$$ LANGUAGE plpgsql;
然后在这里使用
CREATE FUNCTION pythonFunc() RETURNS void AS $$
...
someFunc() #postgreSQL function
...
$$ LANGUAGE plpythonu;
答案 0 :(得分:5)
create function plpython_function()
returns void as $$
plpy.execute('select plpgsql_function()')
$$ language plpythonu;