Dear hackers, here is a libpq function: PQapplicationname(), I think it may be of some use.
Looking forward to your reply, thank you.