如何实现Postgres访问TiDBmp.weixin.qq.com
TiDB支持MySQL,Spark,但不支持Postgres, 那有没有办法实现Postgres访问呢?
现在尝试一个曲线救国的办法, MySQL FDW(mysql_fdw)。
利用mysql_fdw插件,可以读写MySQL数据库里的数据。
安装HomeBrew
今天尝试的是在macOS下大名鼎鼎的HomeBrew(也支持Linux)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
安装并运行Postgres
brew install postgresql
pg_ctl -D /home/linuxbrew/.linuxbrew/var/postgres start
安装MySQL FDW
git clone https://github.com/EnterpriseDB/mysql_fdw
cd mysql_fdw
#通过brew安装,pg_config配置里需要gcc-5
ln -s /bin/gcc-9 gcc-5
export PATH=.:/home/linuxbrew/.linuxbrew/bin:$PATH
make USE_PGXS=1
make