Reputation: 5384
I have a dump of PostgreSQL database, which I created with command:
pg_dump database_name > dumpname.sql
I would like to restore database from this dump but I get manny errors "...already exists". Is it possible to overwrite existing database records from dump? I have to restore database, but I can't drop it.
Upvotes: 2
Views: 4957
Reputation: 247270
If you use the --clean
option of pg_dump
, the tables will be dropped and recreated.
Upvotes: 5