Seems useful. Though to avoid the risk of breaking anything backwards it should only be allowed for version 9 by using ifdefs. Also the patch need to 1) test if the application_name parameter is set otherwise it will pass a NULL pointer to the connection string 2) and if set, that the length of application_name is less than or equal to NAMEDATALEN - 1 and issue a warning or error if not.
On Jan 2, 2011, at 9:36 PM, Chris Mayo wrote:
PostgreSQL 9.0 adds the feature for connections to set an application name that shows up in logs and the system view pg_stat_activity.
http://www.postgresql.org/docs/9.0/static/runtime-config-logging.html#RUNTIM...
All previous versions of PostgreSQL back to 7.4 were patched in minor releases in December 2009 so that they ignore this parameter e.g. http://www.postgresql.org/docs/9.0/static/release-7-4-27.html
But I think it would cause problems for servers that hadn't been updated.
Patch attached that works for me (both with and without setting application_name). But it is just a quick copy and paste job!
Chris
<libzdb-2.7-appname.patch>-- To unsubscribe: http://www.tildeslash.com/mailman/listinfo/libzdb-general