I have a server named as servername.mydomain.com. I can do ssh to this server using a port number X using:
ssh [email protected] -p X
From this server I can run:
psql -h localhost -d myDatabase -U myusername -p DBPORT
Instead of having to login using ssh I want to be able to use psql as:
psql -h servername.mydomain.com:X -d myDatabase -U myusername -p DBPORT
Is this possible? I tried this but I am getting the message: could not translate hostname ...
leave out the :x
You may need to edit the
listen_addresses
directive inpostgrersql.conf
(and restare poastgresql.Alternatively you can tunnel the postgres connection.
then on another command-line