Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 828 Bytes

INSTALL_POSTGRES.md

File metadata and controls

49 lines (31 loc) · 828 Bytes

Setup Postgres

  1. Mac Apple Silicon
  2. Linux

Install Postgres in Mac Apple Silicon

Open Terminal

# brew install postgresql@{{version}}

brew install postgresql@13

Install Postgress in Ubuntu Linux 20.04

Open Terminal

sudo apt update

sudo apt install postgresql postgresql-contrib

sudo systemctl enable postgresql.service

Ensure that the server is running using the systemctl start command:

sudo systemctl start postgresql.service

Login in PSQL

psql postgres (For Mac) / sudo -u postgres psql (For Ubuntu 20.04)

Using PostgreSQL Roles and Databases

postgres=# CREATE DATABASE databasename;

postgres=# CREATE USER "username" WITH ENCRYPTED PASSWORD 'password';

postgres=# GRANT ALL PRIVILEGES ON DATABASE databasename TO "username";

postgres=# \q