我想在我的postgresql数据库中使用python3来编写存储过程.
在psql客户端,当我输入命令create extension plpython3u时,我得到错误:
Couldn't open extension control file /usr/share/postgresql/9.1/extension/plpython3u.control : No such file or directory
我已经检查过,目录中有plpythonu.control和plpython2u.control,但不是版本3的那个.
但是我从软件仓库安装了软件包python3和python3-postgresql(以及其他软件包).我正在使用Ubuntu 12.04,内核3.2.0.38,安装了postgresql 9.1.
我应该安装(或做)在我的机器上安装plpython3u.control文件并在我的数据库中使用python3?
解决方法:
通过依赖关系,这将安装postgresql-plpython3-9.1,它提供以下文件:
$dpkg -L postgresql-plpython3-9.1 /. /usr /usr/share /usr/share/doc /usr/share/doc/postgresql-plpython3-9.1 /usr/share/doc/postgresql-plpython3-9.1/copyright /usr/share/postgresql /usr/share/postgresql/9.1 /usr/share/postgresql/9.1/extension /usr/share/postgresql/9.1/extension/plpython3u--1.0.sql /usr/share/postgresql/9.1/extension/plpython3u.control /usr/share/postgresql/9.1/extension/plpython3u--unpackaged--1.0.sql /usr/lib /usr/lib/postgresql /usr/lib/postgresql/9.1 /usr/lib/postgresql/9.1/lib /usr/lib/postgresql/9.1/lib/plpython3.so /usr/share/doc/postgresql-plpython3-9.1/changelog.Debian.gz
然后你可以这样做:
postgres=# create extension plpython3u;
CREATE EXTENSION
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。