MagicStack/asyncpg

Feature request: A connection property to retreive host name used in specific connection

Opened this issue · 0 comments

aldem commented

When multiples hosts are specified, either pool or connection could use any of them (depending on target_session_attrs).

It would be nice to have a way to retrieve the actual (connected) host name, as it was provided in the list, that was used to create a specific connection.

Currently, I found no easy way how to do this. Of course, it is possible to use SELECT inet_server_addr() but this only returns an address, which is not always useful.

Thank you!