{"id":2570,"date":"2012-07-14T23:14:25","date_gmt":"2012-07-15T03:14:25","guid":{"rendered":"http:\/\/www.hoogervorst.ca\/arthur\/?p=2570"},"modified":"2012-07-15T07:32:11","modified_gmt":"2012-07-15T11:32:11","slug":"a-slight-return-to-postgres","status":"publish","type":"post","link":"http:\/\/www.hoogervorst.ca\/arthur\/?p=2570","title":{"rendered":"A slight return to Postgres"},"content":{"rendered":"<p><span class=\"dropcap\">Y<\/span>ears ago, I used to set up postgres on Debian servers. For a couple of test, I had to install Postgres somewhere: Installing on Windows is generally a breeze, but not needing the third-party tools, I decided to go back to Linux and install the database server on my Ubuntu box. While I didn&#8217;t have issues with importing test data\/databases, there were minor things that had me briefly stumped. So, to install Postgres on Ubuntu and other Debian flavours, here we go:\n<\/p>\n<ol>\n<li>First install postgres by entering &#8216;apt-get install postgresql&#8217; in a bash-session\/terminal\n<li>We need to properly initialize it and I would recommend to add your login user to Postgres: sudo -u postgres createuser -D -P arthur\n<li>Optionally, create a new database: sudo -u postgres createdatabase -O username whateveryouhavefordatabasename\n<li>Open up pg_hba.cfg (sudo vi \/etc\/postgresql\/9.1\/main\/pg_hba.conf).\n<li>Change the following lines properly (use trust):<br \/>\n# IPv4 local connections:<br \/>\nhost    all             all             127.0.0.1\/32            trust<br \/>\nhost    all             all             192.168.2.0\/24          trust<\/p>\n<li>Open up postgresql.conf and set listen_addresses = &#8216;*&#8217; properly (* means that postgres will listen to all ip-address as defined in networking)\n<li>Restart postgresql\n<li>Connect to postgres using the psql client: psql -U arthur -h localhost -d whichever database\n<\/ol>\n<\/p>\n<p>The official postgres site has demo databases (or rather links to them): they are around this <a href=\"http:\/\/wiki.postgresql.org\/wiki\/Sample_Databases\">url<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Years ago, I used to set up postgres on Debian servers. For a couple of test, I had to install Postgres somewhere: Installing on Windows is generally a breeze, but not needing the third-party tools, I decided to go back &hellip; <a href=\"http:\/\/www.hoogervorst.ca\/arthur\/?p=2570\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,4],"tags":[170,127,113],"_links":{"self":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts\/2570"}],"collection":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2570"}],"version-history":[{"count":1,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts\/2570\/revisions"}],"predecessor-version":[{"id":2571,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts\/2570\/revisions\/2571"}],"wp:attachment":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2570"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}