daveg <daveg@sonic.net> writes:
> I'd like a default, especially for psql, to help identify interactive sessions.
psql can certainly provide a default, and maybe even do something
actually useful like report the -f file it's running. The question here
is whether it is worth the trouble for libpq to try to report an appname
*without* the surrounding application's cooperation. I don't think so.
You are talking dozens if not hundreds of lines of unportable code,
versus one line (per app) of entirely portable code.
regards, tom lane