To enable remote access to a postgresql database from a computer or server, in Ubuntu server, first we need to know the ip of the computer in question, for example 92.58.201.162.
Then, from the terminal, enter the directory where postgresql is installed:
/etc/postgresql/9.3/main/
open edit pg_hba.conf:
sudo nano pg_hba.conf
and add the following line:
host all all 92.58.201.162 trust
Finally, edit the postgresql.conf file in the same directory as follows:
listen_addresses = '*'
Once saved, you must restart postgresql:
sudo service postgresql restart