Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 1
    Can't you just run pg_restore with the --clean option? Commented Sep 2, 2022 at 6:09
  • That doesn't happen usually. Did you modify the schema in the original database? Are you running the latest minor release on v10? Commented Sep 2, 2022 at 6:39
  • @LaurenzAlbe , Postgres 10 version is 10.17. Original database was created, initiated and used by us as time passed. We did not specifically do any modifications on schema. Database creation, created default schema public, and we added objects and data onto it.. Commented Sep 2, 2022 at 6:58
  • @a_horse_with_no_name , No, clean did not work. We got other issues like foreign key violations. Thanks. Commented Sep 2, 2022 at 6:58
  • 1
    Does this answer your question? pg_restore: [archiver (db)] could not execute query: ERROR: schema "public" already exists Commented Dec 7, 2023 at 14:11