{"id":145,"date":"2016-05-16T10:29:38","date_gmt":"2016-05-16T14:29:38","guid":{"rendered":"https:\/\/mberlove.com\/blog\/?p=145"},"modified":"2016-05-16T10:29:38","modified_gmt":"2016-05-16T14:29:38","slug":"postgres-sequelize-and-centos-7-quick-dirty-resource-guide","status":"publish","type":"post","link":"https:\/\/mberlove.com\/blog\/postgres-sequelize-and-centos-7-quick-dirty-resource-guide\/","title":{"rendered":"Postgres, Sequelize, and CentOS 7: Quick &#038; Dirty Resource Guide"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-147\" src=\"https:\/\/mberlove.com\/blog\/wp-content\/uploads\/2016\/05\/postgresql-logo.png\" alt=\"PostgreSQL Logo\" width=\"610\" height=\"280\" srcset=\"https:\/\/mberlove.com\/blog\/wp-content\/uploads\/2016\/05\/postgresql-logo.png 610w, https:\/\/mberlove.com\/blog\/wp-content\/uploads\/2016\/05\/postgresql-logo-300x138.png 300w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/p>\n<p>The PostgreSQL variant of SQL is pretty popular these days, and its adopters are <a href=\"https:\/\/www.quora.com\/What-are-pros-and-cons-of-PostgreSQL-and-MySQL\" target=\"_blank\">quick to point out a number of advantages<\/a>. Like any system, though, it does take some getting used to, perhaps more so than other, more popular systems like MySQL.<\/p>\n<p>Choosing between the two for a project can <a href=\"http:\/\/www.wikivs.com\/wiki\/MySQL_vs_PostgreSQL\" target=\"_blank\">have a lot of competing factors<\/a>, but if you&#8217;re developing with NodeJS, you&#8217;ll often end up using the <a href=\"http:\/\/docs.sequelizejs.com\/en\/latest\/docs\/getting-started\/\" target=\"_blank\">Sequelize package<\/a>, which by default uses postgres (though it can handle other dialects, too).<\/p>\n<h1>PostgreSQL<\/h1>\n<p>If you&#8217;ve chosen postgres, but have never used it before, you&#8217;ll need to learn to install it. On CentOS, this process is fairly straightforward, but rather picky &#8212; as I discovered to my frustration, there are a lot of ways to do it incorrectly. I finally settled on <a href=\"http:\/\/tecadmin.net\/install-postgresql-9-5-on-centos\/#\" target=\"_blank\">this guide<\/a>, which worked for me.<\/p>\n<p>If you&#8217;re coming from another version of SQL, setting up new users, databases, etc, can be a somewhat foreign process. Following <a href=\"https:\/\/wiki.postgresql.org\/wiki\/First_steps\" target=\"_blank\">these general instructions<\/a> should serve to get you on the right path.<\/p>\n<h1>Sequelize<\/h1>\n<p>Once you&#8217;ve gotten your database up and running, Sequelize, should you choose to employ it, is <a href=\"http:\/\/docs.sequelizejs.com\/en\/1.7.0\/docs\/usage\/\" target=\"_blank\">not too difficult to get initialized<\/a> (don&#8217;t forget to <em>npm install<\/em> it first)!<\/p>\n<p>One common problem that I also ran across is authentication failure, so in most cases you&#8217;ll need to <a href=\"https:\/\/www.treshna.com\/psql-fatal-ident-authentication-failed-for-user-username-error-and-solution\/\" target=\"_blank\">set up the connection configuration file<\/a>.<\/p>\n<p>(Depending on your settings, you may also need to <a href=\"https:\/\/github.com\/sequelize\/sequelize\/issues\/4165\" target=\"_blank\">exclude the port from the connection string<\/a>.)<\/p>\n<hr \/>\n<p>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.<\/p>\n<p>Happy coding!<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":147,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[104],"tags":[21,76,113,146,119,142,144,128,143,79,145],"class_list":["post-145","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-dev","tag-centos","tag-database","tag-development","tag-guide","tag-javascript","tag-nodejs","tag-postgresql","tag-resources","tag-sequelize","tag-sql","tag-troubleshooting"],"_links":{"self":[{"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/posts\/145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/comments?post=145"}],"version-history":[{"count":3,"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/posts\/145\/revisions"}],"predecessor-version":[{"id":149,"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/posts\/145\/revisions\/149"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/media\/147"}],"wp:attachment":[{"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/media?parent=145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/categories?post=145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mberlove.com\/blog\/wp-json\/wp\/v2\/tags?post=145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}