我已经在 Windows 10、x64 上安装了 postgresql 9.5。
我在服务器路径上使用 python 3.3.5 创建了扩展 plpython3u,它似乎成功地创建了扩展:
SELECT * FROM pg_available_extensions
WHERE name like '%python%' order by name;
name | default_version | installed_version | comment
-------------------+-----------------+-------------------+------------------------------------------
-
hstore_plpython2u | 1.0 | | transform between hstore and plpython2u
hstore_plpython3u | 1.0 | | transform between hstore and plpython3u
hstore_plpythonu | 1.0 | | transform between hstore and plpythonu
ltree_plpython2u | 1.0 | | transform between ltree and plpython2u
ltree_plpython3u | 1.0 | | transform between ltree and plpython3u
ltree_plpythonu | 1.0 | | transform between ltree and plpythonu
plpython2u | 1.0 | | PL/Python2U untrusted procedural language
plpython3u | 1.0 | 1.0 | PL/Python3U untrusted procedural language
plpythonu | 1.0 | | PL/PythonU untrusted procedural language
(9 rows)
但是,当我尝试创建以下函数时(来自pg docs)
CREATE FUNCTION pymax (a integer, b integer)
RETURNS integer
AS $$
if a > b:
return a
return b
$$ LANGUAGE plpython3u;
psql(或 pgadmin3)终端的连接被重置。
路径上的 python 3.3 是 anaconda 的 distb,它自己运行良好。我在 postgresql 文档中找不到所需的 python 版本,并使用了这里所描述的依赖walker Postgres database crash when installed plpython以查找服务器 lib/ 中的 plpython3.dll 指向的所需 dll。
谁能帮我解决我错过的问题?
非常感谢