On 2014-05-05 13:07:48 -0400, Tom Lane wrote: > Andres Freund <andres@2ndquadrant.com> writes: > > On 2014-05-05 10:07:46 -0400, Tom Lane wrote: > >> Also, -1 for adding another log_line_prefix escape. If you're routing > >> multiple clusters logging to the same place (which is already a bit > >> unlikely IMO), you can put distinguishing strings in log_line_prefix > >> already. And it's not like we've got an infinite supply of letters > >> for those escapes. > > > Using syslog and including the same config file from multiple clusters > > isn't that uncommon. But I can live without it. > > So, if you are sharing a config file, how is it that you can set a > per-cluster cluster_name but not a per-cluster log_line_prefix?
Well, it's a included file. With log_line_prefix support just cluster_name has to be set per cluster. Without you need string interpolation in the config management to include cluster_name in log_line_prefix.
Attached as cluster-name-in-ps-v3-a.patch is a new version with
the following changes:
* the brackets removed, as suggested by Tom Lane
* static initialization of cluster_name to avoid any possibility
of an uninitialized/null pointer being used before GUC
initialization, as suggested by Andres Freund
* cluster_name moved to config group CONN_AUTH_SETTINGS, on the
basis that it's similar to bonjour_name, but it isn't
really... open to suggestions for a better config_group!
* a small amount of documentation in config.sgml (with cluster_name under Connection Settings, which probably isn't right either)
* sample conf file updated to show cluster_name and %C in
log_line_prefix
A shorter version without the log_line_prefix support that Tom didn't like is attached as cluster-name-in-ps-v3-b.patch. I will try to addthese to the open commitfest, and see if there is something I can usefully review in return.
I verified that SHOW cluster_name works as expected and you can't