Is there a way to get the IP address of a client virtual machine from pg_stat_activity?
I have added the ApplicationName to my connection string


I believe that the machine name on Oracle is voluntarily reported by the client to the server, which is why it works even behind NAT.

PostgreSQL only has one self-reported field, so I think that what you will have to do is stuff both "program name" and "machine name" into the ApplicationName field with some kind of delimiter between them.