I take backup using
pg_dump db_production > postgres_db.dump
and then I copy it to localhost using scp.
Now when I import on my local db it gives an error
pg_restore: [archiver] input file appears to be a text format dump. Please use psql.
by using commad line
pg_restore -d db_development postgres_db.dump
if you use pg_dump with -Fp to backup in plain text format, use following command:
to copy all data to your database with name dbname
Before you downvote
From the
pg_dump
documentation:Examples
To dump a database called mydb into a SQL-script file:
To reload such a script into a (freshly created) database named newdb:
To dump a database into a custom-format archive file:
To dump a database into a directory-format archive:
To reload an archive file into a (freshly created) database named newdb:
From the
pg_restore
documentation:Examples
Assume we have dumped a database called mydb into a custom-format dump file:
To drop the database and recreate it from the dump:
The answer above didn't work for me, this worked:
psql db_development < postgres_db.dump