Getting Started

Starting Database with Docker

docker run --name <docker_name> 
 -e POSTGRES_PASSWORD=<password>
 -d -p 5432:5432 postgres:13.3

docker exec -it <docker_name> bash

psql -U postgres

Installing PostgreSQL on windows

  • https://www.postgresql.org/download/windows/

Installing PostgreSQL on MacOS

https://www.postgresql.org/download/macosx/

Setup and Basics : using apt

Installation

sudo apt-get install postgresql

Usage commands

Switch to default user

Getting Started

Connect to a database

  1. Here port : 5432 is default and can be get from psql --help

  2. postgres is the super user. Create another user and connect using that.

  3. to connect to database with user :

Commands

Load Data

Download the sample data file from here

image

Last updated

Was this helpful?