I am tasked with providing a database export that clients can use to recreate & review their data without needing access to our internal system.
I dump and then try to restore the data as follows:
pg_dump --create -d dbname -U user -h host.domain.com --schema='(public|custom)' --data-only --column-inserts > output_file.dmp
createdb -d new_dbname
psql -d new_dbname -f output_file.dmp
I am met with errors like this:
psql: output_file.dmp:15172: ERROR: relation "custom.some_table" does not exist
LINE 1: custom.some_table (id, rev, revtype,...
I am not sure if this used to work because I inherited this process, but I am able to replicate their errors on our test Linux server and locally on MacOS.
How can I load these dumps successfully?