加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

编译 postgresql --with -python

发布时间:2020-12-13 17:30:40 所属栏目:百科 来源:网络整理
导读:createlang plpythonu postgres; createlang: "$libdir/plpython2": No su ch file or directory CREATE LANGUAGE plpythonu; create language 'plpythonu'; select version(); select tmplname,tmplhandler,tmpllibrary from pg_pltemplate where tmplname

createlang plpythonu postgres;
createlang: "$libdir/plpython2": No su
ch file or directory


CREATE LANGUAGE plpythonu;
create language 'plpythonu';


select version();


select tmplname,tmplhandler,tmpllibrary from pg_pltemplate where tmplname like 'plpython%'




CREATE LANGUAGE "plpython3u"


SELECT * FROM pg_available_extensions WHERE name LIKE '%python%' ORDER BY name;
CREATE EXTENSION plpython3u FROM unpackaged;


CREATE EXTENSION plpython2u FROM unpackaged;


CREATE EXTENSION plpython3u;
CREATE EXTENSION plpythonu;


CREATE PROCEDURAL LANGUAGE plpythonu;


CREATE OR REPLACE FUNCTION iseven(integer)
RETURNS BOOLEAN AS
$BODY$
t = args[0]
return t%2 == 0
$BODY$
LANGUAGE 'plpython3u' VOLATILE


select iseven(3);
3.编译postgresql_9.2.4,原先是9.1.3
[postgres@kenyon ~] $tar -zxvf postgresql_9.2.4.tar.gz
[postgres@kenyon ~] cd postgresql_9.2.4
[postgres@kenyon postgresql_9.2.4]./configure --prefix=/home/postgres --with-pgport=5432 --with-segsize=8 --with-wal-segsize=64 --with-wal-blocksize=64 --with-perl --with-python --with-openssl --with-pam --with-ldap --with-libxml --with-libxslt --enable-thread-safety
[postgres@kenyon postgresql_9.2.4]gmake world
[postgres@kenyon postgresql_9.2.4]gmake install-world
如果顺利的话,这个时候可以看一下BIN是否已经换成9.2.4
[postgres@kenyon postgresql_9.2.4]$ psql -V
psql (PostgreSQL) 9.2.4
[postgres@kenyon postgresql_9.2.4]$
说明BIN文件等已经OK
如果原始版本是9.2.0及以上,可忽略以下步骤,直接启动postgres,如果是9.2.0以下版本,直接启动会报错,则继续,类似initdb与configure版本不一致的问题

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读