pg数据库odbc驱动安装,一定要先安装unixodbc
1、pgodbc驱动下载,根据pg版本下载对应安装包
https://www.postgresql.org/ftp/odbc/versions/src/
2、安装odbc依赖包
libtool
libtool-ltdl
libtool-ltdl-devel
3、切换postgres用户
编译
./configure --with-unixodbc --with-libpq=/pgsql/postgresql
make
make install
4、unixodbc配置
[postgres]
Description = PostgresSQLODBC
Driver = PostgreSQL ANSI(x64)
Database = postgres
Servername = localhost
UserName = postgres
Password = postgres
Port = 5432
ReadOnly = 0
ConnSettings = set client_encoding to UTF8
[PostgreSQL ANSI(x64)]
Description = ODBC for PostgreSQL
Driver = /usr/local/lib/psqlodbcw.so
Setup = /usr/local/lib/libodbcpsqlS.so
Driver64 = /usr/local/lib/psqlodbcw.so
Setup64 = /usr/local/lib/libodbcpsqlS.so
FileUsage = 1
文章
阅读量
获赞