postgresql数据库备份与还原
生活随笔
收集整理的這篇文章主要介紹了
postgresql数据库备份与还原
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
postgresql數(shù)據(jù)庫備份與還原
備份數(shù)據(jù)庫:
$ su - postgres
$ pg_dump testdb > testdb.sql
備份單個表:
$ pg_dump --table=aa testdb > testdb_aa.sql
僅備份單個表的數(shù)據(jù)(不要結(jié)構(gòu))
$ pg_dump --table=aa --data-only testdb > testdb_aa.sql
恢復(fù)數(shù)據(jù)庫:
$ su - postgres
$ createdb testdb
$ psql testdb < testdb.sql? ?(恢復(fù)單個表也是這個命令)
轉(zhuǎn)載于:https://blog.51cto.com/yangzhiming/1621432
總結(jié)
以上是生活随笔為你收集整理的postgresql数据库备份与还原的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Apple watch 开发指南(1)
- 下一篇: find : 路径必须在表达式之前