您现在的位置是:课程教程文章

postgresql怎么备份

2023-12-18 20:01课程教程文章 人已围观

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是文件名

推荐学习《Python教程》。

课程教程:postgresql怎么备份

上一篇:怎么判断postgresql是否存在

下一篇:没有了

站点信息

  • 文章统计篇文章