Thanks for all the feedback. Please find attached a version which prints "[none]" as the default value, "[local]" for a socket, and otherwise whatever pg_getnameinfo_all spits out. I cleaned up the coding, respected padding, removed the family checks, and expanded the docs a tiny bit to give the reader more context as to what "local address" means. I also looked into alternatives to the term "local address" but that still seems the most correct and commonly used term.
I have not attempted the caching change yet. Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products & Tech Support
0003-Add-local-address-to-log_line_prefix.patch
Description: Binary data