A NOTE has been added to this issue. ====================================================================== http://www.dbmail.org/mantis/view.php?id=884 ====================================================================== Reported By: cmayo Assigned To: ====================================================================== Project: DBMail Issue ID: 884 Category: General Reproducibility: N/A Severity: feature Priority: normal Status: new target: ====================================================================== Date Submitted: 26-Feb-11 17:29 CET Last Modified: 27-Feb-11 14:52 CET ====================================================================== Summary: Suggestion: Use Postgresql 9.0 application_name Description: libzdb-2.8 adds support for Postgresql 9.0 application_name feature.
Using this connections can be identified by application in the system table pg_stat_activity and in the logs e.g. to show which application is causing long running queries. Patch attached against dbmail-3.0.0-rc1 seems to work for me. ====================================================================== ---------------------------------------------------------------------- (0003168) paul (administrator) - 26-Feb-11 19:25 http://www.dbmail.org/mantis/view.php?id=884#c3168 ---------------------------------------------------------------------- thanks for the idea. before I can merge this patch: - the configure script should fail for libzdb < 2.8 - plz use git-format-patch if you can, so I can give credits where they are due. - I'd prefer a solution that doesn't require an api change. - the unit-tests in test/*.c haven't been adapted. I'm attaching an updated patch that covers the unit-tests, but I'm still using libzdb-2.7 here so I can't fully test this yet. ---------------------------------------------------------------------- (0003169) cmayo (reporter) - 27-Feb-11 14:52 http://www.dbmail.org/mantis/view.php?id=884#c3169 ---------------------------------------------------------------------- I couldn't see how to get at PNAME or process_name (or any alternative) from within db_connect() without passing it as a parameter. Any ideas? One alternative would be to do a: SET application_name = '<name>'; inside every program. That would also work with any version of libzdb, but would require a check to see if PostgreSQL was being used. So maybe the whole SET could then be a new function in dm_db.c called just after the db_connect()? Issue History Date Modified Username Field Change ====================================================================== 26-Feb-11 17:29 cmayo New Issue 26-Feb-11 17:29 cmayo File Added: dbmail-3.0.0_rc1-appname.patch 26-Feb-11 19:25 paul Note Added: 0003168 26-Feb-11 19:25 paul File Added: 0001-add-application_name-support-for-libzdb-PG9-cmayo.patch 27-Feb-11 14:52 cmayo Note Added: 0003169 ====================================================================== _______________________________________________ Dbmail-dev mailing list Dbmail-dev@dbmail.org http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev