Index: src/bin/initdb/initdb.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/bin/initdb/initdb.c,v
retrieving revision 1.15
diff -c -r1.15 initdb.c
*** src/bin/initdb/initdb.c	29 Nov 2003 19:52:04 -0000	1.15
--- src/bin/initdb/initdb.c	30 Nov 2003 21:52:47 -0000
***************
*** 179,184 ****
--- 179,185 ----
  static int	set_paths(void);
  static char **replace_token(char **, char *, char *);
  static void set_short_version(char *, char *);
+ static void set_warning_file(void);
  static void set_null_conf(void);
  static void test_buffers(void);
  static void test_connections(void);
***************
*** 1064,1069 ****
--- 1065,1088 ----
  }
  
  /*
+  * write out the warning file in the data dir; this is to try to ensure
+  * that users don't delete pg_xlog in the belief that it is "just" a log
+  * file
+  */
+ static void
+ set_warning_file(void)
+ {
+ 	FILE	   *warning_file;
+ 	char	   *path;
+ 
+ 	path = xmalloc(strlen(pg_data) + 20);
+ 	sprintf(path, "%s/README.IMPORTANT", pg_data);
+ 	warning_file = fopen(path, PG_BINARY_W);
+ 	fprintf(warning_file, "pg_xlog and pg_clog are crucial to the preservation of your\ndata. They do not contain standard log files.  Do not even think\nabout deleting them to save space; you would destroy your\ndatabase.\n");
+ 	fclose(warning_file);
+ }
+ 
+ /*
   * set up an empty config file so we can check buffers and connections
   */
  static void
***************
*** 2427,2432 ****
--- 2446,2454 ----
  
  	/* Top level PG_VERSION is checked by bootstrapper, so make it first */
  	set_short_version(short_version, NULL);
+ 
+ 	/* Write the warning file - a warning not to delete pg_xlog! */
+ 	set_warning_file();
  
  	/*
  	 * Determine platform-specific config settings
