Postgresql数据迁入greenplum时,large object怎么处理呢?

查看:254
本文介绍了Postgresql数据迁入greenplum时,large object怎么处理呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

本来想的是gpfdist导入,因为这个工具并行的,速度快。但是我的原postgresql库里有lo(large object)数据,大致看了下postgresql的COPY TO,并没有找到导出csv格式包含lo的参数。pg_dump倒是可以导出lo数据,但是貌似导出来的都是sql script,这个格式的好像也不能用gpfdist导入。
请问有解决方案吗?

解决方案

答案就直接从另一个社区的回答中复制出来了,当然是我自己的解决方案。之前因为pg_dump导出plain text遇到高版本postgresql bytea输出格式为hex的问题走了不少弯路,其实只需要导出二进制数据就可以导入greenplum了。希望对遇到同样问题的人有所帮助
I found out an easier way to work: just use pg_dump -b -Fc to export data including LO into a custom file, later use pg_restore of the same version of pg_dump which you used to export data to import the custom file data into greenplum.

Scripts:

$ pg_dump fhir -O -a -Fc  -f fhir.dump
$ pg_restore -h mdw -d fhir -U gpadmin -a fhir.dump > errors.log 2>&1

这篇关于Postgresql数据迁入greenplum时,large object怎么处理呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆