https://www.toutiao.com/article/7194649897277243908/?log_from=1f528254abf188_1675149611187
原理类似,即在window上用指定python编译出plpython3.dll。  python和postgresql共舞 二、WINDOW,PG13+PY39 2.1 准备资源vs2019: vs_community__05fefd65a6994d6189799767d2b04f87.exe activeperl: ActivePerl-5.26.3.2603-MSWin32-x64.exe py39: python-3.9.5-amd64.exe pg源码: postgresql-13.5.tar.gz vs2022经过测试有一些bug,建议用VS2019进行编译。 py39的安装目录为 c:\data\py39 2.2 检查前置工作是否完成打卡vs2019的tool命令行(非CMD),后续编译都在此命令行进行。 检查cl.exe 编译器, perl python 2.3 编译过程解压源码,切换到其中msvc目录。 我的目录是 C:\ext\tmp\postgresql-13.5\postgresql-13.5\src\tools\msvc
修改编译配置文件,confi_default.pl,指定python39 # Configuration arguments for vcbuild.
use strict;
use warnings;
our $config = {
asserts => 0, # --enable-cassert
# blocksize => 8, # --with-blocksize, 8kB by default
# wal_blocksize => 8, # --with-wal-blocksize, 8kB by default
ldap => 1, # --with-ldap
extraver => undef, # --with-extra-version=<string>
gss => undef, # --with-gssapi=<path>
icu => undef, # --with-icu=<path>
nls => undef, # --enable-nls=<path>
tap_tests => undef, # --enable-tap-tests
tcl => undef, # --with-tcl=<path>
perl => undef, # --with-perl=<path>
python => 'C:\data\py39', # --with-python=<path>
openssl => undef, # --with-openssl=<path>
uuid => undef, # --with-uuid=<path>
xml => undef, # --with-libxml=<path>
xslt => undef, # --with-libxslt=<path>
iconv => undef, # (not in configure, path to iconv)
zlib => undef # --with-zlib=<path>
};
1;
开始编译 build
--中间等待事件较长
install C:\ext\tmp\pg
在编译安装的二进制包内,可得到plpython3.dll
|