我正在处理debian jessie
我已经安装了语言:
aptitude install postgresql-plpython3然后:
% createlang plpython3u template1然后:
% psql
postgres=# CREATE LANGUAGE plpython3u;我已经尝试过这个函数:
Create or replace function test() returns void as $$
print('Bonjour le monde')
$$ language plpython3u;我试着强迫db:
createlang plpython3u db_test我得到的信息是,它已经安装,所以我不知道还能做什么??
发布于 2015-12-12 05:28:08
您不能使用print。改为使用sys.stderr,输出将记录在/var/log/ postgresql /postgresql- X.X -main.log中(用您的postgresql版本替换X.X)
Create or replace function test(text) returns void as $$
import sys
name = args[0]
sys.stderr.write('Bonjour {}\n'.format(name))
$$ language plpython3u;
select test('sardon');https://stackoverflow.com/questions/33922749
复制相似问题