When i try to restore a database from a dump file using the following command:

 \i C:/pathname/dumpfile.txt

from within my sql shell, it runs the first few lines of the dump file and then I get the following error:

ERROR: permission denied to create "pg_catalog.databasename"
DETAIL: System catalog modifications are currently disallowed.

This shows the beginning of the dump file. I think the CREATE TABLE command triggers the error.

enter image description here

I'm using postgreSQL Version 11.1. Any ideas how to solve this?

  • Have you created an empty schema for your data? Maybe you could try that? Jan 5, 2019 at 15:38
  • But then how do I restore the dump into this empty schema?
    – Cyrill
    Jan 5, 2019 at 17:54
  • Do you still have access to the old database? if so, redo the dump using the pg_dump from 11.1, not from 9.6.0.
    – jjanes
    Jan 5, 2019 at 18:13
  • Unless you changed the setting of "log_min_error_statement", you shouldn't have to guess what statement triggered the ERROR. The ERROR message will include the triggering statement. Using the default log format, it will be flagged with "STATEMENT:"
    – jjanes
    Jan 5, 2019 at 18:23
  • I don't have access to the old database so I can't redo the dump. I tried to restore it using Version 9.6.0 though, but that didn't work either.
    – Cyrill
    Jan 6, 2019 at 8:31

2 Answers 2


Ok I solved it: in the following line:

SET search_path = car, pg_catalog;

apparantly, car is the name of the schema. As that schema didn't exist, it tried to create a table in the pg_catalog schema. I manually created a schema called car, and, tada.. Thanks to everybody for their support.


First check if you need to set the search_path (see the other answer to the question).

SET search_path = car, pg_catalog;

Then check if the schema exists. If not, then add this to your SQL dump file:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.