PG 只导出指定函数

钟罗敏

关注

阅读 65

2022-07-13


PG 只导出指定函数

  • ​​出表结构​​
  • ​​取函数名​​
  • ​​获取指定函数的实现​​
  • ​​去除注释​​

出表结构

/home/postgres/pgsql/bin/pg_dump   -Upostgres  test -Fc -v -s -f test.dmp 

取函数名

/home/postgres/pgsql/bin/pg_restore -l test.dmp | grep FUNCTION > funcion_list

获取指定函数的实现

/home/postgres/pgsql/bin/pg_restore -L ./funcion_list  test.dmp > function_list.sql

去除注释

grep -v '\-\-' function_list.sql > function_list_implements.sql


精彩评论(0)

0 0 举报