Jaroslaw K.
Jaroslaw K.

Reputation: 5384

Is it possible to overwrite database records from dump?

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

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 247270

If you use the --clean option of pg_dump, the tables will be dropped and recreated.

Upvotes: 5

Related Questions