Throughout this book, we'll be using certain vocabulary related to RDBMSs and SQL. We've mentioned some of these terms already in this book, but it's worth recapping them here while introducing a few other terms that you should familiarize yourself with.
|Relational Database||A structured collection of data that follows the relational model.|
|RDBMS||Relational Database Management System. A software application for managing relational databases, such as PostgreSQL.|
|Relation||A set of individual but related data entries; analogous to a database table.|
|SQL||Structured Query Language. The language used by RDBMSs.|
|SQL Statement||A SQL command used to access/use the database or the data within that database via the SQL language.|
|SQL query||A subset of a "SQL Statement". A query is a way to search, or lookup data within a database, as opposed to updating or changing data.|
Before you can start using PostgreSQL, you first need to install it for your Operating System.
If you are reading this book as part of the Launch School curriculum then you should already have PostgreSQL installed and ready to use; if you haven't, then please review the appropriate assignments before proceeding with the rest of the book.
If you are reading the book independently of the Launch School curriculum, then you will need to install PostgreSQL in one of the following ways.
By far the simplest solution would be to use a cloud-based development environment such as Cloud9. The environment provided by Cloud9 is based on Ubuntu 14.04 and has PostgreSQL 9.3 already installed. To enable it, run the following command within the terminal in your Cloud9 workspace:
$ sudo service postgresql start * Starting PostgreSQL 9.3 database server ...done.
Cloud9 is an especially good option if your main OS is Windows, or you're fairly new to programming or configuring and installing development tools.
One option for installing PostgreSQL on a Mac is to use Postgres.app. There are instructions for installing Postgres.app on the its homepage. The site also has instructions for using the Postgres.app command line tools.
Alternatively you can use Homebrew to install PostgreSQL. If you don't have it installed follow the instructions on the homebrew's homepage to install it.
First, we ensure that Homebrew is up to date
$ brew update $ brew doctor $ brew upgrade
Next, follow the instructions listed in one of our blog posts. When reading this blog post, you only need to follow instructions for installing PostgreSQL; you should skip the section on Rails. link.
On a linux machine, your easiest route for installation is to use the package manager included with your distribution. Instructions on how to install PostgreSQL are included in this link. You should skip the section on Rails.
Some users may want to add a bit of security so that not just anyone can access their PostgreSQL databases. PostgreSQL gives us the option to set a password for the entire installation of PostgreSQL, and even for particular databases. You can find more information about setting a password in the docs for psql: look for the meta command
\password and the option
--password. For more information about setting passwords for particular users, databases, and hosts, check out the page on the password file.
In this chapter we've highlighted some specific terms and phrases which we'll be using throughout this book.
We've also directed you to how to install PostgreSQL on both Mac and Linux systems. You should now have PostgreSQL installed and ready to use; in the next chapter we'll start looking at how to interact with PostgreSQL.