(我估计大家也都看得懂,我还是在下面谢了大体意思~)
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原文链接:https://www.f2er.com/postgresql/194628.html