Commit e45e990e authored by Tom Lane's avatar Tom Lane

Make "postgres -C guc" print "" not "(null)" for null-valued GUCs.

Commit 0b0baf26 et al made this case print "(null)" on the grounds that
that's what happened on platforms that didn't crash.  But neither behavior
was actually intentional.  What we should print is just an empty string,
for compatibility with the behavior of SHOW and other ways of examining
string GUCs.  Those code paths don't distinguish NULL from empty strings,
so we should not here either.  Per gripe from Alain Radix.

Like the previous patch, back-patch to 9.2 where -C option was introduced.

Discussion: <CA+YdpwxPUADrmxSD7+Td=uOshMB1KkDN7G7cf+FGmNjjxMhjbw@mail.gmail.com>
parent 6a9c5181
...@@ -834,7 +834,7 @@ PostmasterMain(int argc, char *argv[]) ...@@ -834,7 +834,7 @@ PostmasterMain(int argc, char *argv[])
const char *config_val = GetConfigOption(output_config_variable, const char *config_val = GetConfigOption(output_config_variable,
false, false); false, false);
puts(config_val ? config_val : "(null)"); puts(config_val ? config_val : "");
ExitPostmaster(0); ExitPostmaster(0);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment