Index: src/test/regress/pg_regress.c
===================================================================
RCS file: /cvsroot/pgsql/src/test/regress/pg_regress.c,v
retrieving revision 1.36
diff -c -r1.36 pg_regress.c
*** src/test/regress/pg_regress.c	18 Jul 2007 21:19:17 -0000	1.36
--- src/test/regress/pg_regress.c	5 Sep 2007 19:06:50 -0000
***************
*** 76,81 ****
--- 76,82 ----
  static _stringlist *schedulelist = NULL;
  static _stringlist *extra_tests = NULL;
  static char *temp_install = NULL;
+ static char *temp_config = NULL;
  static char *top_builddir = NULL;
  static int	temp_port = 65432;
  static bool nolocale = false;
***************
*** 1718,1728 ****
  	printf(_("                            (can be used multiple times to concatenate)\n"));
  	printf(_("  --srcdir=DIR              absolute path to source directory (for VPATH builds)\n"));
  	printf(_("  --temp-install=DIR        create a temporary installation in DIR\n"));
- 	printf(_("  --no-locale               use C locale\n"));
  	printf(_("\n"));
  	printf(_("Options for \"temp-install\" mode:\n"));
  	printf(_("  --top-builddir=DIR        (relative) path to top level build directory\n"));
  	printf(_("  --temp-port=PORT          port number to start temp postmaster on\n"));
  	printf(_("\n"));
  	printf(_("Options for using an existing installation:\n"));
  	printf(_("  --host=HOST               use postmaster running on HOST\n"));
--- 1719,1730 ----
  	printf(_("                            (can be used multiple times to concatenate)\n"));
  	printf(_("  --srcdir=DIR              absolute path to source directory (for VPATH builds)\n"));
  	printf(_("  --temp-install=DIR        create a temporary installation in DIR\n"));
  	printf(_("\n"));
  	printf(_("Options for \"temp-install\" mode:\n"));
+ 	printf(_("  --no-locale               use C locale\n"));
  	printf(_("  --top-builddir=DIR        (relative) path to top level build directory\n"));
  	printf(_("  --temp-port=PORT          port number to start temp postmaster on\n"));
+ 	printf(_("  --temp-config=PATH        append contents of PATH to temporary config\n"));
  	printf(_("\n"));
  	printf(_("Options for using an existing installation:\n"));
  	printf(_("  --host=HOST               use postmaster running on HOST\n"));
***************
*** 1766,1771 ****
--- 1768,1774 ----
  		{"psqldir", required_argument, NULL, 16},
  		{"srcdir", required_argument, NULL, 17},
  		{"create-role", required_argument, NULL, 18},
+ 		{"temp-config", required_argument, NULL, 19},
  		{NULL, 0, NULL, 0}
  	};
  
***************
*** 1874,1879 ****
--- 1877,1885 ----
  			case 18:
  				split_to_stringlist(strdup(optarg), ", ", &extraroles);
  				break;
+ 			case 19:
+ 				temp_config = strdup(optarg);
+ 				break;
  			default:
  				/* getopt_long already emitted a complaint */
  				fprintf(stderr, _("\nTry \"%s -h\" for more information.\n"),
***************
*** 1962,1967 ****
--- 1968,1999 ----
  			exit_nicely(2);
  		}
  
+ 		/* add any extra config specified to the postgresql.conf */
+ 		if (temp_config != NULL)
+ 		{
+ 			FILE * extra_conf;
+ 			FILE * pg_conf;
+ 			char line_buf[1024];
+ 
+ 			snprintf(buf, sizeof(buf),"%s/data/postgresql.conf", temp_install);
+ 			pg_conf = fopen(buf,"a");
+ 			if (pg_conf == NULL)
+ 			{
+ 				fprintf(stderr, _("\n%s: could not open %s for adding extra config:\nError was %s\n"), progname, buf, strerror(errno));
+ 				exit_nicely(2);				
+ 			}
+ 			extra_conf = fopen(temp_config,"r");
+ 			if (extra_conf == NULL)
+ 			{
+ 				fprintf(stderr, _("\n%s: could not open %s to read extra config:\nError was %s\n"), progname, buf, strerror(errno));
+ 				exit_nicely(2);				
+ 			}
+ 			while(fgets(line_buf, sizeof(line_buf),extra_conf) != NULL)
+ 				fputs(line_buf, pg_conf);
+ 			fclose(extra_conf);
+ 			fclose(pg_conf);
+ 		}
+ 
  		/*
  		 * Start the temp postmaster
  		 */
