diff --git a/doc/src/sgml/ref/pg_receivexlog.sgml b/doc/src/sgml/ref/pg_receivexlog.sgml
index a4c98921cb8bd3b136d3c596243030f7ba63f0a3..0e6ec1c414467064bc5bf68560a7a882186002ab 100644
--- a/doc/src/sgml/ref/pg_receivexlog.sgml
+++ b/doc/src/sgml/ref/pg_receivexlog.sgml
@@ -273,7 +273,7 @@ PostgreSQL documentation
       <listitem>
        <para>
         Create a new physical replication slot with the name specified in
-        <option>--slot</option>, then start to stream WAL.
+        <option>--slot</option>, then exit.
        </para>
       </listitem>
      </varlistentry>
diff --git a/src/bin/pg_basebackup/pg_receivexlog.c b/src/bin/pg_basebackup/pg_receivexlog.c
index 00536bd0972a5724a98bf8f3871694cee1af6147..ca648d9716aa7968b3f067308e3ce3f15932fa9e 100644
--- a/src/bin/pg_basebackup/pg_receivexlog.c
+++ b/src/bin/pg_basebackup/pg_receivexlog.c
@@ -508,7 +508,7 @@ main(int argc, char **argv)
 	/*
 	 * Required arguments
 	 */
-	if (basedir == NULL && !do_drop_slot)
+	if (basedir == NULL && !do_drop_slot && !do_create_slot)
 	{
 		fprintf(stderr, _("%s: no target directory specified\n"), progname);
 		fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
@@ -519,7 +519,7 @@ main(int argc, char **argv)
 	/*
 	 * Check existence of destination folder.
 	 */
-	if (!do_drop_slot)
+	if (!do_drop_slot && !do_create_slot)
 	{
 		DIR		   *dir = get_destination_dir(basedir);
 
@@ -584,6 +584,7 @@ main(int argc, char **argv)
 		if (!CreateReplicationSlot(conn, replication_slot, NULL, true,
 								   slot_exists_ok))
 			disconnect_and_exit(1);
+		disconnect_and_exit(0);
 	}
 
 	/*