src/bin/psql/command.c
static backslashResult
exec_command_gset(PsqlScanState scan_state, bool active_branch)
{
	backslashResult status = PSQL_CMD_SKIP_LINE;

	if (active_branch)
	{
		char	   *prefix = psql_scan_slash_option(scan_state,
													OT_NORMAL, NULL, false);

		if (prefix)
			pset.gset_prefix = prefix;
		else
		{
			/* we must set a non-NULL prefix to trigger storing */
			pset.gset_prefix = pg_strdup("");
		}
		/* gset_prefix is freed later */
		status = PSQL_CMD_SEND;
	}
	else
		ignore_slash_options(scan_state);

	return status;
}
/*
 * \gset [prefix] -- send query and store result into variables
 */
\gset [prefix] -- send query and store result into variables
\ gset [ prefix ] -- send query and store result into variables
static backslashResult
exec_command_gset(PsqlScanState scan_state, bool active_branch)
{
	backslashResult status = PSQL_CMD_SKIP_LINE;
	if (active_branch)
	{
		char	   *prefix = psql_scan_slash_option(scan_state,
													OT_NORMAL, NULL, false);
		if (prefix)
			pset.gset_prefix = prefix;
		else
		{
			pset.gset_prefix = pg_strdup("");
		}
		status = PSQL_CMD_SEND;
	}
	else
		ignore_slash_options(scan_state);
	return status;
}
static backslashResult exec_command_gset ( PsqlScanState scan_state , bool active_branch ) { backslashResult status = PSQL_CMD_SKIP_LINE ; if ( active_branch ) { char * prefix = psql_scan_slash_option ( scan_state , OT_NORMAL , NULL , false ) ; if ( prefix ) pset . gset_prefix = prefix ; else { pset . gset_prefix = pg_strdup ( " " ) ; } status = PSQL_CMD_SEND ; } else ignore_slash_options ( scan_state ) ; return status ; }
\gset [prefix] -- send query and store result into variables
\ gset [ prefix ] -- send query and store result into variables
/* we must set a non-NULL prefix to trigger storing */ /* gset_prefix is freed later */