博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
通过ODBC连接PostgreSQL和Greenplum
阅读量:6123 次
发布时间:2019-06-21

本文共 2212 字,大约阅读时间需要 7 分钟。

安装驱动

yum install -y unixODBC.x86_64  yum install -y postgresql-odbc.x86_64

查看驱动配置

cat /etc/odbcinst.ini # Example driver definitions# Driver from the postgresql-odbc package# Setup from the unixODBC package[PostgreSQL]Description     = ODBC for PostgreSQLDriver          = /usr/lib/psqlodbcw.soSetup           = /usr/lib/libodbcpsqlS.soDriver64        = /usr/lib64/psqlodbcw.soSetup64         = /usr/lib64/libodbcpsqlS.soFileUsage       = 1# Driver from the mysql-connector-odbc package# Setup from the unixODBC package[MySQL]Description     = ODBC for MySQLDriver          = /usr/lib/libmyodbc5.soSetup           = /usr/lib/libodbcmyS.soDriver64        = /usr/lib64/libmyodbc5.soSetup64         = /usr/lib64/libodbcmyS.soFileUsage       = 1

配置DSN

/etc/odbc.ini [digoal]Description = Test to PostgresDriver = PostgreSQLDatabase = postgresServername = xxxx.pg.rds.aliyuncs.comUserName = xxxxPassword = xxxxPort = 3433ReadOnly = 0[gp]Description = Test to gpDriver = PostgreSQLDatabase = mygpdbServername = xxxx.gpdb.rds.aliyuncs.comUserName = xxxxPassword = xxxxPort = 3568ReadOnly = 0

测试连通性

echo "select count(*) from pg_class"|isql gp+---------------------------------------+| Connected!                            ||                                       || sql-statement                         || help [tablename]                      || quit                                  ||                                       |+---------------------------------------+SQL> select count(*) from pg_class+---------------------+| count               |+---------------------+| 388                 |+---------------------+SQLRowCount returns 11 rows fetchedecho "select count(*) from pg_class"|isql digoal+---------------------------------------+| Connected!                            ||                                       || sql-statement                         || help [tablename]                      || quit                                  ||                                       |+---------------------------------------+SQL> select count(*) from pg_class+---------------------+| count               |+---------------------+| 1330                |+---------------------+SQLRowCount returns 11 rows fetched

参考文档

转载地址:http://uizua.baihongyu.com/

你可能感兴趣的文章
【WPF】 禁用Backspace 回退键
查看>>
Web前端学习第十天·fighting_使用CSS美化文字(三)
查看>>
I2C总线学习(三)--寻址
查看>>
Java动态性之反射机制(reflection)
查看>>
类似\u4e0b\u6ce8\u903e\u65f6解码
查看>>
15、SpringBoot-CRUD错误处理机制(2)
查看>>
文件共享
查看>>
django接受表单
查看>>
DOS 和 Linux 常用命令的对比
查看>>
Educational Codeforces Round 33 (Rated for Div. 2) B. Beautiful Divisors【进制思维/打表】
查看>>
Java核心-02 Exception和Error有什么区别?
查看>>
Spring quartz Job不能依赖注入,Spring整合quartz Job任务不能注入
查看>>
杭电2042不容易系列之二
查看>>
利用SSL-Change Cipher Spec传递信息
查看>>
Codeforces 313B - Ilya and Queries(水题)
查看>>
jQuery全局函数
查看>>
Redis原理
查看>>
一种高精度低复杂度的非线性函数定点计算方法
查看>>
haploview出现"invalid affected status"的解决方法
查看>>
初涉MySQL
查看>>