postgresql数据库表的备份与还原
备份:
pg_dump -U postgres -t <a href="https://www.gaodaima.com/tag/shipping" title="查看更多关于shipping的文章" target="_blank">shipping</a>_shiptype_to_country -f ./shipping_shiptype_to_country.sql <a href="https://www.gaodaima.com/tag/futures" title="查看更多关于futures的文章" target="_blank">futures</a>_data
www#gaodaima.com来源gao!%daima.com搞$代*!码$网搞代码
其中:
-U:表示用户名
-f:指定输出文件
futures_data:该表从属于的数据库名
恢复:
psql -U postgres -d futures_data_online -f ./shipping_shiptype_to_country.sql
说明:
-U:表示数据库用户名
-d:指定要恢复到的数据库名
-f:指定要恢复的xxx.sql文件名称
Python学习网,大量的免费PostgreSQL入门教程,欢迎在线学习!
来源:搞代码网:原文地址:https://www.gaodaima.com