转自https://blog.csdn.net/zimu312500/article/details/124283358
一下子导出localhost的所有数据库
pg_dumpall -h 127.0.0.1 -p 5432 -U postgres -c -f alldb
psql –h 127.0.0.1 -p 5432 -U postgres -f alldb