I tried using datagrip to import a database and ran the following construct
pg_restore -d postgresql://admin:"password"@db-postgresql-nyc1-59296-do-user-12660498-0.b.db.ondigitalocean.com:25060/Megacity?sslmode=require --jobs 2 C:\Program Files\PostgreSQL\15\bin\Megacity.sql
Then the following errors popped up:
do-user-12660498-0.b.db.ondigitalocean.com:25060/defaultdb?sslmode=require
[2022-10-25 09:41:23] [42601] ERROR: syntax error at or near "-"
[2022-10-25 09:41:23] Position: 3
Please how can I resolve this?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi @phetchaconsults,
I’ll urge you to check the following Docs;
https://docs.digitalocean.com/products/databases/postgresql/how-to/import-databases/
Having said that, looking at your pg_restore command everything looks to be proper.
- pg_restore -d postgresql://admin:"password"@db-postgresql-nyc1-59296-do-user-12660498-0.b.db.ondigitalocean.com:25060/Megacity?sslmode=require --jobs 2 C:\Program Files\PostgreSQL\15\bin\Megacity.sql
All I can think of is maybe you’ve used a symbol that’s not ‘-’ but something that looks like it. I’ll suggest to try and re-type the command to see if this error would still appear.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.
