Access PostgreSQL on Windows from PSQL on Ubuntu

Install

  1. Install PostgreSQL and PgAdmin on Windows 10
  2. On Ubuntu, install PSQL Client
    sudo apt-get install -y postgresql-client
    

Access

For access PostgreSQL from Ubuntu Shell, do:

psql -h 127.0.0.1 -U postgres
  • 127.0.0.1 is PostgreSQL IP host
  • postgres is PostreSQL user

Example of access to a specific database:

psql -h 127.0.0.1 -d database_name -U username