diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c
new file mode 100644
index bc01f07..5eedfc7
*** a/contrib/pgbench/pgbench.c
--- b/contrib/pgbench/pgbench.c
*************** double		sample_rate = 0.0;
*** 142,147 ****
--- 142,148 ----
  char	   *tablespace = NULL;
  char	   *index_tablespace = NULL;
  
+ char	   *startup = NULL;
  /*
   * end of configurable parameters
   *********************************************************************/
*************** usage(void)
*** 341,347 ****
  		   "  --unlogged-tables\n"
  		   "               create tables as unlogged tables\n"
  		   "\nBenchmarking options:\n"
! 		"  -c NUM       number of concurrent database clients (default: 1)\n"
  		   "  -C           establish new connection for each transaction\n"
  		   "  -D VARNAME=VALUE\n"
  		   "               define variable for use by custom script\n"
--- 342,348 ----
  		   "  --unlogged-tables\n"
  		   "               create tables as unlogged tables\n"
  		   "\nBenchmarking options:\n"
! 		   "  -c NUM       number of concurrent database clients (default: 1)\n"
  		   "  -C           establish new connection for each transaction\n"
  		   "  -D VARNAME=VALUE\n"
  		   "               define variable for use by custom script\n"
*************** usage(void)
*** 359,367 ****
  		   "  -r           report average latency per command\n"
  		   "  -s NUM       report this scale factor in output\n"
  		   "  -S           perform SELECT-only transactions\n"
! 	 "  -t NUM       number of transactions each client runs (default: 10)\n"
  		   "  -T NUM       duration of benchmark test in seconds\n"
  		   "  -v           vacuum all four standard tables before tests\n"
  		   "\nCommon options:\n"
  		   "  -d             print debugging output\n"
  		   "  -h HOSTNAME    database server host or socket directory\n"
--- 360,370 ----
  		   "  -r           report average latency per command\n"
  		   "  -s NUM       report this scale factor in output\n"
  		   "  -S           perform SELECT-only transactions\n"
! 		   "  -t NUM       number of transactions each client runs (default: 10)\n"
  		   "  -T NUM       duration of benchmark test in seconds\n"
  		   "  -v           vacuum all four standard tables before tests\n"
+  		   "  --startup=COMMAND\n"
+ 		   "               Run COMMAND upon creating each benchmarking connection\n"
  		   "\nCommon options:\n"
  		   "  -d             print debugging output\n"
  		   "  -h HOSTNAME    database server host or socket directory\n"
*************** executeStatement(PGconn *con, const char
*** 467,473 ****
  	res = PQexec(con, sql);
  	if (PQresultStatus(res) != PGRES_COMMAND_OK)
  	{
! 		fprintf(stderr, "%s", PQerrorMessage(con));
  		exit(1);
  	}
  	PQclear(res);
--- 470,476 ----
  	res = PQexec(con, sql);
  	if (PQresultStatus(res) != PGRES_COMMAND_OK)
  	{
! 		fprintf(stderr, "Command failed with %s", PQerrorMessage(con));
  		exit(1);
  	}
  	PQclear(res);
*************** doConnect(void)
*** 540,545 ****
--- 543,560 ----
  	return conn;
  }
  
+ /* set up a connection to the backend intended for benchmarking */
+ static PGconn *
+ doBenchMarkConnect(void)
+ {
+ 	PGconn * conn;
+ 	conn = doConnect();
+ 	if (startup != NULL) {
+ 		executeStatement(conn, startup);
+ 	};
+ 	return conn;
+ };
+ 
  /* throw away response from backend */
  static void
  discard_response(CState *state)
*************** top:
*** 1078,1084 ****
  					end;
  
  		INSTR_TIME_SET_CURRENT(start);
! 		if ((st->con = doConnect()) == NULL)
  		{
  			fprintf(stderr, "Client %d aborted in establishing connection.\n", st->id);
  			return clientDone(st, false);
--- 1093,1099 ----
  					end;
  
  		INSTR_TIME_SET_CURRENT(start);
! 		if ((st->con = doBenchMarkConnect()) == NULL)
  		{
  			fprintf(stderr, "Client %d aborted in establishing connection.\n", st->id);
  			return clientDone(st, false);
*************** main(int argc, char **argv)
*** 2086,2091 ****
--- 2101,2107 ----
  		{"unlogged-tables", no_argument, &unlogged_tables, 1},
  		{"sampling-rate", required_argument, NULL, 4},
  		{"aggregate-interval", required_argument, NULL, 5},
+   		{"startup", required_argument, NULL, 6},
  		{NULL, 0, NULL, 0}
  	};
  
*************** main(int argc, char **argv)
*** 2337,2342 ****
--- 2353,2361 ----
  				}
  #endif
  				break;
+ 			case 6:				/* startup COMMAND */
+ 				startup = pg_strdup(optarg);
+ 				break;
  			default:
  				fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
  				exit(1);
*************** threadRun(void *arg)
*** 2696,2702 ****
  		/* make connections to the database */
  		for (i = 0; i < nstate; i++)
  		{
! 			if ((state[i].con = doConnect()) == NULL)
  				goto done;
  		}
  	}
--- 2715,2721 ----
  		/* make connections to the database */
  		for (i = 0; i < nstate; i++)
  		{
! 			if ((state[i].con = doBenchMarkConnect()) == NULL)
  				goto done;
  		}
  	}
diff --git a/doc/src/sgml/pgbench.sgml b/doc/src/sgml/pgbench.sgml
new file mode 100644
index 79b4baf..a4324f1
*** a/doc/src/sgml/pgbench.sgml
--- b/doc/src/sgml/pgbench.sgml
*************** pgbench <optional> <replaceable>options<
*** 479,484 ****
--- 479,499 ----
        </listitem>
       </varlistentry>
  
+      <varlistentry>
+       <term><option>--startup=<replaceable>COMMAND</replaceable></option></term>
+       <listitem>
+        <para>
+        	Execute the <replaceable>COMMAND</replaceable> upon the establishment
+ 		of each connection intended for receipt of benchmarking queries.
+        </para>
+        <para>
+        	For example <literal>--startup="set synchronous_commit=off"</> will cause benchmarking 
+ 		to be done without fsyncing the WAL for every transaction, regardless of the default 
+ 		server settings.
+        </para>
+       </listitem>
+      </varlistentry>
+ 
      </variablelist>
     </para>
  
