Easy way to List ESXi Hosts associated with VCenter : Postgres

Have a situation where your VCenter is offline but you need to get a list of hosts to triage since the VCenter is now AWOL? Quick solution assuming you can SSH to the VCenter.
- Putty to the VCenter.
- start postgres query by typing : “/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres“
(You will now find yourself at a new prompt that looks like : VCDB=#) - Type “VCDB=# select * from vpx_entity where type_id=1;“
You should now be presented with a list of hosts. - You can exit by simply typing, EXIT.
Good luck!