diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2000-05-31 00:28:42 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2000-05-31 00:28:42 +0000 |
commit | 6a68f42648f54690ad5b5ae6fb9104e86e15f0f1 (patch) | |
tree | 4b6742f51fb2160dbe2ce090273fd430dc2b2499 /src/include | |
parent | 5e4d554bae6a7177903cdb99bf5d41b695519a45 (diff) | |
download | postgresql-6a68f42648f54690ad5b5ae6fb9104e86e15f0f1.tar.gz postgresql-6a68f42648f54690ad5b5ae6fb9104e86e15f0f1.zip |
The heralded `Grand Unified Configuration scheme' (GUC)
That means you can now set your options in either or all of $PGDATA/configuration,
some postmaster option (--enable-fsync=off), or set a SET command. The list of
options is in backend/utils/misc/guc.c, documentation will be written post haste.
pg_options is gone, so is that pq_geqo config file. Also removed were backend -K,
-Q, and -T options (no longer applicable, although -d0 does the same as -Q).
Added to configure an --enable-syslog option.
changed all callers from TPRINTF to elog(DEBUG)
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/commands/async.h | 4 | ||||
-rw-r--r-- | src/include/commands/variable.h | 10 | ||||
-rw-r--r-- | src/include/config.h.in | 34 | ||||
-rw-r--r-- | src/include/miscadmin.h | 13 | ||||
-rw-r--r-- | src/include/optimizer/cost.h | 10 | ||||
-rw-r--r-- | src/include/optimizer/geqo.h | 33 | ||||
-rw-r--r-- | src/include/optimizer/paths.h | 4 | ||||
-rw-r--r-- | src/include/optimizer/planmain.h | 3 | ||||
-rw-r--r-- | src/include/storage/lock.h | 15 | ||||
-rw-r--r-- | src/include/storage/proc.h | 5 | ||||
-rw-r--r-- | src/include/storage/spin.h | 6 | ||||
-rw-r--r-- | src/include/tcop/tcopprot.h | 6 | ||||
-rw-r--r-- | src/include/utils/elog.h | 6 | ||||
-rw-r--r-- | src/include/utils/guc.h | 47 | ||||
-rw-r--r-- | src/include/utils/trace.h | 91 |
15 files changed, 127 insertions, 160 deletions
diff --git a/src/include/commands/async.h b/src/include/commands/async.h index 433c1fc3574..75fa5b29ecd 100644 --- a/src/include/commands/async.h +++ b/src/include/commands/async.h @@ -6,13 +6,15 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: async.h,v 1.13 2000/01/26 05:58:00 momjian Exp $ + * $Id: async.h,v 1.14 2000/05/31 00:28:37 petere Exp $ * *------------------------------------------------------------------------- */ #ifndef ASYNC_H #define ASYNC_H +extern bool Trace_notify; + /* notify-related SQL statements */ extern void Async_Notify(char *relname); extern void Async_Listen(char *relname, int pid); diff --git a/src/include/commands/variable.h b/src/include/commands/variable.h index c9b39d93cb5..682d84e3ca8 100644 --- a/src/include/commands/variable.h +++ b/src/include/commands/variable.h @@ -2,15 +2,15 @@ * Headers for handling of 'SET var TO', 'SHOW var' and 'RESET var' * statements * - * $Id: variable.h,v 1.9 2000/02/19 22:10:43 tgl Exp $ + * $Id: variable.h,v 1.10 2000/05/31 00:28:37 petere Exp $ * */ #ifndef VARIABLE_H -#define VARIABLE_H 1 +#define VARIABLE_H -extern bool SetPGVariable(const char *name, const char *value); -extern bool GetPGVariable(const char *name); -extern bool ResetPGVariable(const char *name); +extern void SetPGVariable(const char *name, const char *value); +extern void GetPGVariable(const char *name); +extern void ResetPGVariable(const char *name); extern void set_default_datestyle(void); diff --git a/src/include/config.h.in b/src/include/config.h.in index 7a3a61d8d1e..e881485b5a3 100644 --- a/src/include/config.h.in +++ b/src/include/config.h.in @@ -8,12 +8,13 @@ * or in config.h afterwards. Of course, if you edit config.h, then your * changes will be overwritten the next time you run configure. * - * $Id: config.h.in,v 1.113 2000/05/12 13:58:25 scrappy Exp $ + * $Id: config.h.in,v 1.114 2000/05/31 00:28:36 petere Exp $ */ #ifndef CONFIG_H #define CONFIG_H + /* * Default runtime limit on number of backend server processes per postmaster; * this is just the default setting for the postmaster's -N switch. @@ -62,14 +63,6 @@ #define RELSEG_SIZE (0x40000000 / BLCKSZ) /* - * As soon as the backend blocks on a lock, it waits this number of seconds - * before checking for a deadlock. - * We don't check for deadlocks just before sleeping because a deadlock is - * a rare event, and checking is an expensive operation. - */ -#define DEADLOCK_CHECK_TIMER 1 - -/* * Maximum number of columns in an index and maximum number of arguments * to a function. They must be the same value. * @@ -113,16 +106,6 @@ */ #define USER_LOCKS -/* Genetic Query Optimization (GEQO): - * - * The GEQO module in PostgreSQL is intended for the solution of the - * query optimization problem by means of a Genetic Algorithm (GA). - * It allows the handling of large JOIN queries through non-exhaustive - * search. - * For further information see README.GEQO <utesch@aut.tu-freiberg.de>. - */ -#define GEQO - /* * Define this if you want psql to _always_ ask for a username and a password * for password authentication. @@ -163,13 +146,7 @@ */ /* #define ELOG_TIMESTAMPS */ -/* - * USE_SYSLOG: use syslog for elog and error messages printed by tprintf - * and eprintf. This must be activated with the syslog flag in pg_options - * (syslog=0 for stdio, syslog=1 for stdio+syslog, syslog=2 for syslog). - * For information see backend/utils/misc/trace.c (Massimo Dal Zotto). - */ -/* #define USE_SYSLOG */ +#undef ENABLE_SYSLOG /* Debug #defines */ /* #define IPORTAL_DEBUG */ @@ -183,6 +160,7 @@ /* #define NO_BUFFERISVALID */ /* #define NO_SECURITY */ /* #define OLD_REWRITE */ +/* #define LOCK_DEBUG */ /* * MAXPGPATH: standard size of a pathname buffer in Postgres (hence, @@ -225,7 +203,9 @@ * default. This can be overriden by command options, environment variables, * and the postconfig hook. (now set by configure script) */ -#undef DEF_PGPORT +#undef DEF_PGPORT +/* ... and once more as a string constant instead */ +#undef DEF_PGPORT_STR /* Define const as empty if your compiler doesn't grok const. */ #undef const diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index 62f34da5d3a..95a05164aa3 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -12,7 +12,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: miscadmin.h,v 1.56 2000/05/29 19:16:55 tgl Exp $ + * $Id: miscadmin.h,v 1.57 2000/05/31 00:28:36 petere Exp $ * * NOTES * some of the information in this file will be moved to @@ -27,7 +27,6 @@ #include "postgres.h" -#include "utils/trace.h" /***************************************************************************** * globals.h -- * @@ -102,12 +101,20 @@ extern char CTZName[]; extern char FloatFormat[]; extern char DateFormat[]; -#define disableFsync pg_options[OPT_NOFSYNC] +extern bool enableFsync; extern bool allowSystemTableMods; extern int SortMem; extern Oid LastOidProcessed; /* for query rewrite */ +/* a few postmaster startup options are exported here so the + configuration file processor has access to them */ + +extern bool NetServer; +extern int MaxBackends; +extern int NBuffers; +extern int PostPortName; + /***************************************************************************** * pdir.h -- * * POSTGRES directory path definitions. * diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h index dabfb681756..783dd96e482 100644 --- a/src/include/optimizer/cost.h +++ b/src/include/optimizer/cost.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: cost.h,v 1.32 2000/04/12 17:16:42 momjian Exp $ + * $Id: cost.h,v 1.33 2000/05/31 00:28:38 petere Exp $ * *------------------------------------------------------------------------- */ @@ -38,10 +38,10 @@ /* parameter variables and flags */ extern double effective_cache_size; -extern Cost random_page_cost; -extern Cost cpu_tuple_cost; -extern Cost cpu_index_tuple_cost; -extern Cost cpu_operator_cost; +extern double random_page_cost; +extern double cpu_tuple_cost; +extern double cpu_index_tuple_cost; +extern double cpu_operator_cost; extern Cost disable_cost; extern bool enable_seqscan; extern bool enable_indexscan; diff --git a/src/include/optimizer/geqo.h b/src/include/optimizer/geqo.h index c7f56e8e7d7..bf65771529b 100644 --- a/src/include/optimizer/geqo.h +++ b/src/include/optimizer/geqo.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: geqo.h,v 1.18 2000/01/26 05:58:20 momjian Exp $ + * $Id: geqo.h,v 1.19 2000/05/31 00:28:38 petere Exp $ * *------------------------------------------------------------------------- */ @@ -41,32 +41,29 @@ */ #define ERX -/* genetic algorithm parameters */ -#define GEQO_FILE "pg_geqo" /* Name of the ga config file */ +/* + * Configuration options + */ +extern int Geqo_pool_size; +#define DEFAULT_GEQO_POOL_SIZE 0 /* = default based on no. of relations. */ +#define MIN_GEQO_POOL_SIZE 128 +#define MAX_GEQO_POOL_SIZE 1024 -#define MIN_POOL 128 /* minimum number of individuals */ -#define MAX_POOL 1024 /* maximum number of individuals */ +extern int Geqo_effort; /* 1 .. inf, only used to calculate generations default */ +extern int Geqo_generations; /* 1 .. inf, or 0 to use default based on pool size */ -#define LOW_EFFORT 1 /* optimization effort values */ -#define MEDIUM_EFFORT 40 /* are multipliers for computed */ -#define HIGH_EFFORT 80 /* number of generations */ +extern double Geqo_selection_bias; +#define DEFAULT_GEQO_SELECTION_BIAS 2.0 +#define MIN_GEQO_SELECTION_BIAS 1.5 +#define MAX_GEQO_SELECTION_BIAS 2.0 -#define SELECTION_BIAS 2.0 /* selective pressure within population */ - /* should be 1.5 <= SELECTION_BIAS <= 2.0 */ +extern int Geqo_random_seed; /* or negative to use current time */ -/* parameter values set in geqo_params.c */ -extern int PoolSize; -extern int Generations; -extern long RandomSeed; -extern double SelectionBias; /* routines in geqo_main.c */ extern RelOptInfo *geqo(Query *root); -/* routines in geqo_params.c */ -extern void geqo_params(int string_length); - /* routines in geqo_eval.c */ extern void geqo_eval_startup(void); extern Cost geqo_eval(Query *root, Gene *tour, int num_gene); diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h index 0a2f56db63a..ff265234186 100644 --- a/src/include/optimizer/paths.h +++ b/src/include/optimizer/paths.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: paths.h,v 1.44 2000/04/12 17:16:42 momjian Exp $ + * $Id: paths.h,v 1.45 2000/05/31 00:28:38 petere Exp $ * *------------------------------------------------------------------------- */ @@ -18,7 +18,7 @@ #include "nodes/relation.h" /* default GEQO threshold (default value for geqo_rels) */ -#define GEQO_RELS 11 +#define DEFAULT_GEQO_RELS 11 /* diff --git a/src/include/optimizer/planmain.h b/src/include/optimizer/planmain.h index e0a0d84bc8a..9a14d2ea590 100644 --- a/src/include/optimizer/planmain.h +++ b/src/include/optimizer/planmain.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: planmain.h,v 1.39 2000/04/12 17:16:42 momjian Exp $ + * $Id: planmain.h,v 1.40 2000/05/31 00:28:38 petere Exp $ * *------------------------------------------------------------------------- */ @@ -55,6 +55,7 @@ extern void fix_opids(Node *node); /* * prep/prepkeyset.c */ +extern bool _use_keyset_query_optimizer; extern void transformKeySetQuery(Query *origNode); #endif /* PLANMAIN_H */ diff --git a/src/include/storage/lock.h b/src/include/storage/lock.h index 5e9fb8b42f2..7ec383abe7d 100644 --- a/src/include/storage/lock.h +++ b/src/include/storage/lock.h @@ -7,13 +7,14 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: lock.h,v 1.37 2000/04/12 17:16:51 momjian Exp $ + * $Id: lock.h,v 1.38 2000/05/31 00:28:38 petere Exp $ * *------------------------------------------------------------------------- */ #ifndef LOCK_H_ #define LOCK_H_ +#include "postgres.h" #include "storage/ipc.h" #include "storage/itemptr.h" #include "storage/shmem.h" @@ -26,6 +27,15 @@ typedef int LOCKMASK; #define MAX_TABLE_SIZE 1000 +#ifdef LOCK_DEBUG +extern int Trace_lock_oidmin; +extern bool Trace_locks; +extern bool Trace_userlocks; +extern int Trace_lock_table; +extern bool Debug_deadlocks; +#endif /* LOCK_DEBUG */ + + /* ---------------------- * The following defines are used to estimate how much shared * memory the lock manager is going to require. @@ -259,10 +269,9 @@ extern int LockShmemSize(int maxBackends); extern bool LockingDisabled(void); extern bool DeadLockCheck(void *proc, LOCK *findlock); -#ifdef DEADLOCK_DEBUG +#ifdef LOCK_DEBUG extern void DumpLocks(void); extern void DumpAllLocks(void); - #endif #endif /* LOCK_H */ diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index a0f8660fbea..edc6359fc43 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: proc.h,v 1.30 2000/04/12 17:16:51 momjian Exp $ + * $Id: proc.h,v 1.31 2000/05/31 00:28:38 petere Exp $ * *------------------------------------------------------------------------- */ @@ -17,6 +17,9 @@ #include "access/xlog.h" #include "storage/lock.h" +/* configurable option */ +extern int DeadlockTimeout; + typedef struct { int sleeplock; diff --git a/src/include/storage/spin.h b/src/include/storage/spin.h index 7c57f2fa624..656e1097a23 100644 --- a/src/include/storage/spin.h +++ b/src/include/storage/spin.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: spin.h,v 1.11 2000/01/26 05:58:33 momjian Exp $ + * $Id: spin.h,v 1.12 2000/05/31 00:28:38 petere Exp $ * *------------------------------------------------------------------------- */ @@ -28,6 +28,10 @@ typedef int SPINLOCK; +#ifdef LOCK_DEBUG +extern bool Trace_spinlocks; +#endif + extern void CreateSpinlocks(IPCKey key); extern void InitSpinLocks(void); extern void SpinAcquire(SPINLOCK lockid); diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h index 4e1de469334..98018c321c1 100644 --- a/src/include/tcop/tcopprot.h +++ b/src/include/tcop/tcopprot.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: tcopprot.h,v 1.27 2000/04/12 17:16:53 momjian Exp $ + * $Id: tcopprot.h,v 1.28 2000/05/31 00:28:39 petere Exp $ * * OLD COMMENTS * This file was created so that other c files could get the two @@ -28,6 +28,9 @@ extern bool Warn_restart_ready; extern bool InError; extern bool ExitAfterAbort; +extern bool HostnameLookup; +extern bool ShowPortNumber; + #ifndef BOOTSTRAP_INCLUDE extern List *pg_parse_and_rewrite(char *query_string, @@ -50,5 +53,6 @@ extern int PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[]); extern void ResetUsage(void); extern void ShowUsage(void); +extern FILE * StatFp; #endif /* TCOPPROT_H */ diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h index 190d44cfff2..94dc8330b11 100644 --- a/src/include/utils/elog.h +++ b/src/include/utils/elog.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: elog.h,v 1.16 2000/04/12 17:16:54 momjian Exp $ + * $Id: elog.h,v 1.17 2000/05/31 00:28:40 petere Exp $ * *------------------------------------------------------------------------- */ @@ -23,6 +23,10 @@ #define LOG DEBUG #define NOIND (-3) /* debug message, don't indent as far */ +#ifdef ENABLE_SYSLOG +extern int Use_syslog; +#endif + #ifndef __GNUC__ extern void elog(int lev, const char *fmt,...); diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h new file mode 100644 index 00000000000..bf0dfcbe4dc --- /dev/null +++ b/src/include/utils/guc.h @@ -0,0 +1,47 @@ +/* + * guc.h + * + * External declarations pertaining to backend/utils/misc/guc.c and + * backend/utils/misc/guc-file.l + * + * $Header: /cvsroot/pgsql/src/include/utils/guc.h,v 1.1 2000/05/31 00:28:40 petere Exp $ + */ +#ifndef GUC_H +#define GUC_H + +#include "postgres.h" + +/* + * This is sort of a permission list. Those contexts with a higher + * number can also be set via the lower numbered ways. + */ +typedef enum { + PGC_POSTMASTER = 1, /* static postmaster option */ + PGC_BACKEND = 2, /* per backend startup option */ + PGC_SIGHUP = 4, /* can change this option via SIGHUP */ + PGC_SUSET = 8, /* can change this option via SET if superuser */ + PGC_USERSET = 16, /* everyone can change this option via SET */ +} GucContext; + + +void SetConfigOption(const char * name, const char * value, GucContext context); +const char * GetConfigOption(const char * name, bool issuper); +void ProcessConfigFile(GucContext context); +void ResetAllOptions(void); + +bool set_config_option(const char * name, const char * value, GucContext context, bool DoIt); + + +extern bool Debug_print_query; +extern bool Debug_print_plan; +extern bool Debug_print_parse; +extern bool Debug_print_rewritten; +extern bool Debug_pretty_print; + +extern bool Show_parser_stats; +extern bool Show_planner_stats; +extern bool Show_executor_stats; +extern bool Show_query_stats; +extern bool Show_btree_build_stats; + +#endif /*GUC_H*/ diff --git a/src/include/utils/trace.h b/src/include/utils/trace.h deleted file mode 100644 index 71e402e9edc..00000000000 --- a/src/include/utils/trace.h +++ /dev/null @@ -1,91 +0,0 @@ -/*------------------------------------------------------------------------- - * - * trace.h - * - * Conditional trace definitions. - * - * Massimo Dal Zotto <dz@cs.unitn.it> - * - *------------------------------------------------------------------------- - */ - -#ifndef TRACE_H -#define TRACE_H - -#include <string.h> -#include <time.h> - -#ifdef ELOG_TIMESTAMPS -char *tprintf_timestamp(void); - -#define TIMESTAMP_SIZE 28 -#else -#define TIMESTAMP_SIZE 0 -#endif - -extern int tprintf(int flag, const char *fmt,...); -extern int eprintf(const char *fmt,...); -extern void write_syslog(int level, char *line); -extern void show_options(void); -extern void parse_options(char *str, bool secure); -extern void read_pg_options(SIGNAL_ARGS); - -/* - * Trace options, used as index into pg_options. - * Must match the constants in pg_options[]. - */ -enum pg_option_enum -{ - TRACE_ALL, /* 0=trace some, 1=trace all, -1=trace - * none */ - TRACE_VERBOSE, - TRACE_QUERY, - TRACE_PLAN, - TRACE_PARSE, - TRACE_REWRITTEN, - TRACE_PRETTY_PLAN, /* indented multiline versions of trees */ - TRACE_PRETTY_PARSE, - TRACE_PRETTY_REWRITTEN, - TRACE_PARSERSTATS, - TRACE_PLANNERSTATS, - TRACE_EXECUTORSTATS, - TRACE_SHORTLOCKS, /* currently unused but needed, see lock.c */ - TRACE_LOCKS, - TRACE_USERLOCKS, - TRACE_SPINLOCKS, - TRACE_NOTIFY, - TRACE_MALLOC, - TRACE_PALLOC, - TRACE_LOCKOIDMIN, - TRACE_LOCKRELATION, - OPT_LOCKREADPRIORITY, /* lock priority, see lock.c */ - OPT_DEADLOCKTIMEOUT, /* deadlock timeout, see proc.c */ - OPT_NOFSYNC, /* turn fsync off */ - OPT_SYSLOG, /* use syslog for error messages */ - OPT_HOSTLOOKUP, /* enable hostname lookup in ps_status */ - OPT_SHOWPORTNUMBER, /* show port number in ps_status */ - - NUM_PG_OPTIONS /* must be the last item of enum */ -}; - -extern int pg_options[NUM_PG_OPTIONS]; - -#ifdef __GNUC__ -#define PRINTF(args...) tprintf1(args) -#define EPRINTF(args...) eprintf(args) -#define TPRINTF(flag, args...) tprintf(flag, args) -#else -#define PRINTF tprintf1 -#define EPRINTF eprintf -#define TPRINTF tprintf -#endif - -#endif /* TRACE_H */ - -/* - * Local variables: - * tab-width: 4 - * c-indent-level: 4 - * c-basic-offset: 4 - * End: - */ |