Table of Contents
参考
实例
方法一
1.configure指定参数
./configure 改为 ./configure --with-python
## 然后正常安装即可
2.登陆用户
psql -U postgres -d postgres
3.创建语言
postgres=# create extension plpython2u;
postgres=# create extension plpythonu;
4.确认plpython是否添加成功
postgres=# select * from pg_language
方法二
说明
## 在安装的时候没有加参数--with-python的安装方法
1.将源码包放入你的工作目录/work
2.解压源码包
3.进入源码包中
cd /work/postgresql-x.x.x
4.编译源码包
./configure --with-python --prefix=${source_dir}
make
su
make install
#其中目录source_dir有自己指定
5.将编译后获得的extension/plpython放入$PGHOME/share/extension/
cp ${source_dir}/share/postgresql/extension/plpython* $PGHOME/share/extension/
6.将编译后获得的plpython2.so放入$PGHOME/share/extension/
cp ${source_dir}/lib/postgresql/plpython2.so ${PGHOME}/lib/
7.登陆用户
postgres=# psql -U postgres -d postgres
8.创建语言
postgres=# create extension plpython2u;
postgres=# create extension plpythonu;
9.确认plpython是否添加成功
select * from pg_language;
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




