Install Postgres locally in MacOS

Posted on Aug 18, 2020

featured image

Install using Brew package manager

brew update
brew install postgres

Config file


Useful commands

brew services start postgresql
brew services restart postgresql
brew services stop postgresql

psql command

"psql is a terminal-based front-end to PostgreSQL. It enables you to type in queries interactively, issue them to PostgreSQL, and see the query results."

Run psql and you will see the following error
$ psql
psql: error: could not connect to server: FATAL:  database "andrescanavesi" does not exist
So let's create a db with that name in order to play with it
createdb andrescanavesi
List available databases
Use a specific database
\c andrescanavesi 
List tables
See your version
SELECT version();



postgres pg dev
Side Widget
You can put anything you want inside of these side widgets. They are easy to use, and feature the new Bootstrap 4 card containers!