Database - PostgreSQL on AWS

SQuirreL SQL Client

  • Create Postgres database on Amazon Web Service.
  • Install pgAdmin as client application to connect to database.
  • Install SQuirreL SQL Client to connect to database.

I personally prefer to use SQuirreL SQL Client than pgAdmin.

Create Postgres Database on AWS

Reference: Create and Connect to a PostgreSQL Database

  1. create an AWS account before creating database.
  2. go to this page: AWS services
  3. search for RDS and click
  4. search for Create instance and click Launch a DB instance

Below steps made under Free Usage Tier

  1. Engine: PostgreSQL
  2. Use case: Dev/Test
  3. DB details:
    • tick Only enable options eligible for RDS Free Usage Tier
    • DB instance identifier: myPostgresDB
    • Master username: xxxxxx
    • Master password: xxxxxx
  4. Configure advanced settings
    • tick Yes for Public accessibility
    • Database name: Demo

Click Launch DB instance to create.

Use pgAdmin as Client Application

Reference: Connecting to a DB Instance Running the PostgreSQL Database Engine

To connect to database, go to RDS>Instances>postgresql and collect below info:

  • Endpoint
  • Port
  • Username
  • Password
  1. Go to Download - pgAdmin to download pgAdmin 4 v2.0
  2. Install and Open pgAdmin
  3. Right click Servers - Create - Server...
  4. General:
    • Name: Demo
    • Comments: Demo
  5. Connection:
    • Host: <Endpoint>
    • Port: <Port>
    • Username: <Username>
    • Password: <Password>
    • Role: Empty

Click Save

Done..

Use Squirrel SQL Client as Client Application

  1. Install Squirrel SQL Client Application
  2. Download PostgreSQL JDBC Driver
  3. Add PostgreSQL driver for Squirrel SQL Client
    • Open Squirrel SQL Client
    • Choose Driver on the left
    • Choose + to add driver
    • Choose Extra Class Path and Add
    • Choose postgresql-42.1.4 driver just downloaded.
    • Fill up:
    • OK
  4. Add Alias
    • Choose Aliases on the left
    • Choose + to add
    • Choose blue tick PostgreSQL as Driver
    • Fill up:
      • Demo
      • jdbc:postgresql://postgresql.cfqvncjculpj.ap-southeast-1.rds.amazonaws.com:5432/Demo
      • userName
      • password
    • Test
    • Connect
    • OK

Done..