Index: src/backend/utils/misc/guc.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/utils/misc/guc.c,v
retrieving revision 1.202
diff -c -c -r1.202 guc.c
*** src/backend/utils/misc/guc.c	7 May 2004 00:24:58 -0000	1.202
--- src/backend/utils/misc/guc.c	7 May 2004 01:32:35 -0000
***************
*** 103,108 ****
--- 103,110 ----
  static const char *assign_log_stmtlvl(int *var, const char *newval,
  						   bool doit, GucSource source);
  static bool assign_phony_autocommit(bool newval, bool doit, GucSource source);
+ static bool assign_stage_log_stats(bool newval, bool doit, GucSource source);
+ static bool assign_log_stats(bool newval, bool doit, GucSource source);
  
  
  /*
***************
*** 577,583 ****
  			NULL
  		},
  		&log_parser_stats,
! 		false, NULL, NULL
  	},
  	{
  		{"log_planner_stats", PGC_USERLIMIT, STATS_MONITORING,
--- 579,585 ----
  			NULL
  		},
  		&log_parser_stats,
! 		false, assign_stage_log_stats, NULL
  	},
  	{
  		{"log_planner_stats", PGC_USERLIMIT, STATS_MONITORING,
***************
*** 585,591 ****
  			NULL
  		},
  		&log_planner_stats,
! 		false, NULL, NULL
  	},
  	{
  		{"log_executor_stats", PGC_USERLIMIT, STATS_MONITORING,
--- 587,593 ----
  			NULL
  		},
  		&log_planner_stats,
! 		false, assign_stage_log_stats, NULL
  	},
  	{
  		{"log_executor_stats", PGC_USERLIMIT, STATS_MONITORING,
***************
*** 593,599 ****
  			NULL
  		},
  		&log_executor_stats,
! 		false, NULL, NULL
  	},
  	{
  		{"log_statement_stats", PGC_USERLIMIT, STATS_MONITORING,
--- 595,601 ----
  			NULL
  		},
  		&log_executor_stats,
! 		false, assign_stage_log_stats, NULL
  	},
  	{
  		{"log_statement_stats", PGC_USERLIMIT, STATS_MONITORING,
***************
*** 601,607 ****
  			NULL
  		},
  		&log_statement_stats,
! 		false, NULL, NULL
  	},
  #ifdef BTREE_BUILD_STATS
  	{
--- 603,609 ----
  			NULL
  		},
  		&log_statement_stats,
! 		false, assign_log_stats, NULL
  	},
  #ifdef BTREE_BUILD_STATS
  	{
***************
*** 4704,4709 ****
--- 4706,4752 ----
  					(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
  				errmsg("SET AUTOCOMMIT TO OFF is no longer supported")));
  		return false;
+ 	}
+ 	return true;
+ }
+ 
+ 
+ static bool
+ assign_stage_log_stats(bool newval, bool doit, GucSource source)
+ {
+ 	if (newval)
+ 	{
+ 		if (log_statement_stats)
+ 		{
+ 			if (doit)
+ 				ereport(ERROR,
+ 						(errcode(ERRCODE_ERROR_IN_ASSIGNMENT),
+ 					errmsg("Can not enable parameter when \"log_statement_stats\" is true.")));
+ 			else
+ 				return false;
+ 		}
+ 		return true;
+ 	}
+ 	return true;
+ }
+ 
+ 
+ static bool
+ assign_log_stats(bool newval, bool doit, GucSource source)
+ {
+ 	if (newval)
+ 	{
+ 		if (log_parser_stats || log_planner_stats || log_executor_stats)
+ 		{
+ 			if (doit)
+ 				ereport(ERROR,
+ 						(errcode(ERRCODE_ERROR_IN_ASSIGNMENT),
+ 					errmsg("Can not enable \"log_statement_stats\" when \"log_parser_stats\",\n"
+ 							"\"log_planner_stats\", or \"log_executor_stats\" is true.")));
+ 			else
+ 				return false;
+ 		}
+ 		return true;
  	}
  	return true;
  }
