0 like 0 dislike
146 views
asked in PostgreSQL Database Forum by (13.4k points)  
Restore particular object from full cluster backup in postgres database

Please log in or register to answer this question.

1 Answer

0 like 0 dislike
answered by (13.4k points)  
./initdb -D /new_path
change port number  , it should not been same as existing port number.

starting the new cluster:
./pg_ctl -D /new_path -l logfile start

Restoring cluster backup into the new cluster:
psql -d dbname -f /path/hnfdjkhf.dmp

Taking particular database backup from new cluster:
pg_dump -d dbname -f /path/dbname.dmp

Restoring database backup to old cluster:
export port=old_port
psql -c "create database dbname";
psql -d dbname -f /path/hnfdjkhf.dmp

Related questions

0 like 0 dislike
0 answers
0 like 0 dislike
1 answer
0 like 0 dislike
0 answers
Welcome to PostgreSQL Database Discussion Forum where you can ask questions and receive answers from other members of the community. Can discuss here Oracle, Postgresql, mariadb , mySQL , AWS , Linux , MSSQL , MongoDB , Greenplum databases related queries ...etc.
...