Postgresql Access via the psql client interface

  1. Determine which node is running the postgresql instance
  2. ssh into the node running postgresql. In the example above, the postgresql instance is running on IP 192.168.1.105. Then from this node, get the Docker image ID.

  3. From the image above we see the Container ID of 'b548a3085ff0' associated with the postgres:9.6 image. It is this image on the 192.168.1.105 server which we will need to Docker 'exec to in order to access the client.

    docker exec -ti b548a3085ff0 sh -c "psql -U postgres -W"
    

    After executing the above command, we can now have full access to the PostgresQL client

With the above 3 steps you can have full local PostgresQL acces to examine and modify tables. That said, the above steps are a bit of a pain because you need to first figure out which server PostgresQL is running, then get the Docker CONTAINER ID. Especially, since in part I of this article series we exposed Postgresql to the outside world as one of the configuration property override settings. Give all this, a better approach is to install the psql client on your personal workstation.

Configure postgresQL to allow remote connections

Access postgresQL through the remote client 'psql'

  1. Install 'psql' on your personal workstation
    1. (mac)
    2. (windows)
  2. Check public node address and ports using HA proxy
  3. Invoke the 'psql' client on your personal workstation

results matching ""

    No results matching ""