First while launch Postgres use the "-i" option, it's make postgres accepting request via TCP.
If you know (and you know it) the listenning port of postgres, just make a routing rulez who redirect incomming request on this port to the good server (By is name).
As the name never change, your router will use your DNS table and do his work.
OR if you're just with a DSL connection.
Install a client like DynDNS and all request must be like :
$databasehost = "YourDNSName":"yourPostgresListeningPort"
that's all