By Ben Hancock
I’ve created a web application using App Platform, and created a Postgres “dev” database (i.e. not a full, “managed” database) as a component with it. In order for my app to work, I need to load some data into the db, and had thought that I would do that using psql. However, I can’t seem to find where to add my computer’s IP to the database’s “trusted sources”.
I’ve read through the docs on how to connect to a managed database, as well as on how to connect to Postgres in particular, but that still hasn’t led me to a solution.
Is it possible to connect to a Postgres “dev” database in app platform from the outside world? Or do I have to either a. disable trusted sources, or b. upgrade to a full “managed” database?
Edit: Alternatively, c. is there another, preferred way of managing the dev database from within DO?
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!
I wasn’t able to find a way to add trusted sources (aside from the app itself) to my dev database. However, my workaround was to temporarily disable trusted sources, connect via psql, load my data, and then re-enable trusted sources again.
Hey Ben,
Happy to hear that you found a work around and thank you for sharing it here with the community.
An alternative approach that I use with dev databases is database migration files and seed files. That way when I initially setup my dev app the database migrations are executed and the seeders add the dev content.
Best,
Bobby
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.