0

I downloaded the postgresql .dmp file from the chembl database.

I want to import this into gcp cloudsql.

When I run it with the console and gcloud command, I get the following error:

Importing data into Cloud SQL instance...failed.
ERROR: (gcloud.sql.import.sql) [ERROR_RDBMS] exit status 1
The input is a PostgreSQL custom-format dump.
Use the pg_restore command-line client to restore this dump to a database.

Can I import custom-format dmp files without using the pg_restore command?

https://cloud.google.com/sql/docs/postgres/import-export/importing

There is a description of pg_restore in the document on that site, but I didn't get it right.

In the case of custom-format files, is it necessary to pg_restore after uploading them to the cloud shell?

1 Answer 1

1

According to the CloudSQL docs:

Only plain SQL format is supported by the Cloud SQL Admin API. The custom format is allowed if the dump file is intended for use with pg_restore.

If you cannot use pg_restore for some reason, I would spin up a local Postgres instance (i.e., on your laptop) and use pg_restore to restore the database.

After loading into your local database, you can use pg_dump to dump to file in plaintext format, then load into CloudSQL with the console or gcloud command.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.