We will be going through how to setup Postgres locally on mac. We will cover the following:
- Starting Postgres
- Using psql to interact with database in command-line
- Creating your first database.
- Manage Data (Create Table, Inserting Data, Viewing Data)
- Stopping Postgres
Let's start off with making sure we have Postgres installed locally. Open up terminal on mac and run
postgres --version. You should see the version information outputted.
If you don't see the postgres version or need to install it still. Check out the Install Postgres on Mac post. Now that we have that out of the way, let's continue.
In terminal, run the following command. It will start Postgres locally.
brew services start postgresql
Next, let's go into the Postgres server now that it's up and running. Run the following: