daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Jun 17th, 2013 194 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
  2. index ea16c64..d4bfb5c 100644
  3. --- a/src/backend/utils/misc/guc.c
  4. +++ b/src/backend/utils/misc/guc.c
  5. @@ -1046,6 +1046,16 @@ static struct config_bool ConfigureNamesBool[] =
  6.         },
  7.  
  8.         {
  9. +               {"application_in_process_title", PGC_SUSET, STATS_COLLECTOR,
  10. +                       gettext_noop("Display the application name in the process title."),
  11. +                       gettext_noop("Enables updating of the process title with the application name if it is defined in the current connection.")
  12. +               },
  13. +               &application_in_process_title,
  14. +               true,
  15. +               NULL, NULL, NULL
  16. +       },
  17. +
  18. +       {
  19.                 {"autovacuum", PGC_SIGHUP, AUTOVACUUM,
  20.                         gettext_noop("Starts the autovacuum subprocess."),
  21.                         NULL
  22. diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c
  23. index 4baacad..262edd9 100644
  24. --- a/src/backend/utils/misc/ps_status.c
  25. +++ b/src/backend/utils/misc/ps_status.c
  26. @@ -33,7 +33,7 @@
  27.  
  28.  extern char **environ;
  29.  bool           update_process_title = true;
  30. -
  31. +bool application_in_process_title = false;
  32.  
  33.  /*
  34.   * Alternative ways of updating ps display:
  35. @@ -307,7 +307,7 @@ set_ps_display(const char *activity, bool force)
  36.  #endif
  37.  
  38.         ps_buffer_dynamic_len = 0;
  39. -       if (application_name)
  40. +       if (application_name && application_in_process_title)
  41.         {
  42.                 strlcpy(ps_buffer + ps_buffer_fixed_size, application_name,
  43.                                 ps_buffer_size - ps_buffer_fixed_size);
  44. diff --git a/src/include/utils/ps_status.h b/src/include/utils/ps_status.h
  45. index 3f503cc..7521242 100644
  46. --- a/src/include/utils/ps_status.h
  47. +++ b/src/include/utils/ps_status.h
  48. @@ -14,6 +14,8 @@
  49.  
  50.  extern bool update_process_title;
  51.  
  52. +extern bool application_in_process_title;
  53. +
  54.  extern char **save_ps_display_args(int argc, char **argv);
  55.  
  56.  extern void init_ps_display(const char *username, const char *dbname,
RAW Paste Data
Top