简体   繁体   中英

Proper way of recovering a Postgres database from a PGdata folder?

My PC has its OS reinstalled recently. I'm left with the PGdata folder of a Postgres server that was locally hosted.

Could anyone explain how to recover all the data therein? My first intuition was to start a new server and replace its new PGdata folder with the old one but this seems somewhat barbaric.

只要PostgreSQL版本,操作系统和机器体系结构匹配,您就可以简单地针对现有数据目录启动PostgreSQL:

pg_ctl start -D /path/to/your/data

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM