I’ll be using Postgresql for my database. It’s a strong open source database. For many years it has solely been a relational database management system. Recently they have added JSON support and support for NO-SQL style databases. We’ll be using it as a relational database, but the development and capabilities of Postgresql make it the best choice at this time.
I’ve had some old databases lying around since Postgres 9.2 and I’ve decided this is the time to clean up my machine and start fresh with the latest version (9.4.4). I installed 9.2 with homebrew so uninstall is a breeze with:
I’ll install the latest with homebrew as well:
Sweet! I’ll wont be using launchctl right now so I’ll start postgres with the last command.
Looks like I have some leftover files from 9.2. Some directory was started with 9.2 and I can’t start 9.4.4 from the 9.2 version. Let’s remove this directory and re-initialize the database.
Sweet! Let’s try this again
Hrm… Looks like we killed the postgres and deleted the data directory with stopping the server. Now I have a orphan process running which is blocking my new postgres process. First I need to find which PID it is. (I know it shows up but it’s good to know where it lives.)
The first number is the PID so I’ll send the kill command to it. Do not use kill -9! When I killed the PID and started postgres I got the same message so I had a kill a few PIDs. Now I can create a db
Typing psql gets my into the database where you can run SQL statements. Typing \q get you out of the database and back to the command line. That’s all for today!