From: Tom Lane Date: Wed, 22 Jun 2016 15:55:18 +0000 (-0400) Subject: Make "postgres -C guc" print "" not "(null)" for null-valued GUCs. X-Git-Tag: REL9_2_18~43 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=dd41661d2c613c3e4f8328191758398bfbcbd598;p=postgresql.git Make "postgres -C guc" print "" not "(null)" for null-valued GUCs. Commit 0b0baf262 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: --- diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 6e29609ff6d..99248f57579 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -790,7 +790,7 @@ PostmasterMain(int argc, char *argv[]) const char *config_val = GetConfigOption(output_config_variable, false, false); - puts(config_val ? config_val : "(null)"); + puts(config_val ? config_val : ""); ExitPostmaster(0); }