您的位置:首页 > 房产 > 建筑 > Babelfish for PostgreSQL

Babelfish for PostgreSQL

2024/12/23 7:06:30 来源:https://blog.csdn.net/w345731923/article/details/139745938  浏览:    关键词:Babelfish for PostgreSQL

环境准备

x86_linux_kylin v10 sp2

1、依赖

yum install -y uuid-devel

2、源代码

下载支持babelfish的pg,也是babelfish社区维护更新

#pg源码,支持babelfish版
git clone https://github.com/babelfish-for-postgresql/postgresql_modified_for_babelfish.git
#babelfish扩展
git clone https://github.com/babelfish-for-postgresql/babelfish_extensions.gitmv babelfish_extensions /opt/babelfish_extensions
mv postgresql_modified_for_babelfish /opt/postgresql_modified_for_babelfish

 3、编译修改的pg


#创建安装目录
INSTALLATION_PATH=/usr/local/pgsql 
mkdir "$INSTALLATION_PATH"#构建配置
cd /opt/postgresql_modified_for_babelfish./configure CFLAGS="-ggdb" \
--prefix=${INSTALLATION_PATH} \
--enable-debug \
--with-libxml \
--with-uuid=ossp \
--with-icu \
--with-extra-version="Babelfish for PostgreSQL"#编译pg
make -j4 && make install   #编译pg扩展
cd contrib 
make -j4 && make install

4、安装cmake和antlr

babelfishpg_tsql需要antlr

cd /usr/src
wget https://codeload.github.com/antlr/antlr4/zip/refs/tags/4.12.0
unzip 4.12.0
cd antlr4-4.12.0/

5、构建安装babelfish扩展

设置临时环境变量 

export PG_CONFIG=$INSTALLATION_PATH/bin/pg_config
export PG_SRC=/opt/postgresql_modified_for_babelfish
export cmake=/usr/local/cmake-3.21.1/bin

编译

#babelfishpg_money
cd /opt/babelfish_extensions/contrib/babelfishpg_money
make
make install#babelfishpg_common
cd ../babelfishpg_common
make 
make install#babelfishpg_tds
cd ../babelfishpg_tds
make 
make install#babelfishpg_tsql
cd ../babelfishpg_tsql
make 
make install

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com