SSIS 连接 PostgreSQL

因为工作需要,得把psql的表放到SQL Server, 找到一个PGNP(http://www.pgoledb.com/)  的适配器,不过一看要300$就没有去尝试了. 官方倒是有ODBC的驱动.以下使用ODBC操作的过程记录.

1. 下载PostgreSQL ODBC驱动

http://www.postgresql.org/ftp/odbc/versions/msi/

2. 配置ODBC  Source
安装好以后 ODBC Data Sources 配置工具里面,会多出 PostgreSQL ANSI和 PostgreSQL Unicode 两个驱动.  从字面意思.我选了Unicode.

image

配置好相关登陆信息

image

3. SSIS 配置

本来使用ODBC Source 适配器(官方号称新版本推荐用这个= = ) image ,连接到odbc连接以后提示我表中有个lob字段,读取的时候只能一行行处理. 后来执行还报错,预览没报错,执行报错,也看不出什么问题= =.

SSIS package "E:\File\Dooioo\ETL\Dooioo\Tableau\Tableau.dtsx" starting.
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
Error: 0xC0014020 at Tableau, Connection manager "Tableau": An ODBC error -1 has occurred.
Error: 0xC0014009 at Tableau, Connection manager "Tableau": There was an error trying to establish an Open Database Connectivity (ODBC) connection with the database server.
Error: 0x20F at Data Flow Task, Tableau Source [74]: The AcquireConnection method call to the connection manager Tableau failed with error code 0xC0014009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.
Error: 0xC0047017 at Data Flow Task, SSIS.Pipeline: Tableau Source failed validation and returned error code 0x80004005.
Error: 0xC004700C at Data Flow Task, SSIS.Pipeline: One or more component failed validation.
Error: 0xC0024107 at Data Flow Task: There were errors during task validation.
SSIS package "E:\File\Dooioo\ETL\Dooioo\Tableau\Tableau.dtsx" finished: Failure.
The program '[14216] DtsDebugHost.exe: DTS' has exited with code 0 (0x0).

最后使用了image 搞定.

4. 碰到的问题

如果各位小伙伴能解答还请赐教

    a) 像LOB字段这种导致ODBC Source 要一行行读取的,在不改动源数据库的情况下有什么办法处理么?

    b) 如果Destination 也用ODBC, 我发现用 SQL Server Native Client 10.0和11.0 会报日期溢出错误 (数据源日期类型为  timestamp without time zone ). 但是最老的SQL Server ODBC驱动不会报错.

image

转载于:https://www.cnblogs.com/haseo/p/4349771.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值