/usr/local/postgresql/bin/pg_dump --p5432 -U ddpguser -s -Fc -v -f temp.dump database
/usr/local/postgresql/bin/pg_restore -l temp.dump
/usr/local/postgresql/bin/pg_restore -l temp.dump | grep FUNCTION > functionlist
/usr/local/postgresql/bin/pg_restore -L functionlist temp.dump > function.sql
单独导出函数命令:
/usr/local/postgresql/bin/pg_dump --p5432 -U ddpguser -s -Fc -v -f temp.dump database #导出表结构
/usr/local/postgresql/bin/pg_restore -l temp.dump | grep FUNCTION > functionlist #过滤函数 FUNCTION可以指定某个函数名
/usr/local/postgresql/bin/pg_restore -L functionlist temp.dump > function.sql #导出所有函数