您的当前位置:首页正文

postgresql怎么备份

来源:华拓网

postgresql数据库的备份和还原命令pg_dump 

常用命令:

备份:

pg_dump -U postgres -d myDBname -f dump.sql

其中

postgres是用户名

myDBname是数据库名

dump.sql是文件名

还原:

createdb newDBname
psql -d newDBname -U postgres -f dump.sql

其中

postgres是用户名

newDBname是数据库名

dump.sql是文件名

推荐学习《》。