From 0e21d7e4ae09eb2d11f7bb0c3e6cf4ef8919cec4 Mon Sep 17 00:00:00 2001
From: "Chao Li (HighGo Inc.)" <li.evan.chao@gmail.com>
Date: Thu, 31 Jul 2025 17:02:32 +0800
Subject: [PATCH v1] Add support for dumping raw parse tree with
 debug_print_raw_parse

This patch introduces a small change to log the raw parse tree in the
same way we currently log the parse tree, rewritten tree, and plan tree.
While tracing some queries, I found that being able to inspect the raw
parse tree is also helpful for understanding query transformation.

Although the raw parse tree can be inspected via a debugger, having it
logged simplifies the workflow for those interested in this stage of
query processing, without requiring a debugging session.

To avoid unnecessary log noise for users not interested in this detail,
a new GUC option, "debug_print_raw_parse", has been added.

When starting the PostgreSQL process with "-d N", and N is 3 or higher,
debug_print_raw_parse is enabled automatically, alongside
debug_print_parse.

Author: Chao Li <li.evan.chao@gmail.com>
Discussion: https://www.postgresql.org/message-id/CAEoWx2mcO0Gpo4vd8kPMAFWeJLSp0MeUUnaLdE1x0tSVd-VzUw%40mail.gmail.com
---
 doc/src/sgml/config.sgml                      |    8 +-
 src/backend/tcop/postgres.c                   |    7 +
 src/backend/utils/misc/guc_tables.c           | 2595 ++++++++---------
 src/backend/utils/misc/postgresql.conf.sample |    1 +
 src/include/utils/guc.h                       |    1 +
 5 files changed, 1269 insertions(+), 1343 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 20ccb2d6b54..4370e8307f2 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -7382,6 +7382,11 @@ local0.*    /var/log/postgresql
      </varlistentry>
 
      <varlistentry id="guc-debug-print-parse">
+      <term><varname>debug_print_raw_parse</varname> (<type>boolean</type>)
+      <indexterm>
+       <primary><varname>debug_print_raw_parse</varname> configuration parameter</primary>
+      </indexterm>
+      </term>
       <term><varname>debug_print_parse</varname> (<type>boolean</type>)
       <indexterm>
        <primary><varname>debug_print_parse</varname> configuration parameter</primary>
@@ -7421,7 +7426,8 @@ local0.*    /var/log/postgresql
       <listitem>
        <para>
         When set, <varname>debug_pretty_print</varname> indents the messages
-        produced by <varname>debug_print_parse</varname>,
+        produced by <varname>debug_print_raw_parse</varname>,
+        <varname>debug_print_parse</varname>,
         <varname>debug_print_rewritten</varname>, or
         <varname>debug_print_plan</varname>.  This results in more readable
         but much longer output than the <quote>compact</quote> format used when
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 0cecd464902..d356830f756 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -649,6 +649,10 @@ pg_parse_query(const char *query_string)
 
 	TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string);
 
+	if (Debug_print_raw_parse)
+		elog_node_display(LOG, "raw parse tree", raw_parsetree_list,
+						  Debug_pretty_print);
+
 	return raw_parsetree_list;
 }
 
@@ -3697,7 +3701,10 @@ set_debug_options(int debug_flag, GucContext context, GucSource source)
 	if (debug_flag >= 2)
 		SetConfigOption("log_statement", "all", context, source);
 	if (debug_flag >= 3)
+	{
+		SetConfigOption("debug_print_raw_parse", "true", context, source);
 		SetConfigOption("debug_print_parse", "true", context, source);
+	}
 	if (debug_flag >= 4)
 		SetConfigOption("debug_print_plan", "true", context, source);
 	if (debug_flag >= 5)
diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c
index d14b1678e7f..0a5910524c5 100644
--- a/src/backend/utils/misc/guc_tables.c
+++ b/src/backend/utils/misc/guc_tables.c
@@ -507,6 +507,7 @@ bool		AllowAlterSystem = true;
 bool		log_duration = false;
 bool		Debug_print_plan = false;
 bool		Debug_print_parse = false;
+bool Debug_print_raw_parse = false;
 bool		Debug_print_rewritten = false;
 bool		Debug_pretty_print = true;
 
@@ -788,1366 +789,1276 @@ StaticAssertDecl(lengthof(config_type_names) == (PGC_ENUM + 1),
  */
 
 struct config_bool ConfigureNamesBool[] =
-{
-	{
-		{"enable_seqscan", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's use of sequential-scan plans."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_seqscan,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_indexscan", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's use of index-scan plans."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_indexscan,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_indexonlyscan", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's use of index-only-scan plans."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_indexonlyscan,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_bitmapscan", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's use of bitmap-scan plans."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_bitmapscan,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_tidscan", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's use of TID scan plans."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_tidscan,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_sort", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's use of explicit sort steps."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_sort,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_incremental_sort", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's use of incremental sort steps."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_incremental_sort,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_hashagg", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's use of hashed aggregation plans."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_hashagg,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_material", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's use of materialization."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_material,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_memoize", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's use of memoization."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_memoize,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_nestloop", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's use of nested-loop join plans."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_nestloop,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_mergejoin", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's use of merge join plans."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_mergejoin,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_hashjoin", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's use of hash join plans."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_hashjoin,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_gathermerge", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's use of gather merge plans."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_gathermerge,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_partitionwise_join", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables partitionwise join."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_partitionwise_join,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_partitionwise_aggregate", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables partitionwise aggregation and grouping."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_partitionwise_aggregate,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_parallel_append", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's use of parallel append plans."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_parallel_append,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_parallel_hash", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's use of parallel hash plans."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_parallel_hash,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_partition_pruning", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables plan-time and execution-time partition pruning."),
-			gettext_noop("Allows the query planner and executor to compare partition "
-						 "bounds to conditions in the query to determine which "
-						 "partitions must be scanned."),
-			GUC_EXPLAIN
-		},
-		&enable_partition_pruning,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_presorted_aggregate", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's ability to produce plans that "
-						 "provide presorted input for ORDER BY / DISTINCT aggregate "
-						 "functions."),
-			gettext_noop("Allows the query planner to build plans that provide "
-						 "presorted input for aggregate functions with an ORDER BY / "
-						 "DISTINCT clause.  When disabled, implicit sorts are always "
-						 "performed during execution."),
-			GUC_EXPLAIN
-		},
-		&enable_presorted_aggregate,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_async_append", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables the planner's use of async append plans."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_async_append,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_self_join_elimination", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables removal of unique self-joins."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_self_join_elimination,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_group_by_reordering", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables reordering of GROUP BY keys."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_group_by_reordering,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"enable_distinct_reordering", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables reordering of DISTINCT keys."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&enable_distinct_reordering,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"geqo", PGC_USERSET, QUERY_TUNING_GEQO,
-			gettext_noop("Enables genetic query optimization."),
-			gettext_noop("This algorithm attempts to do planning without "
-						 "exhaustive searching."),
-			GUC_EXPLAIN
-		},
-		&enable_geqo,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		/*
-		 * Not for general use --- used by SET SESSION AUTHORIZATION and SET
-		 * ROLE
-		 */
-		{"is_superuser", PGC_INTERNAL, UNGROUPED,
-			gettext_noop("Shows whether the current user is a superuser."),
-			NULL,
-			GUC_REPORT | GUC_NO_SHOW_ALL | GUC_NO_RESET_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE | GUC_ALLOW_IN_PARALLEL
-		},
-		&current_role_is_superuser,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		/*
-		 * This setting itself cannot be set by ALTER SYSTEM to avoid an
-		 * operator turning this setting off by using ALTER SYSTEM, without a
-		 * way to turn it back on.
-		 */
-		{"allow_alter_system", PGC_SIGHUP, COMPAT_OPTIONS_OTHER,
-			gettext_noop("Allows running the ALTER SYSTEM command."),
-			gettext_noop("Can be set to off for environments where global configuration "
-						 "changes should be made using a different method."),
-			GUC_DISALLOW_IN_AUTO_FILE
-		},
-		&AllowAlterSystem,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"bonjour", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
-			gettext_noop("Enables advertising the server via Bonjour."),
-			NULL
-		},
-		&enable_bonjour,
-		false,
-		check_bonjour, NULL, NULL
-	},
-	{
-		{"track_commit_timestamp", PGC_POSTMASTER, REPLICATION_SENDING,
-			gettext_noop("Collects transaction commit time."),
-			NULL
-		},
-		&track_commit_timestamp,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"ssl", PGC_SIGHUP, CONN_AUTH_SSL,
-			gettext_noop("Enables SSL connections."),
-			NULL
-		},
-		&EnableSSL,
-		false,
-		check_ssl, NULL, NULL
-	},
-	{
-		{"ssl_passphrase_command_supports_reload", PGC_SIGHUP, CONN_AUTH_SSL,
-			gettext_noop("Controls whether \"ssl_passphrase_command\" is called during server reload."),
-			NULL
-		},
-		&ssl_passphrase_command_supports_reload,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"ssl_prefer_server_ciphers", PGC_SIGHUP, CONN_AUTH_SSL,
-			gettext_noop("Give priority to server ciphersuite order."),
-			NULL
-		},
-		&SSLPreferServerCiphers,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"fsync", PGC_SIGHUP, WAL_SETTINGS,
-			gettext_noop("Forces synchronization of updates to disk."),
-			gettext_noop("The server will use the fsync() system call in several places to make "
-						 "sure that updates are physically written to disk. This ensures "
-						 "that a database cluster will recover to a consistent state after "
-						 "an operating system or hardware crash.")
-		},
-		&enableFsync,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"ignore_checksum_failure", PGC_SUSET, DEVELOPER_OPTIONS,
-			gettext_noop("Continues processing after a checksum failure."),
-			gettext_noop("Detection of a checksum failure normally causes PostgreSQL to "
-						 "report an error, aborting the current transaction. Setting "
-						 "ignore_checksum_failure to true causes the system to ignore the failure "
-						 "(but still report a warning), and continue processing. This "
-						 "behavior could cause crashes or other serious problems. Only "
-						 "has an effect if checksums are enabled."),
-			GUC_NOT_IN_SAMPLE
-		},
-		&ignore_checksum_failure,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"zero_damaged_pages", PGC_SUSET, DEVELOPER_OPTIONS,
-			gettext_noop("Continues processing past damaged page headers."),
-			gettext_noop("Detection of a damaged page header normally causes PostgreSQL to "
-						 "report an error, aborting the current transaction. Setting "
-						 "\"zero_damaged_pages\" to true causes the system to instead report a "
-						 "warning, zero out the damaged page, and continue processing. This "
-						 "behavior will destroy data, namely all the rows on the damaged page."),
-			GUC_NOT_IN_SAMPLE
-		},
-		&zero_damaged_pages,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"ignore_invalid_pages", PGC_POSTMASTER, DEVELOPER_OPTIONS,
-			gettext_noop("Continues recovery after an invalid pages failure."),
-			gettext_noop("Detection of WAL records having references to "
-						 "invalid pages during recovery causes PostgreSQL to "
-						 "raise a PANIC-level error, aborting the recovery. "
-						 "Setting \"ignore_invalid_pages\" to true causes "
-						 "the system to ignore invalid page references "
-						 "in WAL records (but still report a warning), "
-						 "and continue recovery. This behavior may cause "
-						 "crashes, data loss, propagate or hide corruption, "
-						 "or other serious problems. Only has an effect "
-						 "during recovery or in standby mode."),
-			GUC_NOT_IN_SAMPLE
-		},
-		&ignore_invalid_pages,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"full_page_writes", PGC_SIGHUP, WAL_SETTINGS,
-			gettext_noop("Writes full pages to WAL when first modified after a checkpoint."),
-			gettext_noop("A page write in process during an operating system crash might be "
-						 "only partially written to disk.  During recovery, the row changes "
-						 "stored in WAL are not enough to recover.  This option writes "
-						 "pages when first modified after a checkpoint to WAL so full recovery "
-						 "is possible.")
-		},
-		&fullPageWrites,
-		true,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"wal_log_hints", PGC_POSTMASTER, WAL_SETTINGS,
-			gettext_noop("Writes full pages to WAL when first modified after a checkpoint, even for a non-critical modification."),
-			NULL
-		},
-		&wal_log_hints,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"wal_init_zero", PGC_SUSET, WAL_SETTINGS,
-			gettext_noop("Writes zeroes to new WAL files before first use."),
-			NULL
-		},
-		&wal_init_zero,
-		true,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"wal_recycle", PGC_SUSET, WAL_SETTINGS,
-			gettext_noop("Recycles WAL files by renaming them."),
-			NULL
-		},
-		&wal_recycle,
-		true,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"log_checkpoints", PGC_SIGHUP, LOGGING_WHAT,
-			gettext_noop("Logs each checkpoint."),
-			NULL
-		},
-		&log_checkpoints,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"trace_connection_negotiation", PGC_POSTMASTER, DEVELOPER_OPTIONS,
-			gettext_noop("Logs details of pre-authentication connection handshake."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&Trace_connection_negotiation,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"log_disconnections", PGC_SU_BACKEND, LOGGING_WHAT,
-			gettext_noop("Logs end of a session, including duration."),
-			NULL
-		},
-		&Log_disconnections,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"log_replication_commands", PGC_SUSET, LOGGING_WHAT,
-			gettext_noop("Logs each replication command."),
-			NULL
-		},
-		&log_replication_commands,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"debug_assertions", PGC_INTERNAL, PRESET_OPTIONS,
-			gettext_noop("Shows whether the running server has assertion checks enabled."),
-			NULL,
-			GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
-		},
-		&assert_enabled,
-		DEFAULT_ASSERT_ENABLED,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"exit_on_error", PGC_USERSET, ERROR_HANDLING_OPTIONS,
-			gettext_noop("Terminate session on any error."),
-			NULL
-		},
-		&ExitOnAnyError,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"restart_after_crash", PGC_SIGHUP, ERROR_HANDLING_OPTIONS,
-			gettext_noop("Reinitialize server after backend crash."),
-			NULL
-		},
-		&restart_after_crash,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"remove_temp_files_after_crash", PGC_SIGHUP, DEVELOPER_OPTIONS,
-			gettext_noop("Remove temporary files after backend crash."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&remove_temp_files_after_crash,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"send_abort_for_crash", PGC_SIGHUP, DEVELOPER_OPTIONS,
-			gettext_noop("Send SIGABRT not SIGQUIT to child processes after backend crash."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&send_abort_for_crash,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"send_abort_for_kill", PGC_SIGHUP, DEVELOPER_OPTIONS,
-			gettext_noop("Send SIGABRT not SIGKILL to stuck child processes."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&send_abort_for_kill,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"log_duration", PGC_SUSET, LOGGING_WHAT,
-			gettext_noop("Logs the duration of each completed SQL statement."),
-			NULL
-		},
-		&log_duration,
-		false,
-		NULL, NULL, NULL
-	},
-#ifdef DEBUG_NODE_TESTS_ENABLED
-	{
-		{"debug_copy_parse_plan_trees", PGC_SUSET, DEVELOPER_OPTIONS,
-			gettext_noop("Set this to force all parse and plan trees to be passed through "
-						 "copyObject(), to facilitate catching errors and omissions in "
-						 "copyObject()."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&Debug_copy_parse_plan_trees,
-/* support for legacy compile-time setting */
-#ifdef COPY_PARSE_PLAN_TREES
-		true,
-#else
-		false,
-#endif
-		NULL, NULL, NULL
-	},
-	{
-		{"debug_write_read_parse_plan_trees", PGC_SUSET, DEVELOPER_OPTIONS,
-			gettext_noop("Set this to force all parse and plan trees to be passed through "
-						 "outfuncs.c/readfuncs.c, to facilitate catching errors and omissions in "
-						 "those modules."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&Debug_write_read_parse_plan_trees,
-/* support for legacy compile-time setting */
-#ifdef WRITE_READ_PARSE_PLAN_TREES
-		true,
-#else
-		false,
-#endif
-		NULL, NULL, NULL
-	},
-	{
-		{"debug_raw_expression_coverage_test", PGC_SUSET, DEVELOPER_OPTIONS,
-			gettext_noop("Set this to force all raw parse trees for DML statements to be scanned "
-						 "by raw_expression_tree_walker(), to facilitate catching errors and "
-						 "omissions in that function."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&Debug_raw_expression_coverage_test,
-/* support for legacy compile-time setting */
-#ifdef RAW_EXPRESSION_COVERAGE_TEST
-		true,
-#else
-		false,
-#endif
-		NULL, NULL, NULL
-	},
-#endif							/* DEBUG_NODE_TESTS_ENABLED */
-	{
-		{"debug_print_parse", PGC_USERSET, LOGGING_WHAT,
-			gettext_noop("Logs each query's parse tree."),
-			NULL
-		},
-		&Debug_print_parse,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"debug_print_rewritten", PGC_USERSET, LOGGING_WHAT,
-			gettext_noop("Logs each query's rewritten parse tree."),
-			NULL
-		},
-		&Debug_print_rewritten,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"debug_print_plan", PGC_USERSET, LOGGING_WHAT,
-			gettext_noop("Logs each query's execution plan."),
-			NULL
-		},
-		&Debug_print_plan,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"debug_pretty_print", PGC_USERSET, LOGGING_WHAT,
-			gettext_noop("Indents parse and plan tree displays."),
-			NULL
-		},
-		&Debug_pretty_print,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"log_parser_stats", PGC_SUSET, STATS_MONITORING,
-			gettext_noop("Writes parser performance statistics to the server log."),
-			NULL
-		},
-		&log_parser_stats,
-		false,
-		check_stage_log_stats, NULL, NULL
-	},
-	{
-		{"log_planner_stats", PGC_SUSET, STATS_MONITORING,
-			gettext_noop("Writes planner performance statistics to the server log."),
-			NULL
-		},
-		&log_planner_stats,
-		false,
-		check_stage_log_stats, NULL, NULL
-	},
-	{
-		{"log_executor_stats", PGC_SUSET, STATS_MONITORING,
-			gettext_noop("Writes executor performance statistics to the server log."),
-			NULL
-		},
-		&log_executor_stats,
-		false,
-		check_stage_log_stats, NULL, NULL
-	},
-	{
-		{"log_statement_stats", PGC_SUSET, STATS_MONITORING,
-			gettext_noop("Writes cumulative performance statistics to the server log."),
-			NULL
-		},
-		&log_statement_stats,
-		false,
-		check_log_stats, NULL, NULL
-	},
-#ifdef BTREE_BUILD_STATS
-	{
-		{"log_btree_build_stats", PGC_SUSET, DEVELOPER_OPTIONS,
-			gettext_noop("Logs system resource usage statistics (memory and CPU) on various B-tree operations."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&log_btree_build_stats,
-		false,
-		NULL, NULL, NULL
-	},
-#endif
-
-	{
-		{"track_activities", PGC_SUSET, STATS_CUMULATIVE,
-			gettext_noop("Collects information about executing commands."),
-			gettext_noop("Enables the collection of information on the currently "
-						 "executing command of each session, along with "
-						 "the time at which that command began execution.")
-		},
-		&pgstat_track_activities,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"track_counts", PGC_SUSET, STATS_CUMULATIVE,
-			gettext_noop("Collects statistics on database activity."),
-			NULL
-		},
-		&pgstat_track_counts,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"track_cost_delay_timing", PGC_SUSET, STATS_CUMULATIVE,
-			gettext_noop("Collects timing statistics for cost-based vacuum delay."),
-			NULL
-		},
-		&track_cost_delay_timing,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"track_io_timing", PGC_SUSET, STATS_CUMULATIVE,
-			gettext_noop("Collects timing statistics for database I/O activity."),
-			NULL
-		},
-		&track_io_timing,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"track_wal_io_timing", PGC_SUSET, STATS_CUMULATIVE,
-			gettext_noop("Collects timing statistics for WAL I/O activity."),
-			NULL
-		},
-		&track_wal_io_timing,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"update_process_title", PGC_SUSET, PROCESS_TITLE,
-			gettext_noop("Updates the process title to show the active SQL command."),
-			gettext_noop("Enables updating of the process title every time a new SQL command is received by the server.")
-		},
-		&update_process_title,
-		DEFAULT_UPDATE_PROCESS_TITLE,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"autovacuum", PGC_SIGHUP, VACUUM_AUTOVACUUM,
-			gettext_noop("Starts the autovacuum subprocess."),
-			NULL
-		},
-		&autovacuum_start_daemon,
-		true,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"trace_notify", PGC_USERSET, DEVELOPER_OPTIONS,
-			gettext_noop("Generates debugging output for LISTEN and NOTIFY."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&Trace_notify,
-		false,
-		NULL, NULL, NULL
-	},
-
-#ifdef LOCK_DEBUG
-	{
-		{"trace_locks", PGC_SUSET, DEVELOPER_OPTIONS,
-			gettext_noop("Emits information about lock usage."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&Trace_locks,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"trace_userlocks", PGC_SUSET, DEVELOPER_OPTIONS,
-			gettext_noop("Emits information about user lock usage."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&Trace_userlocks,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"trace_lwlocks", PGC_SUSET, DEVELOPER_OPTIONS,
-			gettext_noop("Emits information about lightweight lock usage."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&Trace_lwlocks,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"debug_deadlocks", PGC_SUSET, DEVELOPER_OPTIONS,
-			gettext_noop("Dumps information about all current locks when a deadlock timeout occurs."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&Debug_deadlocks,
-		false,
-		NULL, NULL, NULL
-	},
-#endif
-
-	{
-		{"log_lock_waits", PGC_SUSET, LOGGING_WHAT,
-			gettext_noop("Logs long lock waits."),
-			NULL
-		},
-		&log_lock_waits,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"log_lock_failures", PGC_SUSET, LOGGING_WHAT,
-			gettext_noop("Logs lock failures."),
-			NULL
-		},
-		&log_lock_failures,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"log_recovery_conflict_waits", PGC_SIGHUP, LOGGING_WHAT,
-			gettext_noop("Logs standby recovery conflict waits."),
-			NULL
-		},
-		&log_recovery_conflict_waits,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"log_hostname", PGC_SIGHUP, LOGGING_WHAT,
-			gettext_noop("Logs the host name in the connection logs."),
-			gettext_noop("By default, connection logs only show the IP address "
-						 "of the connecting host. If you want them to show the host name you "
-						 "can turn this on, but depending on your host name resolution "
-						 "setup it might impose a non-negligible performance penalty.")
-		},
-		&log_hostname,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"transform_null_equals", PGC_USERSET, COMPAT_OPTIONS_OTHER,
-			gettext_noop("Treats \"expr=NULL\" as \"expr IS NULL\"."),
-			gettext_noop("When turned on, expressions of the form expr = NULL "
-						 "(or NULL = expr) are treated as expr IS NULL, that is, they "
-						 "return true if expr evaluates to the null value, and false "
-						 "otherwise. The correct behavior of expr = NULL is to always "
-						 "return null (unknown).")
-		},
-		&Transform_null_equals,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"default_transaction_read_only", PGC_USERSET, CLIENT_CONN_STATEMENT,
-			gettext_noop("Sets the default read-only status of new transactions."),
-			NULL,
-			GUC_REPORT
-		},
-		&DefaultXactReadOnly,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"transaction_read_only", PGC_USERSET, CLIENT_CONN_STATEMENT,
-			gettext_noop("Sets the current transaction's read-only status."),
-			NULL,
-			GUC_NO_RESET | GUC_NO_RESET_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
-		},
-		&XactReadOnly,
-		false,
-		check_transaction_read_only, NULL, NULL
-	},
-	{
-		{"default_transaction_deferrable", PGC_USERSET, CLIENT_CONN_STATEMENT,
-			gettext_noop("Sets the default deferrable status of new transactions."),
-			NULL
-		},
-		&DefaultXactDeferrable,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"transaction_deferrable", PGC_USERSET, CLIENT_CONN_STATEMENT,
-			gettext_noop("Whether to defer a read-only serializable transaction until it can be executed with no possible serialization failures."),
-			NULL,
-			GUC_NO_RESET | GUC_NO_RESET_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
-		},
-		&XactDeferrable,
-		false,
-		check_transaction_deferrable, NULL, NULL
-	},
-	{
-		{"row_security", PGC_USERSET, CLIENT_CONN_STATEMENT,
-			gettext_noop("Enables row security."),
-			gettext_noop("When enabled, row security will be applied to all users.")
-		},
-		&row_security,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"check_function_bodies", PGC_USERSET, CLIENT_CONN_STATEMENT,
-			gettext_noop("Check routine bodies during CREATE FUNCTION and CREATE PROCEDURE."),
-			NULL
-		},
-		&check_function_bodies,
-		true,
-		NULL, NULL, NULL
-	},
-	{
-		{"array_nulls", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
-			gettext_noop("Enables input of NULL elements in arrays."),
-			gettext_noop("When turned on, unquoted NULL in an array input "
-						 "value means a null value; "
-						 "otherwise it is taken literally.")
-		},
-		&Array_nulls,
-		true,
-		NULL, NULL, NULL
-	},
-
-	/*
-	 * WITH OIDS support, and consequently default_with_oids, was removed in
-	 * PostgreSQL 12, but we tolerate the parameter being set to false to
-	 * avoid unnecessarily breaking older dump files.
-	 */
-	{
-		{"default_with_oids", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
-			gettext_noop("WITH OIDS is no longer supported; this can only be false."),
-			NULL,
-			GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
-		},
-		&default_with_oids,
-		false,
-		check_default_with_oids, NULL, NULL
-	},
-	{
-		{"logging_collector", PGC_POSTMASTER, LOGGING_WHERE,
-			gettext_noop("Start a subprocess to capture stderr, csvlog and/or jsonlog into log files."),
-			NULL
-		},
-		&Logging_collector,
-		false,
-		NULL, NULL, NULL
-	},
-	{
-		{"log_truncate_on_rotation", PGC_SIGHUP, LOGGING_WHERE,
-			gettext_noop("Truncate existing log files of same name during log rotation."),
-			NULL
-		},
-		&Log_truncate_on_rotation,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"trace_sort", PGC_USERSET, DEVELOPER_OPTIONS,
-			gettext_noop("Emit information about resource usage in sorting."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&trace_sort,
-		false,
-		NULL, NULL, NULL
-	},
-
-#ifdef TRACE_SYNCSCAN
-	/* this is undocumented because not exposed in a standard build */
 	{
-		{"trace_syncscan", PGC_USERSET, DEVELOPER_OPTIONS,
-			gettext_noop("Generate debugging output for synchronized scanning."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&trace_syncscan,
-		false,
-		NULL, NULL, NULL
-	},
+		{{"enable_seqscan", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's use of sequential-scan plans."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_seqscan,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_indexscan", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's use of index-scan plans."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_indexscan,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_indexonlyscan", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's use of index-only-scan plans."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_indexonlyscan,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_bitmapscan", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's use of bitmap-scan plans."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_bitmapscan,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_tidscan", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's use of TID scan plans."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_tidscan,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_sort", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's use of explicit sort steps."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_sort,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_incremental_sort", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's use of incremental sort steps."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_incremental_sort,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_hashagg", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's use of hashed aggregation plans."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_hashagg,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_material", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's use of materialization."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_material,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_memoize", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's use of memoization."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_memoize,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_nestloop", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's use of nested-loop join plans."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_nestloop,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_mergejoin", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's use of merge join plans."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_mergejoin,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_hashjoin", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's use of hash join plans."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_hashjoin,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_gathermerge", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's use of gather merge plans."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_gathermerge,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_partitionwise_join", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables partitionwise join."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_partitionwise_join,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_partitionwise_aggregate", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables partitionwise aggregation and grouping."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_partitionwise_aggregate,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_parallel_append", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's use of parallel append plans."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_parallel_append,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_parallel_hash", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's use of parallel hash plans."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_parallel_hash,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_partition_pruning", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables plan-time and execution-time partition pruning."),
+		  gettext_noop("Allows the query planner and executor to compare partition "
+					   "bounds to conditions in the query to determine which "
+					   "partitions must be scanned."),
+		  GUC_EXPLAIN},
+		 &enable_partition_pruning,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_presorted_aggregate", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's ability to produce plans that "
+					   "provide presorted input for ORDER BY / DISTINCT aggregate "
+					   "functions."),
+		  gettext_noop("Allows the query planner to build plans that provide "
+					   "presorted input for aggregate functions with an ORDER BY / "
+					   "DISTINCT clause.  When disabled, implicit sorts are always "
+					   "performed during execution."),
+		  GUC_EXPLAIN},
+		 &enable_presorted_aggregate,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_async_append", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables the planner's use of async append plans."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_async_append,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_self_join_elimination", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables removal of unique self-joins."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_self_join_elimination,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_group_by_reordering", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables reordering of GROUP BY keys."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_group_by_reordering,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"enable_distinct_reordering", PGC_USERSET, QUERY_TUNING_METHOD,
+		  gettext_noop("Enables reordering of DISTINCT keys."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &enable_distinct_reordering,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"geqo", PGC_USERSET, QUERY_TUNING_GEQO,
+		  gettext_noop("Enables genetic query optimization."),
+		  gettext_noop("This algorithm attempts to do planning without "
+					   "exhaustive searching."),
+		  GUC_EXPLAIN},
+		 &enable_geqo,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{/*
+		  * Not for general use --- used by SET SESSION AUTHORIZATION and SET
+		  * ROLE
+		  */
+		 {"is_superuser", PGC_INTERNAL, UNGROUPED,
+		  gettext_noop("Shows whether the current user is a superuser."),
+		  NULL,
+		  GUC_REPORT | GUC_NO_SHOW_ALL | GUC_NO_RESET_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE | GUC_ALLOW_IN_PARALLEL},
+		 &current_role_is_superuser,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{/*
+		  * This setting itself cannot be set by ALTER SYSTEM to avoid an
+		  * operator turning this setting off by using ALTER SYSTEM, without a
+		  * way to turn it back on.
+		  */
+		 {"allow_alter_system", PGC_SIGHUP, COMPAT_OPTIONS_OTHER,
+		  gettext_noop("Allows running the ALTER SYSTEM command."),
+		  gettext_noop("Can be set to off for environments where global configuration "
+					   "changes should be made using a different method."),
+		  GUC_DISALLOW_IN_AUTO_FILE},
+		 &AllowAlterSystem,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"bonjour", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
+		  gettext_noop("Enables advertising the server via Bonjour."),
+		  NULL},
+		 &enable_bonjour,
+		 false,
+		 check_bonjour,
+		 NULL,
+		 NULL},
+		{{"track_commit_timestamp", PGC_POSTMASTER, REPLICATION_SENDING,
+		  gettext_noop("Collects transaction commit time."),
+		  NULL},
+		 &track_commit_timestamp,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"ssl", PGC_SIGHUP, CONN_AUTH_SSL,
+		  gettext_noop("Enables SSL connections."),
+		  NULL},
+		 &EnableSSL,
+		 false,
+		 check_ssl,
+		 NULL,
+		 NULL},
+		{{"ssl_passphrase_command_supports_reload", PGC_SIGHUP, CONN_AUTH_SSL,
+		  gettext_noop("Controls whether \"ssl_passphrase_command\" is called during server reload."),
+		  NULL},
+		 &ssl_passphrase_command_supports_reload,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"ssl_prefer_server_ciphers", PGC_SIGHUP, CONN_AUTH_SSL,
+		  gettext_noop("Give priority to server ciphersuite order."),
+		  NULL},
+		 &SSLPreferServerCiphers,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"fsync", PGC_SIGHUP, WAL_SETTINGS,
+		  gettext_noop("Forces synchronization of updates to disk."),
+		  gettext_noop("The server will use the fsync() system call in several places to make "
+					   "sure that updates are physically written to disk. This ensures "
+					   "that a database cluster will recover to a consistent state after "
+					   "an operating system or hardware crash.")},
+		 &enableFsync,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"ignore_checksum_failure", PGC_SUSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Continues processing after a checksum failure."),
+		  gettext_noop("Detection of a checksum failure normally causes PostgreSQL to "
+					   "report an error, aborting the current transaction. Setting "
+					   "ignore_checksum_failure to true causes the system to ignore the failure "
+					   "(but still report a warning), and continue processing. This "
+					   "behavior could cause crashes or other serious problems. Only "
+					   "has an effect if checksums are enabled."),
+		  GUC_NOT_IN_SAMPLE},
+		 &ignore_checksum_failure,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"zero_damaged_pages", PGC_SUSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Continues processing past damaged page headers."),
+		  gettext_noop("Detection of a damaged page header normally causes PostgreSQL to "
+					   "report an error, aborting the current transaction. Setting "
+					   "\"zero_damaged_pages\" to true causes the system to instead report a "
+					   "warning, zero out the damaged page, and continue processing. This "
+					   "behavior will destroy data, namely all the rows on the damaged page."),
+		  GUC_NOT_IN_SAMPLE},
+		 &zero_damaged_pages,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"ignore_invalid_pages", PGC_POSTMASTER, DEVELOPER_OPTIONS,
+		  gettext_noop("Continues recovery after an invalid pages failure."),
+		  gettext_noop("Detection of WAL records having references to "
+					   "invalid pages during recovery causes PostgreSQL to "
+					   "raise a PANIC-level error, aborting the recovery. "
+					   "Setting \"ignore_invalid_pages\" to true causes "
+					   "the system to ignore invalid page references "
+					   "in WAL records (but still report a warning), "
+					   "and continue recovery. This behavior may cause "
+					   "crashes, data loss, propagate or hide corruption, "
+					   "or other serious problems. Only has an effect "
+					   "during recovery or in standby mode."),
+		  GUC_NOT_IN_SAMPLE},
+		 &ignore_invalid_pages,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"full_page_writes", PGC_SIGHUP, WAL_SETTINGS,
+		  gettext_noop("Writes full pages to WAL when first modified after a checkpoint."),
+		  gettext_noop("A page write in process during an operating system crash might be "
+					   "only partially written to disk.  During recovery, the row changes "
+					   "stored in WAL are not enough to recover.  This option writes "
+					   "pages when first modified after a checkpoint to WAL so full recovery "
+					   "is possible.")},
+		 &fullPageWrites,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"wal_log_hints", PGC_POSTMASTER, WAL_SETTINGS,
+		  gettext_noop("Writes full pages to WAL when first modified after a checkpoint, even for a non-critical modification."),
+		  NULL},
+		 &wal_log_hints,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"wal_init_zero", PGC_SUSET, WAL_SETTINGS,
+		  gettext_noop("Writes zeroes to new WAL files before first use."),
+		  NULL},
+		 &wal_init_zero,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"wal_recycle", PGC_SUSET, WAL_SETTINGS,
+		  gettext_noop("Recycles WAL files by renaming them."),
+		  NULL},
+		 &wal_recycle,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"log_checkpoints", PGC_SIGHUP, LOGGING_WHAT,
+		  gettext_noop("Logs each checkpoint."),
+		  NULL},
+		 &log_checkpoints,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"trace_connection_negotiation", PGC_POSTMASTER, DEVELOPER_OPTIONS,
+		  gettext_noop("Logs details of pre-authentication connection handshake."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &Trace_connection_negotiation,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"log_disconnections", PGC_SU_BACKEND, LOGGING_WHAT,
+		  gettext_noop("Logs end of a session, including duration."),
+		  NULL},
+		 &Log_disconnections,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"log_replication_commands", PGC_SUSET, LOGGING_WHAT,
+		  gettext_noop("Logs each replication command."),
+		  NULL},
+		 &log_replication_commands,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"debug_assertions", PGC_INTERNAL, PRESET_OPTIONS,
+		  gettext_noop("Shows whether the running server has assertion checks enabled."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE},
+		 &assert_enabled,
+		 DEFAULT_ASSERT_ENABLED,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"exit_on_error", PGC_USERSET, ERROR_HANDLING_OPTIONS,
+		  gettext_noop("Terminate session on any error."),
+		  NULL},
+		 &ExitOnAnyError,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"restart_after_crash", PGC_SIGHUP, ERROR_HANDLING_OPTIONS,
+		  gettext_noop("Reinitialize server after backend crash."),
+		  NULL},
+		 &restart_after_crash,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"remove_temp_files_after_crash", PGC_SIGHUP, DEVELOPER_OPTIONS,
+		  gettext_noop("Remove temporary files after backend crash."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &remove_temp_files_after_crash,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"send_abort_for_crash", PGC_SIGHUP, DEVELOPER_OPTIONS,
+		  gettext_noop("Send SIGABRT not SIGQUIT to child processes after backend crash."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &send_abort_for_crash,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"send_abort_for_kill", PGC_SIGHUP, DEVELOPER_OPTIONS,
+		  gettext_noop("Send SIGABRT not SIGKILL to stuck child processes."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &send_abort_for_kill,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"log_duration", PGC_SUSET, LOGGING_WHAT,
+		  gettext_noop("Logs the duration of each completed SQL statement."),
+		  NULL},
+		 &log_duration,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+#ifdef DEBUG_NODE_TESTS_ENABLED
+		{{"debug_copy_parse_plan_trees", PGC_SUSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Set this to force all parse and plan trees to be passed through "
+					   "copyObject(), to facilitate catching errors and omissions in "
+					   "copyObject()."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &Debug_copy_parse_plan_trees,
+/* support for legacy compile-time setting */
+#ifdef COPY_PARSE_PLAN_TREES
+		 true,
+#else
+		 false,
 #endif
-
-#ifdef DEBUG_BOUNDED_SORT
-	/* this is undocumented because not exposed in a standard build */
-	{
-		{
-			"optimize_bounded_sort", PGC_USERSET, QUERY_TUNING_METHOD,
-			gettext_noop("Enables bounded sorting using heap sort."),
-			NULL,
-			GUC_NOT_IN_SAMPLE | GUC_EXPLAIN
-		},
-		&optimize_bounded_sort,
-		true,
-		NULL, NULL, NULL
-	},
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"debug_write_read_parse_plan_trees", PGC_SUSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Set this to force all parse and plan trees to be passed through "
+					   "outfuncs.c/readfuncs.c, to facilitate catching errors and omissions in "
+					   "those modules."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &Debug_write_read_parse_plan_trees,
+/* support for legacy compile-time setting */
+#ifdef WRITE_READ_PARSE_PLAN_TREES
+		 true,
+#else
+		 false,
 #endif
-
-#ifdef WAL_DEBUG
-	{
-		{"wal_debug", PGC_SUSET, DEVELOPER_OPTIONS,
-			gettext_noop("Emit WAL-related debugging output."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&XLOG_DEBUG,
-		false,
-		NULL, NULL, NULL
-	},
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"debug_raw_expression_coverage_test", PGC_SUSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Set this to force all raw parse trees for DML statements to be scanned "
+					   "by raw_expression_tree_walker(), to facilitate catching errors and "
+					   "omissions in that function."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &Debug_raw_expression_coverage_test,
+/* support for legacy compile-time setting */
+#ifdef RAW_EXPRESSION_COVERAGE_TEST
+		 true,
+#else
+		 false,
+#endif
+		 NULL,
+		 NULL,
+		 NULL},
+#endif							/* DEBUG_NODE_TESTS_ENABLED */
+		{{"debug_print_raw_parse", PGC_USERSET, LOGGING_WHAT,
+		  gettext_noop("Logs each query's raw parse tree."),
+		  NULL},
+		 &Debug_print_raw_parse,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"debug_print_parse", PGC_USERSET, LOGGING_WHAT,
+		  gettext_noop("Logs each query's parse tree."),
+		  NULL},
+		 &Debug_print_parse,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"debug_print_rewritten", PGC_USERSET, LOGGING_WHAT,
+		  gettext_noop("Logs each query's rewritten parse tree."),
+		  NULL},
+		 &Debug_print_rewritten,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"debug_print_plan", PGC_USERSET, LOGGING_WHAT,
+		  gettext_noop("Logs each query's execution plan."),
+		  NULL},
+		 &Debug_print_plan,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"debug_pretty_print", PGC_USERSET, LOGGING_WHAT,
+		  gettext_noop("Indents parse and plan tree displays."),
+		  NULL},
+		 &Debug_pretty_print,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"log_parser_stats", PGC_SUSET, STATS_MONITORING,
+		  gettext_noop("Writes parser performance statistics to the server log."),
+		  NULL},
+		 &log_parser_stats,
+		 false,
+		 check_stage_log_stats,
+		 NULL,
+		 NULL},
+		{{"log_planner_stats", PGC_SUSET, STATS_MONITORING,
+		  gettext_noop("Writes planner performance statistics to the server log."),
+		  NULL},
+		 &log_planner_stats,
+		 false,
+		 check_stage_log_stats,
+		 NULL,
+		 NULL},
+		{{"log_executor_stats", PGC_SUSET, STATS_MONITORING,
+		  gettext_noop("Writes executor performance statistics to the server log."),
+		  NULL},
+		 &log_executor_stats,
+		 false,
+		 check_stage_log_stats,
+		 NULL,
+		 NULL},
+		{{"log_statement_stats", PGC_SUSET, STATS_MONITORING,
+		  gettext_noop("Writes cumulative performance statistics to the server log."),
+		  NULL},
+		 &log_statement_stats,
+		 false,
+		 check_log_stats,
+		 NULL,
+		 NULL},
+#ifdef BTREE_BUILD_STATS
+		{{"log_btree_build_stats", PGC_SUSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Logs system resource usage statistics (memory and CPU) on various B-tree operations."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &log_btree_build_stats,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
 #endif
 
-	{
-		{"integer_datetimes", PGC_INTERNAL, PRESET_OPTIONS,
-			gettext_noop("Shows whether datetimes are integer based."),
-			NULL,
-			GUC_REPORT | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
-		},
-		&integer_datetimes,
-		true,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"krb_caseins_users", PGC_SIGHUP, CONN_AUTH_AUTH,
-			gettext_noop("Sets whether Kerberos and GSSAPI user names should be treated as case-insensitive."),
-			NULL
-		},
-		&pg_krb_caseins_users,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"gss_accept_delegation", PGC_SIGHUP, CONN_AUTH_AUTH,
-			gettext_noop("Sets whether GSSAPI delegation should be accepted from the client."),
-			NULL
-		},
-		&pg_gss_accept_delegation,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"escape_string_warning", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
-			gettext_noop("Warn about backslash escapes in ordinary string literals."),
-			NULL
-		},
-		&escape_string_warning,
-		true,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"standard_conforming_strings", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
-			gettext_noop("Causes '...' strings to treat backslashes literally."),
-			NULL,
-			GUC_REPORT
-		},
-		&standard_conforming_strings,
-		true,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"synchronize_seqscans", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
-			gettext_noop("Enables synchronized sequential scans."),
-			NULL
-		},
-		&synchronize_seqscans,
-		true,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"recovery_target_inclusive", PGC_POSTMASTER, WAL_RECOVERY_TARGET,
-			gettext_noop("Sets whether to include or exclude transaction with recovery target."),
-			NULL
-		},
-		&recoveryTargetInclusive,
-		true,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"summarize_wal", PGC_SIGHUP, WAL_SUMMARIZATION,
-			gettext_noop("Starts the WAL summarizer process to enable incremental backup."),
-			NULL
-		},
-		&summarize_wal,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"hot_standby", PGC_POSTMASTER, REPLICATION_STANDBY,
-			gettext_noop("Allows connections and queries during recovery."),
-			NULL
-		},
-		&EnableHotStandby,
-		true,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"hot_standby_feedback", PGC_SIGHUP, REPLICATION_STANDBY,
-			gettext_noop("Allows feedback from a hot standby to the primary that will avoid query conflicts."),
-			NULL
-		},
-		&hot_standby_feedback,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"in_hot_standby", PGC_INTERNAL, PRESET_OPTIONS,
-			gettext_noop("Shows whether hot standby is currently active."),
-			NULL,
-			GUC_REPORT | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
-		},
-		&in_hot_standby_guc,
-		false,
-		NULL, NULL, show_in_hot_standby
-	},
-
-	{
-		{"allow_system_table_mods", PGC_SUSET, DEVELOPER_OPTIONS,
-			gettext_noop("Allows modifications of the structure of system tables."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&allowSystemTableMods,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"ignore_system_indexes", PGC_BACKEND, DEVELOPER_OPTIONS,
-			gettext_noop("Disables reading from system indexes."),
-			gettext_noop("It does not prevent updating the indexes, so it is safe "
-						 "to use.  The worst consequence is slowness."),
-			GUC_NOT_IN_SAMPLE
-		},
-		&IgnoreSystemIndexes,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"allow_in_place_tablespaces", PGC_SUSET, DEVELOPER_OPTIONS,
-			gettext_noop("Allows tablespaces directly inside pg_tblspc, for testing."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&allow_in_place_tablespaces,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"lo_compat_privileges", PGC_SUSET, COMPAT_OPTIONS_PREVIOUS,
-			gettext_noop("Enables backward compatibility mode for privilege checks on large objects."),
-			gettext_noop("Skips privilege checks when reading or modifying large objects, "
-						 "for compatibility with PostgreSQL releases prior to 9.0.")
-		},
-		&lo_compat_privileges,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"quote_all_identifiers", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
-			gettext_noop("When generating SQL fragments, quote all identifiers."),
-			NULL,
-		},
-		&quote_all_identifiers,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"data_checksums", PGC_INTERNAL, PRESET_OPTIONS,
-			gettext_noop("Shows whether data checksums are turned on for this cluster."),
-			NULL,
-			GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE | GUC_RUNTIME_COMPUTED
-		},
-		&data_checksums,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"syslog_sequence_numbers", PGC_SIGHUP, LOGGING_WHERE,
-			gettext_noop("Add sequence number to syslog messages to avoid duplicate suppression."),
-			NULL
-		},
-		&syslog_sequence_numbers,
-		true,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"syslog_split_messages", PGC_SIGHUP, LOGGING_WHERE,
-			gettext_noop("Split messages sent to syslog by lines and to fit into 1024 bytes."),
-			NULL
-		},
-		&syslog_split_messages,
-		true,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"parallel_leader_participation", PGC_USERSET, RESOURCES_WORKER_PROCESSES,
-			gettext_noop("Controls whether Gather and Gather Merge also run subplans."),
-			gettext_noop("Should gather nodes also run subplans or just gather tuples?"),
-			GUC_EXPLAIN
-		},
-		&parallel_leader_participation,
-		true,
-		NULL, NULL, NULL
-	},
+		{{"track_activities", PGC_SUSET, STATS_CUMULATIVE,
+		  gettext_noop("Collects information about executing commands."),
+		  gettext_noop("Enables the collection of information on the currently "
+					   "executing command of each session, along with "
+					   "the time at which that command began execution.")},
+		 &pgstat_track_activities,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"track_counts", PGC_SUSET, STATS_CUMULATIVE,
+		  gettext_noop("Collects statistics on database activity."),
+		  NULL},
+		 &pgstat_track_counts,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"track_cost_delay_timing", PGC_SUSET, STATS_CUMULATIVE,
+		  gettext_noop("Collects timing statistics for cost-based vacuum delay."),
+		  NULL},
+		 &track_cost_delay_timing,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"track_io_timing", PGC_SUSET, STATS_CUMULATIVE,
+		  gettext_noop("Collects timing statistics for database I/O activity."),
+		  NULL},
+		 &track_io_timing,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"track_wal_io_timing", PGC_SUSET, STATS_CUMULATIVE,
+		  gettext_noop("Collects timing statistics for WAL I/O activity."),
+		  NULL},
+		 &track_wal_io_timing,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"update_process_title", PGC_SUSET, PROCESS_TITLE,
+		  gettext_noop("Updates the process title to show the active SQL command."),
+		  gettext_noop("Enables updating of the process title every time a new SQL command is received by the server.")},
+		 &update_process_title,
+		 DEFAULT_UPDATE_PROCESS_TITLE,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"autovacuum", PGC_SIGHUP, VACUUM_AUTOVACUUM,
+		  gettext_noop("Starts the autovacuum subprocess."),
+		  NULL},
+		 &autovacuum_start_daemon,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"trace_notify", PGC_USERSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Generates debugging output for LISTEN and NOTIFY."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &Trace_notify,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
 
-	{
-		{"jit", PGC_USERSET, QUERY_TUNING_OTHER,
-			gettext_noop("Allow JIT compilation."),
-			NULL,
-			GUC_EXPLAIN
-		},
-		&jit_enabled,
-		true,
-		NULL, NULL, NULL
-	},
+#ifdef LOCK_DEBUG
+		{{"trace_locks", PGC_SUSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Emits information about lock usage."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &Trace_locks,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"trace_userlocks", PGC_SUSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Emits information about user lock usage."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &Trace_userlocks,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"trace_lwlocks", PGC_SUSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Emits information about lightweight lock usage."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &Trace_lwlocks,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"debug_deadlocks", PGC_SUSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Dumps information about all current locks when a deadlock timeout occurs."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &Debug_deadlocks,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+#endif
 
-	{
-		{"jit_debugging_support", PGC_SU_BACKEND, DEVELOPER_OPTIONS,
-			gettext_noop("Register JIT-compiled functions with debugger."),
-			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&jit_debugging_support,
-		false,
+		{{"log_lock_waits", PGC_SUSET, LOGGING_WHAT,
+		  gettext_noop("Logs long lock waits."),
+		  NULL},
+		 &log_lock_waits,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"log_lock_failures", PGC_SUSET, LOGGING_WHAT,
+		  gettext_noop("Logs lock failures."),
+		  NULL},
+		 &log_lock_failures,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"log_recovery_conflict_waits", PGC_SIGHUP, LOGGING_WHAT,
+		  gettext_noop("Logs standby recovery conflict waits."),
+		  NULL},
+		 &log_recovery_conflict_waits,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"log_hostname", PGC_SIGHUP, LOGGING_WHAT,
+		  gettext_noop("Logs the host name in the connection logs."),
+		  gettext_noop("By default, connection logs only show the IP address "
+					   "of the connecting host. If you want them to show the host name you "
+					   "can turn this on, but depending on your host name resolution "
+					   "setup it might impose a non-negligible performance penalty.")},
+		 &log_hostname,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"transform_null_equals", PGC_USERSET, COMPAT_OPTIONS_OTHER,
+		  gettext_noop("Treats \"expr=NULL\" as \"expr IS NULL\"."),
+		  gettext_noop("When turned on, expressions of the form expr = NULL "
+					   "(or NULL = expr) are treated as expr IS NULL, that is, they "
+					   "return true if expr evaluates to the null value, and false "
+					   "otherwise. The correct behavior of expr = NULL is to always "
+					   "return null (unknown).")},
+		 &Transform_null_equals,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"default_transaction_read_only", PGC_USERSET, CLIENT_CONN_STATEMENT,
+		  gettext_noop("Sets the default read-only status of new transactions."),
+		  NULL,
+		  GUC_REPORT},
+		 &DefaultXactReadOnly,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"transaction_read_only", PGC_USERSET, CLIENT_CONN_STATEMENT,
+		  gettext_noop("Sets the current transaction's read-only status."),
+		  NULL,
+		  GUC_NO_RESET | GUC_NO_RESET_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE},
+		 &XactReadOnly,
+		 false,
+		 check_transaction_read_only,
+		 NULL,
+		 NULL},
+		{{"default_transaction_deferrable", PGC_USERSET, CLIENT_CONN_STATEMENT,
+		  gettext_noop("Sets the default deferrable status of new transactions."),
+		  NULL},
+		 &DefaultXactDeferrable,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"transaction_deferrable", PGC_USERSET, CLIENT_CONN_STATEMENT,
+		  gettext_noop("Whether to defer a read-only serializable transaction until it can be executed with no possible serialization failures."),
+		  NULL,
+		  GUC_NO_RESET | GUC_NO_RESET_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE},
+		 &XactDeferrable,
+		 false,
+		 check_transaction_deferrable,
+		 NULL,
+		 NULL},
+		{{"row_security", PGC_USERSET, CLIENT_CONN_STATEMENT,
+		  gettext_noop("Enables row security."),
+		  gettext_noop("When enabled, row security will be applied to all users.")},
+		 &row_security,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"check_function_bodies", PGC_USERSET, CLIENT_CONN_STATEMENT,
+		  gettext_noop("Check routine bodies during CREATE FUNCTION and CREATE PROCEDURE."),
+		  NULL},
+		 &check_function_bodies,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"array_nulls", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
+		  gettext_noop("Enables input of NULL elements in arrays."),
+		  gettext_noop("When turned on, unquoted NULL in an array input "
+					   "value means a null value; "
+					   "otherwise it is taken literally.")},
+		 &Array_nulls,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
 
 		/*
-		 * This is not guaranteed to be available, but given it's a developer
-		 * oriented option, it doesn't seem worth adding code checking
-		 * availability.
+		 * WITH OIDS support, and consequently default_with_oids, was removed in
+		 * PostgreSQL 12, but we tolerate the parameter being set to false to
+		 * avoid unnecessarily breaking older dump files.
 		 */
-		NULL, NULL, NULL
-	},
+		{
+			{"default_with_oids", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
+			 gettext_noop("WITH OIDS is no longer supported; this can only be false."),
+			 NULL,
+			 GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE},
+			&default_with_oids,
+			false,
+			check_default_with_oids,
+			NULL,
+			NULL},
+		{{"logging_collector", PGC_POSTMASTER, LOGGING_WHERE,
+		  gettext_noop("Start a subprocess to capture stderr, csvlog and/or jsonlog into log files."),
+		  NULL},
+		 &Logging_collector,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+		{{"log_truncate_on_rotation", PGC_SIGHUP, LOGGING_WHERE,
+		  gettext_noop("Truncate existing log files of same name during log rotation."),
+		  NULL},
+		 &Log_truncate_on_rotation,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"trace_sort", PGC_USERSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Emit information about resource usage in sorting."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &trace_sort,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
 
-	{
-		{"jit_dump_bitcode", PGC_SUSET, DEVELOPER_OPTIONS,
-			gettext_noop("Write out LLVM bitcode to facilitate JIT debugging."),
+#ifdef TRACE_SYNCSCAN
+		/* this is undocumented because not exposed in a standard build */
+		{
+			{"trace_syncscan", PGC_USERSET, DEVELOPER_OPTIONS,
+			 gettext_noop("Generate debugging output for synchronized scanning."),
+			 NULL,
+			 GUC_NOT_IN_SAMPLE},
+			&trace_syncscan,
+			false,
 			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&jit_dump_bitcode,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"jit_expressions", PGC_USERSET, DEVELOPER_OPTIONS,
-			gettext_noop("Allow JIT compilation of expressions."),
 			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&jit_expressions,
-		true,
-		NULL, NULL, NULL
-	},
+			NULL},
+#endif
 
-	{
-		{"jit_profiling_support", PGC_SU_BACKEND, DEVELOPER_OPTIONS,
-			gettext_noop("Register JIT-compiled functions with perf profiler."),
+#ifdef DEBUG_BOUNDED_SORT
+		/* this is undocumented because not exposed in a standard build */
+		{
+			{"optimize_bounded_sort", PGC_USERSET, QUERY_TUNING_METHOD,
+			 gettext_noop("Enables bounded sorting using heap sort."),
+			 NULL,
+			 GUC_NOT_IN_SAMPLE | GUC_EXPLAIN},
+			&optimize_bounded_sort,
+			true,
 			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&jit_profiling_support,
-		false,
-
-		/*
-		 * This is not guaranteed to be available, but given it's a developer
-		 * oriented option, it doesn't seem worth adding code checking
-		 * availability.
-		 */
-		NULL, NULL, NULL
-	},
-
-	{
-		{"jit_tuple_deforming", PGC_USERSET, DEVELOPER_OPTIONS,
-			gettext_noop("Allow JIT compilation of tuple deforming."),
 			NULL,
-			GUC_NOT_IN_SAMPLE
-		},
-		&jit_tuple_deforming,
-		true,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"data_sync_retry", PGC_POSTMASTER, ERROR_HANDLING_OPTIONS,
-			gettext_noop("Whether to continue running after a failure to sync data files."),
-		},
-		&data_sync_retry,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"wal_receiver_create_temp_slot", PGC_SIGHUP, REPLICATION_STANDBY,
-			gettext_noop("Sets whether a WAL receiver should create a temporary replication slot if no permanent slot is configured."),
-		},
-		&wal_receiver_create_temp_slot,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"event_triggers", PGC_SUSET, CLIENT_CONN_STATEMENT,
-			gettext_noop("Enables event triggers."),
-			gettext_noop("When enabled, event triggers will fire for all applicable statements."),
-		},
-		&event_triggers,
-		true,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"sync_replication_slots", PGC_SIGHUP, REPLICATION_STANDBY,
-			gettext_noop("Enables a physical standby to synchronize logical failover replication slots from the primary server."),
-		},
-		&sync_replication_slots,
-		false,
-		NULL, NULL, NULL
-	},
-
-	{
-		{"md5_password_warnings", PGC_USERSET, CONN_AUTH_AUTH,
-			gettext_noop("Enables deprecation warnings for MD5 passwords."),
-		},
-		&md5_password_warnings,
-		true,
-		NULL, NULL, NULL
-	},
+			NULL},
+#endif
 
-	{
-		{"vacuum_truncate", PGC_USERSET, VACUUM_DEFAULT,
-			gettext_noop("Enables vacuum to truncate empty pages at the end of the table."),
-		},
-		&vacuum_truncate,
-		true,
-		NULL, NULL, NULL
-	},
+#ifdef WAL_DEBUG
+		{{"wal_debug", PGC_SUSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Emit WAL-related debugging output."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &XLOG_DEBUG,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+#endif
 
-	/* End-of-list marker */
-	{
-		{NULL, 0, 0, NULL, NULL}, NULL, false, NULL, NULL, NULL
-	}
-};
+		{{"integer_datetimes", PGC_INTERNAL, PRESET_OPTIONS,
+		  gettext_noop("Shows whether datetimes are integer based."),
+		  NULL,
+		  GUC_REPORT | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE},
+		 &integer_datetimes,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"krb_caseins_users", PGC_SIGHUP, CONN_AUTH_AUTH,
+		  gettext_noop("Sets whether Kerberos and GSSAPI user names should be treated as case-insensitive."),
+		  NULL},
+		 &pg_krb_caseins_users,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"gss_accept_delegation", PGC_SIGHUP, CONN_AUTH_AUTH,
+		  gettext_noop("Sets whether GSSAPI delegation should be accepted from the client."),
+		  NULL},
+		 &pg_gss_accept_delegation,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"escape_string_warning", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
+		  gettext_noop("Warn about backslash escapes in ordinary string literals."),
+		  NULL},
+		 &escape_string_warning,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"standard_conforming_strings", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
+		  gettext_noop("Causes '...' strings to treat backslashes literally."),
+		  NULL,
+		  GUC_REPORT},
+		 &standard_conforming_strings,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"synchronize_seqscans", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
+		  gettext_noop("Enables synchronized sequential scans."),
+		  NULL},
+		 &synchronize_seqscans,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"recovery_target_inclusive", PGC_POSTMASTER, WAL_RECOVERY_TARGET,
+		  gettext_noop("Sets whether to include or exclude transaction with recovery target."),
+		  NULL},
+		 &recoveryTargetInclusive,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"summarize_wal", PGC_SIGHUP, WAL_SUMMARIZATION,
+		  gettext_noop("Starts the WAL summarizer process to enable incremental backup."),
+		  NULL},
+		 &summarize_wal,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"hot_standby", PGC_POSTMASTER, REPLICATION_STANDBY,
+		  gettext_noop("Allows connections and queries during recovery."),
+		  NULL},
+		 &EnableHotStandby,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"hot_standby_feedback", PGC_SIGHUP, REPLICATION_STANDBY,
+		  gettext_noop("Allows feedback from a hot standby to the primary that will avoid query conflicts."),
+		  NULL},
+		 &hot_standby_feedback,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"in_hot_standby", PGC_INTERNAL, PRESET_OPTIONS,
+		  gettext_noop("Shows whether hot standby is currently active."),
+		  NULL,
+		  GUC_REPORT | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE},
+		 &in_hot_standby_guc,
+		 false,
+		 NULL,
+		 NULL,
+		 show_in_hot_standby},
+
+		{{"allow_system_table_mods", PGC_SUSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Allows modifications of the structure of system tables."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &allowSystemTableMods,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"ignore_system_indexes", PGC_BACKEND, DEVELOPER_OPTIONS,
+		  gettext_noop("Disables reading from system indexes."),
+		  gettext_noop("It does not prevent updating the indexes, so it is safe "
+					   "to use.  The worst consequence is slowness."),
+		  GUC_NOT_IN_SAMPLE},
+		 &IgnoreSystemIndexes,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"allow_in_place_tablespaces", PGC_SUSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Allows tablespaces directly inside pg_tblspc, for testing."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &allow_in_place_tablespaces,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"lo_compat_privileges", PGC_SUSET, COMPAT_OPTIONS_PREVIOUS,
+		  gettext_noop("Enables backward compatibility mode for privilege checks on large objects."),
+		  gettext_noop("Skips privilege checks when reading or modifying large objects, "
+					   "for compatibility with PostgreSQL releases prior to 9.0.")},
+		 &lo_compat_privileges,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{
+			 "quote_all_identifiers",
+			 PGC_USERSET,
+			 COMPAT_OPTIONS_PREVIOUS,
+			 gettext_noop("When generating SQL fragments, quote all identifiers."),
+			 NULL,
+		 },
+		 &quote_all_identifiers,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"data_checksums", PGC_INTERNAL, PRESET_OPTIONS,
+		  gettext_noop("Shows whether data checksums are turned on for this cluster."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE | GUC_RUNTIME_COMPUTED},
+		 &data_checksums,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"syslog_sequence_numbers", PGC_SIGHUP, LOGGING_WHERE,
+		  gettext_noop("Add sequence number to syslog messages to avoid duplicate suppression."),
+		  NULL},
+		 &syslog_sequence_numbers,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"syslog_split_messages", PGC_SIGHUP, LOGGING_WHERE,
+		  gettext_noop("Split messages sent to syslog by lines and to fit into 1024 bytes."),
+		  NULL},
+		 &syslog_split_messages,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"parallel_leader_participation", PGC_USERSET, RESOURCES_WORKER_PROCESSES,
+		  gettext_noop("Controls whether Gather and Gather Merge also run subplans."),
+		  gettext_noop("Should gather nodes also run subplans or just gather tuples?"),
+		  GUC_EXPLAIN},
+		 &parallel_leader_participation,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"jit", PGC_USERSET, QUERY_TUNING_OTHER,
+		  gettext_noop("Allow JIT compilation."),
+		  NULL,
+		  GUC_EXPLAIN},
+		 &jit_enabled,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"jit_debugging_support", PGC_SU_BACKEND, DEVELOPER_OPTIONS,
+		  gettext_noop("Register JIT-compiled functions with debugger."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &jit_debugging_support,
+		 false,
+
+		 /*
+		  * This is not guaranteed to be available, but given it's a developer
+		  * oriented option, it doesn't seem worth adding code checking
+		  * availability.
+		  */
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"jit_dump_bitcode", PGC_SUSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Write out LLVM bitcode to facilitate JIT debugging."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &jit_dump_bitcode,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"jit_expressions", PGC_USERSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Allow JIT compilation of expressions."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &jit_expressions,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"jit_profiling_support", PGC_SU_BACKEND, DEVELOPER_OPTIONS,
+		  gettext_noop("Register JIT-compiled functions with perf profiler."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &jit_profiling_support,
+		 false,
+
+		 /*
+		  * This is not guaranteed to be available, but given it's a developer
+		  * oriented option, it doesn't seem worth adding code checking
+		  * availability.
+		  */
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{"jit_tuple_deforming", PGC_USERSET, DEVELOPER_OPTIONS,
+		  gettext_noop("Allow JIT compilation of tuple deforming."),
+		  NULL,
+		  GUC_NOT_IN_SAMPLE},
+		 &jit_tuple_deforming,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{
+			 "data_sync_retry",
+			 PGC_POSTMASTER,
+			 ERROR_HANDLING_OPTIONS,
+			 gettext_noop("Whether to continue running after a failure to sync data files."),
+		 },
+		 &data_sync_retry,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{
+			 "wal_receiver_create_temp_slot",
+			 PGC_SIGHUP,
+			 REPLICATION_STANDBY,
+			 gettext_noop("Sets whether a WAL receiver should create a temporary replication slot if no permanent slot is configured."),
+		 },
+		 &wal_receiver_create_temp_slot,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{
+			 "event_triggers",
+			 PGC_SUSET,
+			 CLIENT_CONN_STATEMENT,
+			 gettext_noop("Enables event triggers."),
+			 gettext_noop("When enabled, event triggers will fire for all applicable statements."),
+		 },
+		 &event_triggers,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{
+			 "sync_replication_slots",
+			 PGC_SIGHUP,
+			 REPLICATION_STANDBY,
+			 gettext_noop("Enables a physical standby to synchronize logical failover replication slots from the primary server."),
+		 },
+		 &sync_replication_slots,
+		 false,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{
+			 "md5_password_warnings",
+			 PGC_USERSET,
+			 CONN_AUTH_AUTH,
+			 gettext_noop("Enables deprecation warnings for MD5 passwords."),
+		 },
+		 &md5_password_warnings,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		{{
+			 "vacuum_truncate",
+			 PGC_USERSET,
+			 VACUUM_DEFAULT,
+			 gettext_noop("Enables vacuum to truncate empty pages at the end of the table."),
+		 },
+		 &vacuum_truncate,
+		 true,
+		 NULL,
+		 NULL,
+		 NULL},
+
+		/* End-of-list marker */
+		{
+			{NULL, 0, 0, NULL, NULL}, NULL, false, NULL, NULL, NULL}};
 
 
 struct config_int ConfigureNamesInt[] =
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index a9d8293474a..26c08693564 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -581,6 +581,7 @@
 
 # - What to Log -
 
+#debug_print_raw_parse = off
 #debug_print_parse = off
 #debug_print_rewritten = off
 #debug_print_plan = off
diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h
index f619100467d..d06ddade7f0 100644
--- a/src/include/utils/guc.h
+++ b/src/include/utils/guc.h
@@ -247,6 +247,7 @@ typedef enum
 /* GUC vars that are actually defined in guc_tables.c, rather than elsewhere */
 extern PGDLLIMPORT bool Debug_print_plan;
 extern PGDLLIMPORT bool Debug_print_parse;
+extern PGDLLIMPORT bool Debug_print_raw_parse;
 extern PGDLLIMPORT bool Debug_print_rewritten;
 extern PGDLLIMPORT bool Debug_pretty_print;
 
-- 
2.39.5 (Apple Git-154)

