分享一段greenplum/postgresql单独恢复存储过程的语句(摘录翻译)

(我估计大家也都看得懂,我还是在下面谢了大体意思~)

You can't tell pg_dump to dump only functions. However, you can make a dump without data (-s) and filter it on restoring. Note the -Fc part: this will produce a file suitable for pg_restore.

译:我们不能使用pg_dump工具单独导出存储过程。但是,可以先把所有的模式结构都导出来,然后恢复的时候指定只恢复存储过程。注意-Fc选项的意思:生成一个可供pg_restore使用的文件。

First take the dump:
译:首先导出:
[gpadmin@master ~]$pg_dump -U username -Fc -s -f dump_test your_database
Then create a list of the functions:
译:创建一个包含所有函数的文件:
[gpadmin@master ~]$pg_restore -l dump_test | grep FUNCTION > function_list
And finally restore them (-L specifies the list file created above):
译:最后用-L参数指定上面创建的函数文件来恢复:
[gpadmin@master ~]$pg_restore -U username -d your_other_database -L function_list dump_test

 

 

 

 

转载于:https://my.oschina.net/javacy/blog/646043

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值