From f22a3e5ce1237936422471a05cf0776c266034cf Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 22 Jun 2016 11:55:18 -0400 Subject: [PATCH] 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: --- src/backend/postmaster/postmaster.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index b562ea75be3..e2d8d7ae518 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -823,7 +823,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); } -- 2.39.5