I am trying to import a database "demodb" from a dump using -n option. The intention is to import only specific schema called "demoschema". I create demodb as blank db before running pg_Restore. And I run the below command to restore:

pg_restore -d demodb -n demoschema dumpfile

Now the problem is pg_largeobject table is empty after restore. If I remove option "-n demoschema" pg_largeobject will be restored too.

How do I use the option "-n" and also make sure catalogue tables like pg_largeobject are restored?

1 Answer 1


You cannot. Either restore everything and drop what you don't need, or create a dump with pg_dump -n demoschema --blobs that contains exactly the data you need.

  • As per the document for --blobs option: Include large objects in the dump. This is the default behavior except when --schema, --table, or --schema-only is specified. Aug 26, 2022 at 10:56
  • Right. Since you specify --schema (= -n), you have to use --blobs explicitly. Aug 26, 2022 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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