I want to import the .sql file created with pg_dump into cloudsql.
The console and gcloud commands are both custom-type dump files, so they are told to use pg_restore.
On my local machine
pg_restore -h cloud_sql_ip -U postgres -d database sqlfile.sql
When I use the command, I get the following error:
pg_restore: error: connection to database "database" failed: could not connect to server: Operation timed out
Is the server running on host "cloud_sql_ip" and accepting
TCP/IP connections on port 5432?
If I use the gcloud sql connect command, it will connect without any problems.
I don't know why I am getting the error.
Thank you for your help.