postgresql data
- 作者: 虔城鹭岛
- 来源: 51数据库
- 2020-09-23
1.先重命名data文件
sudo mv data data2
2.重新初始化data目录
service postgresql initdb
如果是debian,ubuntu系统会有所不同
/usr/lib/postgresql/8.4/bin/initdb -D /path/to/data
3. 启动或者重启 pgsql
4. 还原备份文件
gzip -dc /path/to/backfile.gz | pg_restore -U username -d dbname
期待看到有用的回答!
sudo mv data data2
2.重新初始化data目录
service postgresql initdb
如果是debian,ubuntu系统会有所不同
/usr/lib/postgresql/8.4/bin/initdb -D /path/to/data
3. 启动或者重启 pgsql
4. 还原备份文件
gzip -dc /path/to/backfile.gz | pg_restore -U username -d dbname
期待看到有用的回答!
推荐阅读
