在Windows上备份:
pg_dump -U postgres olddb > db.backup
在Linux上恢复:
#su - postgres
$createdb newdb
$initdb newdb
$psql -U postgres newdb < db.backup
$psql newdb
#select * from tablename; (看看数据是否都过来了:)
pg_dump -U postgres olddb > db.backup
在Linux上恢复:
#su - postgres
$createdb newdb
$initdb newdb
$psql -U postgres newdb < db.backup
$psql newdb
#select * from tablename; (看看数据是否都过来了:)