diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 6421c8601bc25729d841ef517c862c0442940250..e350dd2925298540fc52488f42134a13b9b80937 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -827,10 +827,14 @@ PostmasterMain(int argc, char *argv[])
 	if (output_config_variable != NULL)
 	{
 		/*
-		 * permission is handled because the user is reading inside the data
-		 * dir
+		 * "-C guc" was specified, so print GUC's value and exit.  No extra
+		 * permission check is needed because the user is reading inside the
+		 * data dir.
 		 */
-		puts(GetConfigOption(output_config_variable, false, false));
+		const char *config_val = GetConfigOption(output_config_variable,
+												 false, false);
+
+		puts(config_val ? config_val : "(null)");
 		ExitPostmaster(0);
 	}