diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml
index 4ceddae..c5399ff 100644
--- a/doc/src/sgml/ref/pgbench.sgml
+++ b/doc/src/sgml/ref/pgbench.sgml
@@ -838,60 +838,6 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
    <varlistentry>
     <term>
-     <literal>\setrandom <replaceable>varname</> <replaceable>min</> <replaceable>max</> [ uniform | { gaussian | exponential } <replaceable>parameter</> ]</literal>
-     </term>
-
-    <listitem>
-     <para>
-      Sets variable <replaceable>varname</> to a random integer value
-      between the limits <replaceable>min</> and <replaceable>max</> inclusive.
-      Each limit can be either an integer constant or a
-      <literal>:</><replaceable>variablename</> reference to a variable
-      having an integer value.
-     </para>
-
-     <para>
-      <itemizedlist>
-       <listitem>
-        <para>
-         <literal>\setrandom n 1 10</> or <literal>\setrandom n 1 10 uniform</>
-         is equivalent to <literal>\set n random(1, 10)</> and uses a uniform
-         distribution.
-        </para>
-       </listitem>
-
-      <listitem>
-       <para>
-        <literal>\setrandom n 1 10 exponential 3.0</> is equivalent to
-        <literal>\set n random_exponential(1, 10, 3.0)</> and uses an
-        exponential distribution.
-       </para>
-      </listitem>
-
-      <listitem>
-       <para>
-        <literal>\setrandom n 1 10 gaussian 2.0</> is equivalent to
-        <literal>\set n random_gaussian(1, 10, 2.0)</>, and uses a gaussian
-        distribution.
-       </para>
-      </listitem>
-     </itemizedlist>
-
-       See the documentation of these functions below for further information
-       about the precise shape of these distributions, depending on the value
-       of the parameter.
-     </para>
-
-     <para>
-      Example:
-<programlisting>
-\setrandom aid 1 :naccounts gaussian 5.0
-</programlisting></para>
-    </listitem>
-   </varlistentry>
-
-   <varlistentry>
-    <term>
      <literal>\sleep <replaceable>number</> [ us | ms | s ]</literal>
     </term>
 
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index 93c72e0..831574c 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -373,12 +373,14 @@ static void addScript(ParsedScript script);
 static void *threadRun(void *arg);
 static void setalarm(int seconds);
 
+
 /* callback functions for our flex lexer */
 static const PsqlScanCallbacks pgbench_callbacks = {
 	NULL,						/* don't need get_variable functionality */
 	pgbench_error
 };
 
+
 static void
 usage(void)
 {
@@ -1939,148 +1941,7 @@ top:
 			fprintf(stderr, "\n");
 		}
 
-		/*
-		 * Note: this section could be removed, as the same functionnality
-		 * is available through \set xxx random_gaussian(...)
-		 */
-		if (pg_strcasecmp(argv[0], "setrandom") == 0)
-		{
-			char	   *var;
-			int64		min,
-						max;
-			double		parameter = 0;
-			char		res[64];
-
-			if (*argv[2] == ':')
-			{
-				if ((var = getVariable(st, argv[2] + 1)) == NULL)
-				{
-					fprintf(stderr, "%s: undefined variable \"%s\"\n",
-							argv[0], argv[2]);
-					st->ecnt++;
-					return true;
-				}
-				min = strtoint64(var);
-			}
-			else
-				min = strtoint64(argv[2]);
-
-			if (*argv[3] == ':')
-			{
-				if ((var = getVariable(st, argv[3] + 1)) == NULL)
-				{
-					fprintf(stderr, "%s: undefined variable \"%s\"\n",
-							argv[0], argv[3]);
-					st->ecnt++;
-					return true;
-				}
-				max = strtoint64(var);
-			}
-			else
-				max = strtoint64(argv[3]);
-
-			if (max < min)
-			{
-				fprintf(stderr, "%s: \\setrandom maximum is less than minimum\n",
-						argv[0]);
-				st->ecnt++;
-				return true;
-			}
-
-			/*
-			 * Generate random number functions need to be able to subtract
-			 * max from min and add one to the result without overflowing.
-			 * Since we know max > min, we can detect overflow just by
-			 * checking for a negative result. But we must check both that the
-			 * subtraction doesn't overflow, and that adding one to the result
-			 * doesn't overflow either.
-			 */
-			if (max - min < 0 || (max - min) + 1 < 0)
-			{
-				fprintf(stderr, "%s: \\setrandom range is too large\n",
-						argv[0]);
-				st->ecnt++;
-				return true;
-			}
-
-			if (argc == 4 ||	/* uniform without or with "uniform" keyword */
-				(argc == 5 && pg_strcasecmp(argv[4], "uniform") == 0))
-			{
-#ifdef DEBUG
-				printf("min: " INT64_FORMAT " max: " INT64_FORMAT " random: " INT64_FORMAT "\n", min, max, getrand(thread, min, max));
-#endif
-				snprintf(res, sizeof(res), INT64_FORMAT, getrand(thread, min, max));
-			}
-			else if (argc == 6 &&
-					 ((pg_strcasecmp(argv[4], "gaussian") == 0) ||
-					  (pg_strcasecmp(argv[4], "exponential") == 0)))
-			{
-				if (*argv[5] == ':')
-				{
-					if ((var = getVariable(st, argv[5] + 1)) == NULL)
-					{
-						fprintf(stderr, "%s: invalid parameter: \"%s\"\n",
-								argv[0], argv[5]);
-						st->ecnt++;
-						return true;
-					}
-					parameter = strtod(var, NULL);
-				}
-				else
-					parameter = strtod(argv[5], NULL);
-
-				if (pg_strcasecmp(argv[4], "gaussian") == 0)
-				{
-					if (parameter < MIN_GAUSSIAN_PARAM)
-					{
-						fprintf(stderr, "gaussian parameter must be at least %f (not \"%s\")\n", MIN_GAUSSIAN_PARAM, argv[5]);
-						st->ecnt++;
-						return true;
-					}
-#ifdef DEBUG
-					printf("min: " INT64_FORMAT " max: " INT64_FORMAT " random: " INT64_FORMAT "\n",
-						   min, max,
-						   getGaussianRand(thread, min, max, parameter));
-#endif
-					snprintf(res, sizeof(res), INT64_FORMAT,
-							 getGaussianRand(thread, min, max, parameter));
-				}
-				else if (pg_strcasecmp(argv[4], "exponential") == 0)
-				{
-					if (parameter <= 0.0)
-					{
-						fprintf(stderr,
-								"exponential parameter must be greater than zero (not \"%s\")\n",
-								argv[5]);
-						st->ecnt++;
-						return true;
-					}
-#ifdef DEBUG
-					printf("min: " INT64_FORMAT " max: " INT64_FORMAT " random: " INT64_FORMAT "\n",
-						   min, max,
-						   getExponentialRand(thread, min, max, parameter));
-#endif
-					snprintf(res, sizeof(res), INT64_FORMAT,
-							 getExponentialRand(thread, min, max, parameter));
-				}
-			}
-			else	/* this means an error somewhere in the parsing phase... */
-			{
-				fprintf(stderr, "%s: invalid arguments for \\setrandom\n",
-						argv[0]);
-				st->ecnt++;
-				return true;
-			}
-
-			if (!putVariable(st, argv[0], argv[1], res))
-			{
-				st->ecnt++;
-				return true;
-			}
-
-			st->listen = true;
-		}
-		else if (pg_strcasecmp(argv[0], "set") == 0)
+		if (pg_strcasecmp(argv[0], "set") == 0)
 		{
 			char		res[64];
 			PgBenchExpr *expr = commands[st->state]->expr;
@@ -2880,39 +2741,9 @@ process_backslash_command(PsqlScanState sstate, const char *source)
 
 	if (pg_strcasecmp(my_command->argv[0], "setrandom") == 0)
 	{
-		/*--------
-		 * parsing:
-		 *	 \setrandom variable min max [uniform]
-		 *	 \setrandom variable min max (gaussian|exponential) parameter
-		 */
-
-		if (my_command->argc < 4)
-			syntax_error(source, lineno, my_command->line, my_command->argv[0],
-						 "missing arguments", NULL, -1);
-
-		if (my_command->argc == 4 ||	/* uniform without/with "uniform"
-										 * keyword */
-			(my_command->argc == 5 &&
-			 pg_strcasecmp(my_command->argv[4], "uniform") == 0))
-		{
-			/* nothing to do */
-		}
-		else if (				/* argc >= 5 */
-				 (pg_strcasecmp(my_command->argv[4], "gaussian") == 0) ||
-				 (pg_strcasecmp(my_command->argv[4], "exponential") == 0))
-		{
-			if (my_command->argc < 6)
-				syntax_error(source, lineno, my_command->line, my_command->argv[0],
-							 "missing parameter", NULL, -1);
-			else if (my_command->argc > 6)
-				syntax_error(source, lineno, my_command->line, my_command->argv[0],
-							 "too many arguments", NULL,
-							 offsets[6] - start_offset);
-		}
-		else	/* unrecognized distribution argument */
-			syntax_error(source, lineno, my_command->line, my_command->argv[0],
-						 "unexpected argument", my_command->argv[4],
-						 offsets[4] - start_offset);
+		syntax_error(source, lineno, my_command->line, my_command->argv[0],
+					 "\\setrandom is not supported anymore, "
+					 "use \\set with the random() function\n", NULL, -1);
 	}
 	else if (pg_strcasecmp(my_command->argv[0], "sleep") == 0)
 	{
