* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.202 2004/05/07 00:24:58 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.203 2004/05/07 01:34:08 momjian Exp $
*
*--------------------------------------------------------------------
*/
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);
/*
NULL
},
&log_parser_stats,
- false, NULL, NULL
+ false, assign_stage_log_stats, NULL
},
{
{"log_planner_stats", PGC_USERLIMIT, STATS_MONITORING,
NULL
},
&log_planner_stats,
- false, NULL, NULL
+ false, assign_stage_log_stats, NULL
},
{
{"log_executor_stats", PGC_USERLIMIT, STATS_MONITORING,
NULL
},
&log_executor_stats,
- false, NULL, NULL
+ false, assign_stage_log_stats, NULL
},
{
{"log_statement_stats", PGC_USERLIMIT, STATS_MONITORING,
NULL
},
&log_statement_stats,
- false, NULL, NULL
+ false, assign_log_stats, NULL
},
#ifdef BTREE_BUILD_STATS
{
}
+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;
+}
+
+
#include "guc-file.c"