The first thing to do if you want to connect to PostgreSQL on your Raspberry is to configure PostgreSQL to accept remote connections:
In the previous post we’ve already explained how to set the Raspberry PostgreSQL server to allow incoming connections.
PostgreSQL shell client is
psql. Unlike pgAdminIII,
psql is the terminal-based front-end to PostgreSQL, included in by default in the PostgreSQL package.
psql enables to type in queries interactively, and provides meta-commands and shell-like features to facilitate writing scripts and automating a wide variety of tasks.