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!
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.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.