import export postgre using command line

login as postgre
(in windows right click cmd.exe, run as postgre)
pindah ke folder

To dump a database:

To dump a database:

$ pg_dump mydb > db.out

To reload this database:

$ psql -d database -f db.out

To dump a database called mydb that contains large objects to a tar file:

$ pg_dump -Ft -b mydb > db.tar

To reload this database (with large objects) to an existing database called newdb:

$ pg_restore -d newdb db.tar

Leave a Comment

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