Pietro,
1 - Have you enabled access in the database's folder pg_hba.conf file, as
described here
http://www.ini.unizh.ch/~acardona/trakem2_manual.html#create_database (look for pg_hba)
2 - Have you enabled tcp access to the database, in the database's folder
postgresql.conf file, as described in the same link above?
2 - If connecting to a localhost, the IP you have to enter is that of the
localhost: either nothing (blank field), or 127.0.0.1
3 - The port is the one you have specified in the database's folder
postgresql.con file. The default port is 5432 (as specified in the postgresql
documentation online).
Albert