For PostgreSQL database, restrict remote connections to password
The line 

host    all             all             0.0.0.0/0               trust


Lets anyone in without a password (other than connections over the unix file socket, connections over the loopback device, and replication users).  Since it occurs earlier in the file, it takes priority over the x.x.x.x/x line.