Postgres, Sequelize, and CentOS 7: Quick & Dirty Resource Guide

PostgreSQL Logo

The PostgreSQL variant of SQL is pretty popular these days, and its adopters are quick to point out a number of advantages. Like any system, though, it does take some getting used to, perhaps more so than other, more popular systems like MySQL.

Choosing between the two for a project can have a lot of competing factors, but if you’re developing with NodeJS, you’ll often end up using the Sequelize package, which by default uses postgres (though it can handle other dialects, too).

PostgreSQL

If you’ve chosen postgres, but have never used it before, you’ll need to learn to install it. On CentOS, this process is fairly straightforward, but rather picky — as I discovered to my frustration, there are a lot of ways to do it incorrectly. I finally settled on this guide, which worked for me.

If you’re coming from another version of SQL, setting up new users, databases, etc, can be a somewhat foreign process. Following these general instructions should serve to get you on the right path.

Sequelize

Once you’ve gotten your database up and running, Sequelize, should you choose to employ it, is not too difficult to get initialized (don’t forget to npm install it first)!

One common problem that I also ran across is authentication failure, so in most cases you’ll need to set up the connection configuration file.

(Depending on your settings, you may also need to exclude the port from the connection string.)


This very quick and dirty guide is hardly a complete manual, but it includes every successful resource I ran across while I was struggling to get my system up and running, so hopefully the links provided can relieve some of the gruntwork and frustration for you.

Happy coding!

 

Leave a Reply

Your email address will not be published. Required fields are marked *