diff options
| author | Peter Eisentraut | 2000-06-22 22:31:24 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2000-06-22 22:31:24 +0000 |
| commit | c4465095659bb089e08f8c94ce045ba3572a194f (patch) | |
| tree | 14b2fcbc9cf78738a235e4b9c7c38c1dce7656f3 /src/include | |
| parent | bc06269495c42ab7eb15a905d84374f78829a065 (diff) | |
Second pass over run-time configuration system. Adjust priorities on some
option settings. Sort out SIGHUP vs BACKEND -- there is no total ordering
here, so make explicit checks. Add comments explaining all of this.
Removed permissions check on SHOW command.
Add examine_subclass to the game, rename to SQL_inheritance to fit the
official data model better. Adjust documentation.
Standalone backend needs to reset all options before it starts. To
facilitate that, have IsUnderPostmaster be set by the postmaster itself,
don't wait for the magic -p switch.
Also make sure that all environment variables and argv's survive
init_ps_display(). Use strdup where necessary.
Have initdb make configuration files (postgresql.conf, pg_hba.conf) mode
0600 -- having configuration files is no fun if you can't edit them.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/commands/variable.h | 3 | ||||
| -rw-r--r-- | src/include/utils/guc.h | 43 |
2 files changed, 35 insertions, 11 deletions
diff --git a/src/include/commands/variable.h b/src/include/commands/variable.h index de26bcd6e0..87334dda4d 100644 --- a/src/include/commands/variable.h +++ b/src/include/commands/variable.h @@ -2,7 +2,7 @@ * Headers for handling of 'SET var TO', 'SHOW var' and 'RESET var' * statements * - * $Id: variable.h,v 1.11 2000/06/09 01:44:24 momjian Exp $ + * $Id: variable.h,v 1.12 2000/06/22 22:31:23 petere Exp $ * */ #ifndef VARIABLE_H @@ -13,6 +13,5 @@ extern void GetPGVariable(const char *name); extern void ResetPGVariable(const char *name); extern void set_default_datestyle(void); -extern bool examine_subclass; #endif /* VARIABLE_H */ diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index bf0dfcbe4d..c4ff10a140 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -4,7 +4,7 @@ * 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 $ + * $Header: /cvsroot/pgsql/src/include/utils/guc.h,v 1.2 2000/06/22 22:31:24 petere Exp $ */ #ifndef GUC_H #define GUC_H @@ -12,20 +12,43 @@ #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. + * Certain options can only be set at certain times. The rules are + * like this: + * + * POSTMASTER options can only be set when the postmaster starts, + * either from the configuration file or the command line. + * + * SIGHUP options can only be set at postmaster startup or by changing + * the configuration file and sending the HUP signal to the postmaster + * or a backend process. (Notice that the signal receipt will not be + * evaluated immediately. The postmaster and the backend block at a + * certain point in their main loop. It's safer to wait than to read a + * file asynchronously.) + * + * BACKEND options can only be set at postmaster startup or with the + * PGOPTIONS variable from the client when the connection is + * initiated. Note that you cannot change this kind of option using + * the SIGHUP mechanism, that would defeat the purpose of this being + * fixed for a given backend once started. + * + * SUSET options can be set at postmaster startup, with the SIGHUP + * mechanism, or from SQL if you're a superuser. These options cannot + * be set using the PGOPTIONS mechanism, because there is not check as + * to who does this. + * + * USERSET options can be set by anyone any time. */ 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 */ + PGC_POSTMASTER, + PGC_SIGHUP, + PGC_BACKEND, + PGC_SUSET, + PGC_USERSET, } GucContext; void SetConfigOption(const char * name, const char * value, GucContext context); -const char * GetConfigOption(const char * name, bool issuper); +const char * GetConfigOption(const char * name); void ProcessConfigFile(GucContext context); void ResetAllOptions(void); @@ -44,4 +67,6 @@ extern bool Show_executor_stats; extern bool Show_query_stats; extern bool Show_btree_build_stats; +extern bool SQL_inheritance; + #endif /*GUC_H*/ |
