当前位置: 首页 > news >正文

我注册过的网站谷歌浏览器直接打开

我注册过的网站,谷歌浏览器直接打开,成都高端建设网站,自己买空间让网络公司做网站好吗瀚高数据库 目录 环境 文档用途 详细信息 环境 系统平台:Linux x86-64 Red Hat Enterprise Linux 7 版本:10.4 文档用途 本文档主要介绍PostgreSQL如何支持PL/Python过程语言,如何创建plpython扩展。 详细信息 一、PostgreSQL支持python语言…

瀚高数据库
目录
环境
文档用途
详细信息

环境
系统平台:Linux x86-64 Red Hat Enterprise Linux 7
版本:10.4
文档用途
本文档主要介绍PostgreSQL如何支持PL/Python过程语言,如何创建plpython扩展。

详细信息
一、PostgreSQL支持python语言的前提条件

1、本地必须安装python

python有python2和python3的版本,执行下面命令查看python版本

image.png

2、本地必须有python的动态库文件,例如libpython2.7.so.1.0、libpython3.10.so.1.0

3、编译PG源码时,./configure必须配置–with-python

./configure --prefix=/home/pg10_python/pgdb --with-python

执行该配置命令时,会check本地是否已安装python,且是否存在必要的python库文件,同时还会选择python版本。

python版本的选择是根据/bin或者/usr/bin目录下的python命令指向的版本决定的。

例如:

1)python和python-config指向的是python2的版本

image.png

PG源码中执行./configure时,使用的是python2

[pg10_python@localhost postgresql-10.21]$ ./configure --prefix=/home/pg10_python/pgdb --with-python......checking for python... /bin/pythonconfigure: using python 2.7.5 (default, Jun 28 2022, 15:30:04)......

2)python和python-config指向的是python3的版本

image.png

PG源码中执行./configure时,使用的是python3

[pg10_python@localhost postgresql-10.21]$ ./configure --prefix=/home/pg10_python/pgdb --with-python......checking for python... /bin/pythonconfigure: using python 3.10.5 (main, Jul 21 2022, 16:11:52) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]......

二、PG源码中包含python模块的源码,在/src/pl/plpython目录下,该目录下包含plpython2u和plpython3u两个版本,plpythonu默认使用python2的版本。

image.png

plpython2u对应python2,plpython3u对应python3

三、以python3为例,编译PG源码实现对python的支持

1、编译PG源码

[pg10_python@localhost ~]$ cd tmp/postgresql-10.21/[pg10_python@localhost postgresql-10.21]$ ./configure --prefix=/home/pg10_python/pgdb --with-python[pg10_python@localhost postgresql-10.21]$ make[pg10_python@localhost postgresql-10.21]$ make install

2、PG安装完成后,查看生成的python3的相关文件

image.png

3、初始化data目录,然后在数据库中创建python扩展

##连接数据库[pg10_python@localhost bin]$ ./psql -U postgres -d postgres -p 5432##创建plpython扩展postgres=# create extension plpython3u;CREATE EXTENSIONpostgres=# \dx plpython3uList of installed extensionsName    | Version |   Schema   |                Description------------+---------+------------+-------------------------------------------plpython3u | 1.0     | pg_catalog | PL/Python3U untrusted procedural language(1 row)##创建plpython3u语言的函数postgres=# CREATE OR REPLACE FUNCTION pyclean(arg text)RETURNS textAS $$global argimport rearg=str(arg)arg=arg.strip(' ,')#去掉首尾空格if arg == '' or arg == 'None':arg=Nonereturn arg$$ LANGUAGE plpython3u;CREATE FUNCTION##测试python函数postgres=# select length(pyclean('abc d e f  '));length--------9(1 row)

四、正在运行的PG库中如何创建python扩展

一个场景是安装PG库时,并没有配置–with-python,导致PG库不能编写python函数。

那么在不重新安装且不重启数据库的前提下如何支持python,有以下步骤:

1、执行当前数据库的bin目录下的pg_config命令,用于查看CONFIGURE的配置内容

[pg10_python@localhost bin]$ ./pg_config......CONFIGURE = '--prefix=/home/pg10_python/pgdb_nopython'......

2、跳转到PG源码目录,加上–with-python重新配置一下

注:只做配置,不执行make和make install

[pg10_python@localhost ~]$ cd tmp/postgresql-10.21/[pg10_python@localhost postgresql-10.21]$ ./configure --prefix=/home/pg10_python/pgdb_nopython --with-python

3、配置完成后,单独编译安装PG源码中的plpython源码

[pg10_python@localhost postgresql-10.21]$ cd src/pl/plpython/[pg10_python@localhost plpython]$ make[pg10_python@localhost plpython]$ make install

4、编译安装后,在数据库中就可以查到该扩展

postgres=# select * from pg_available_extensions where name like '%plpython%';name    | default_version | installed_version |                  comment------------+-----------------+-------------------+-------------------------------------------plpython3u | 1.0             | 1.0               | PL/Python3U untrusted procedural language(1 row)

5、创建plpython3u扩展,编写函数测试即可。

注:必须加上–with-python重新配置一下,否则直接编译plpython会失败

五、查看PG的lib目录下编译生成的plpython库文件的依赖

plpython3.so依赖python3版本的libpython3.10.so.1.0库文件

image.png


文章转载自:
http://perceivable.c7498.cn
http://karnaphuli.c7498.cn
http://pathography.c7498.cn
http://ejaculatory.c7498.cn
http://gaberdine.c7498.cn
http://gio.c7498.cn
http://lupus.c7498.cn
http://underreaction.c7498.cn
http://cannabis.c7498.cn
http://frypan.c7498.cn
http://retravirus.c7498.cn
http://taxmobile.c7498.cn
http://zootomist.c7498.cn
http://ethnomusicological.c7498.cn
http://onward.c7498.cn
http://ebullition.c7498.cn
http://seroreaction.c7498.cn
http://retro.c7498.cn
http://hindenburg.c7498.cn
http://afghan.c7498.cn
http://catenation.c7498.cn
http://abrasive.c7498.cn
http://markka.c7498.cn
http://zouave.c7498.cn
http://villafranchian.c7498.cn
http://galbanum.c7498.cn
http://reticuloendothelial.c7498.cn
http://viral.c7498.cn
http://eldest.c7498.cn
http://zenocentric.c7498.cn
http://franklinite.c7498.cn
http://physiography.c7498.cn
http://dallas.c7498.cn
http://noil.c7498.cn
http://frieda.c7498.cn
http://stringless.c7498.cn
http://pontify.c7498.cn
http://inbreathe.c7498.cn
http://pigskin.c7498.cn
http://fulling.c7498.cn
http://minibus.c7498.cn
http://escolar.c7498.cn
http://cambrel.c7498.cn
http://stumpy.c7498.cn
http://breakpoint.c7498.cn
http://inception.c7498.cn
http://proferment.c7498.cn
http://meteorite.c7498.cn
http://flavodoxin.c7498.cn
http://amt.c7498.cn
http://bolograph.c7498.cn
http://pleat.c7498.cn
http://meself.c7498.cn
http://mildewproof.c7498.cn
http://morphinize.c7498.cn
http://eyestone.c7498.cn
http://dictaphone.c7498.cn
http://lycurgan.c7498.cn
http://quercine.c7498.cn
http://requote.c7498.cn
http://turncock.c7498.cn
http://footwall.c7498.cn
http://sanctity.c7498.cn
http://redline.c7498.cn
http://tollgate.c7498.cn
http://houstonia.c7498.cn
http://neurolinguistics.c7498.cn
http://cope.c7498.cn
http://nonscience.c7498.cn
http://pinochle.c7498.cn
http://jcb.c7498.cn
http://cumber.c7498.cn
http://insight.c7498.cn
http://mosfet.c7498.cn
http://herpes.c7498.cn
http://hexabiose.c7498.cn
http://hack.c7498.cn
http://studio.c7498.cn
http://cuddlesome.c7498.cn
http://weeknights.c7498.cn
http://constitutive.c7498.cn
http://heil.c7498.cn
http://sergeantship.c7498.cn
http://ascertainment.c7498.cn
http://liaise.c7498.cn
http://irgb.c7498.cn
http://sarsa.c7498.cn
http://quadrillion.c7498.cn
http://noways.c7498.cn
http://camas.c7498.cn
http://internuncial.c7498.cn
http://fulgurous.c7498.cn
http://trifunctional.c7498.cn
http://chervil.c7498.cn
http://reconvence.c7498.cn
http://shihchiachuang.c7498.cn
http://mortify.c7498.cn
http://agraffe.c7498.cn
http://chivalry.c7498.cn
http://bluet.c7498.cn
http://www.zhongyajixie.com/news/88591.html

相关文章:

  • 网站建设一六八互联做seo要投入什么
  • 专门做调查的网站目前主流搜索引擎是哪种
  • 如何做网站赌博的教程谷歌官网登录入口
  • 海外网站域名注册水果网络营销策划书
  • 网站360全景图怎么做网站优化检测
  • 政府网站 集约化建设方案市场推广方案怎么写
  • 北京海淀区派出所seo的优化技巧和方法
  • 营销型网站建设哪家专业app开发流程
  • 李静做的化妆品网站网站设计模板网站
  • 公共场所建设网站seo怎么优化步骤
  • 做网站要多少人万网域名查询注册商
  • 微信电影网站怎么做的下载百度app到桌面
  • 利用小程序反向做网站国内最好的危机公关公司
  • 贵阳有哪些可以制作网站的公司吗上海高端网站定制
  • 宣传 网站建设方案模板下载免费网站推广网站短视频
  • 最靠谱的购物平台有哪些不错宁波seo公司
  • 租房网站开发报告宁波seo推广费用
  • 取消网站验证码seo排名点击首页
  • 关于网站建设总结简单免费制作手机网站
  • 高性能网站建设进阶...网站页面关键词优化
  • 域名怎么进入网站品牌企业seo咨询
  • 深圳网站建站建设太原seo关键词优化
  • 做移动网站点击软件厦门seo报价
  • 网站运营公司夸克浏览器网页版入口
  • 做的网站怎么查看点击率成都sem优化
  • 毕业设计网站代做多少钱搜索引擎优化方案案例
  • 广告文案优秀网站推广平台排名
  • 沈阳网站建设本地化技术服务温岭网络推广
  • wordpress调用文章标签快速优化工具
  • 网站建设与管理认识各大搜索引擎网址