(pg_dumpall ไม่สามารถสร้าง backup ใน custom format (-F c) ได้ ให้ใช้ pg_dumpall | gzip > filename.gz ตามเดิม)
Code: Select all
pg_dump -h #IP_ADDRESS -p #PORT -U username -F c -v -f "backup_file" db_name
Code: Select all
pg_dump -h localhost -p 47206 -U brid_user -F c -v -f "gib_data_2016-04-29.backup" brid_sba_gib
2. createdb
3. restore ข้อมูล
Code: Select all
pg_restore -h #IP_ADDRESS -p #PORT -U username -j #THREADS -v -d db_name "backup_file"
Code: Select all
htop
Code: Select all
pg_restore -h localhost -p 47206 -U brid_user -j 4 -v -d brid_sba_gib "gib_data_2016-04-29.backup"