PostgreSQL

PostgreSQL

Connecting the Rails app to PostgreSQL, and some basic information that was useful to me getting started.

Part of deploying my Rails application on Heroku meant replacing the default SQLite3 database. While SQLite3 is lightweight and great for development, it’s not supported in Heroku’s production environment. Instead, I switched to PostgreSQL, which is one of the most robust and widely-used open-source databases. I was excited about the change because it gave me the chance to get hands-on experience with a more powerful database with my DBMS of choice in a real-world scenario, and TablePlus is proving to fit the bill nicely alongside PostgreSQL.
In the process of learning PostgreSQL, I made a few mistakes along the way, like accidentally dropping a table before fully understanding the consequences—trust me, that can cause a lot of issues! Definitely a 0/10, do not recommend moment. But through those challenges, I learned a lot, including how to perform regular backups using pg_dump to ensure my data is safe. I’ve also become more comfortable with the command line and PostgreSQL’s interactive shell (psql), discovering useful commands for database management. It’s been a great learning experience, and I feel like I’m gaining valuable skills that will be useful in any real-world development setting.

Posted: October 20, 2024