pg_dump, pg_restore – typowe użycie

# dump bazy db1 do pliku db1.dat
pg_dump -h 192.168.1.2 -U postgres -ObFc -f db1.dat db1
pg_dump -h 192.168.1.2 -U postgres -ObFp -f db1.sql db1

# tworzymy nowa baze db2

# restore z pliku db1.dat do bazy db2
pg_restore -h 192.168.1.2 -U postgres -d db2 db1.dat

Leave a Reply

Your email address will not be published. Required fields are marked *