加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-13 17:08:14 所属栏目:百科 来源:网络整理
导读:(我估计大家也都看得懂,我还是在下面谢了大体意思~) 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_restor

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

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使用的文件。

Firsttakethedump:
译:首先导出:
[gpadmin@master~]$pg_dump-Uusername-Fc-s-fdump_testyour_database
Thencreatealistofthefunctions:
译:创建一个包含所有函数的文件:
[gpadmin@master~]$pg_restore-ldump_test|grepFUNCTION>function_list
Andfinallyrestorethem(-Lspecifiesthelistfilecreatedabove):
译:最后用-L参数指定上面创建的函数文件来恢复:
[gpadmin@master~]$pg_restore-Uusername-dyour_other_database-Lfunction_listdump_test

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读