--只備份結構
pg_dump -U postgres -d grgzpt -f D:\dump.sql -s
--備份結構和數據
pg_dump -U postgres -d grgzpt -f D:\dump.sql
--恢復
psql -d newDbname -U postgres -f D:\dump.sql
--備份問題:
如果服務器有多個不同端口的postgresql,需要指定端口 恢復數據。
--恢復
psql -d newDbname -U postgres -f D:\dump.sql -p 5433