PostgreSQL Notes

herrkaefer 2016-08-15

Official Documentation and Tutorial

Install and run

Mac




brew install postgresql

Make sure that brew service is installed




brew tap homebrew/services

Start PostgreSQL as a background service: (will start automatically at login)




brew services start postgresql

stop and restart:




brew services stop [restart] postgresql

Linux

(to add)

Tools

Administrative front-ends

GIS

psql

Two basic modes




psql mydb

then execute commands for the database.

For example:




psql mydb -c "\l"



psql mydb -c "[command]"

Basic meta-commands

Full doc here.