The set-parameter list in the errdetail now wraps the separator and quotes in _() so the punctuation is translatable, following 3692a622d3fd. The five GetConfigOption() checks are now a local macro, as suggested.
> The errdetail now lists which recovery_target_* parameters are actually set, > instead of the full candidate list. > This follows Scott's idea to surface the set targets; > following Álvaro, the values are dropped > and a new errhint points to pg_settings for them and their sources. > > I kept the "which ones are set" list in errdetail rather than errhint, > it states the current configuration, which reads as detail, > while the errhint carries the actionable pg_settings pointer.
Please see https://postgr.es/c/3692a622d3fd for more on translatable message construction. You should end up with a translatable string in a _() call like _(", \"%s\"") and the GUC names in a separate string in each case.
Maybe you can make this a local macro to avoid repetitive coding,
#define considerAndComplainAboutGUC(gucname, buf) \ do { \ val = GetConfigOption(gucname, false, false); \ if (val[0] != '\0') \ { \ ntargets++; \ if (buf.len == 0) \ appendStringInfoString(&buf, _("\"%s\""), gucname); \ else \ appendStringInfoString(&buf, _(", \"%s\""), gucname); \ } \ } while (0)
considerAndComplainAboutGUC("recovery_target", buf); considerAndComplainAboutGUC("recovery_target_lsn", buf); and so on. (Of course, you should choose a less stupid macro name, but you get my meaning.)