2
是否可以從其他PL/Python塊的PL/Python函數調用Python函數作爲普通Python函數。從另一個PL/Python塊調用postgres PL/Python存儲函數
例如,我有一個函數F1:
create or replace function f1() returns text as $$
return "hello"
$$ language 'plpython3u';
我想調用其他函數或塊這個功能,例如這個匿名塊:使用t = plpy.execute("select f1()")
do $$
begin
...
t = f1()
...
end;
$$ language 'plpython3u';
這是可以做到,但我想,如果可能的話,將其稱爲正常的Python函數以避免類型轉換(例如jsonb等)。
(我正在使用plpython3u〜Python 3)。