2000-05-30 20:28:42 -04:00
|
|
|
/*
|
|
|
|
|
* guc.h
|
|
|
|
|
*
|
|
|
|
|
* External declarations pertaining to backend/utils/misc/guc.c and
|
|
|
|
|
* backend/utils/misc/guc-file.l
|
|
|
|
|
*
|
2002-11-14 19:47:22 -05:00
|
|
|
* $Id: guc.h,v 1.26 2002/11/15 00:47:22 momjian Exp $
|
2000-05-30 20:28:42 -04:00
|
|
|
*/
|
|
|
|
|
#ifndef GUC_H
|
|
|
|
|
#define GUC_H
|
|
|
|
|
|
2002-05-16 21:19:19 -04:00
|
|
|
#include "nodes/pg_list.h"
|
2002-03-01 17:45:19 -05:00
|
|
|
#include "utils/array.h"
|
|
|
|
|
|
2002-05-16 21:19:19 -04:00
|
|
|
|
2000-05-30 20:28:42 -04:00
|
|
|
/*
|
2000-06-22 18:31:24 -04:00
|
|
|
* 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.)
|
|
|
|
|
*
|
2001-09-30 16:16:21 -04:00
|
|
|
* BACKEND options can only be set at postmaster startup, from the
|
|
|
|
|
* configuration file, or with the PGOPTIONS variable from the client
|
|
|
|
|
* when the connection is initiated. Furthermore, an already-started
|
|
|
|
|
* backend will ignore changes to such an option in the configuration
|
|
|
|
|
* file. The idea is that these options are fixed for a given backend
|
|
|
|
|
* once it's started, but they can vary across backends.
|
2000-06-22 18:31:24 -04:00
|
|
|
*
|
|
|
|
|
* 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.
|
2000-05-30 20:28:42 -04:00
|
|
|
*/
|
2001-03-21 23:01:46 -05:00
|
|
|
typedef enum
|
|
|
|
|
{
|
2001-10-28 01:26:15 -05:00
|
|
|
PGC_POSTMASTER,
|
|
|
|
|
PGC_SIGHUP,
|
|
|
|
|
PGC_BACKEND,
|
|
|
|
|
PGC_SUSET,
|
|
|
|
|
PGC_USERSET
|
2000-05-30 20:28:42 -04:00
|
|
|
} GucContext;
|
|
|
|
|
|
2002-02-22 20:31:37 -05:00
|
|
|
/*
|
|
|
|
|
* The following type records the source of the current setting. A
|
|
|
|
|
* new setting can only take effect if the previous setting had the
|
|
|
|
|
* same or lower level. (E.g, changing the config file doesn't
|
2002-05-16 21:19:19 -04:00
|
|
|
* override the postmaster command line.) Tracking the source allows us
|
|
|
|
|
* to process sources in any convenient order without affecting results.
|
|
|
|
|
* Sources <= PGC_S_OVERRIDE will set the default used by RESET, as well
|
|
|
|
|
* as the current value.
|
2002-02-22 20:31:37 -05:00
|
|
|
*/
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
PGC_S_DEFAULT = 0, /* wired-in default */
|
2002-05-16 21:19:19 -04:00
|
|
|
PGC_S_ENV_VAR = 1, /* postmaster environment variable */
|
|
|
|
|
PGC_S_FILE = 2, /* postgresql.conf */
|
|
|
|
|
PGC_S_ARGV = 3, /* postmaster command line */
|
|
|
|
|
PGC_S_DATABASE = 4, /* per-database setting */
|
|
|
|
|
PGC_S_USER = 5, /* per-user setting */
|
|
|
|
|
PGC_S_CLIENT = 6, /* from client (PGOPTIONS) */
|
|
|
|
|
PGC_S_OVERRIDE = 7, /* special case to forcibly set default */
|
|
|
|
|
PGC_S_SESSION = 8 /* SET command */
|
2002-02-22 20:31:37 -05:00
|
|
|
} GucSource;
|
2000-05-30 20:28:42 -04:00
|
|
|
|
2001-06-12 18:54:06 -04:00
|
|
|
extern void SetConfigOption(const char *name, const char *value,
|
2002-02-22 20:31:37 -05:00
|
|
|
GucContext context, GucSource source);
|
2001-06-12 18:54:06 -04:00
|
|
|
extern const char *GetConfigOption(const char *name);
|
2002-05-16 21:19:19 -04:00
|
|
|
extern const char *GetConfigOptionResetString(const char *name);
|
2001-06-12 18:54:06 -04:00
|
|
|
extern void ProcessConfigFile(GucContext context);
|
2002-05-16 21:19:19 -04:00
|
|
|
extern void InitializeGUCOptions(void);
|
|
|
|
|
extern void ResetAllOptions(void);
|
|
|
|
|
extern void AtEOXact_GUC(bool isCommit);
|
2001-06-12 18:54:06 -04:00
|
|
|
extern void ParseLongOption(const char *string, char **name, char **value);
|
|
|
|
|
extern bool set_config_option(const char *name, const char *value,
|
2002-09-04 16:31:48 -04:00
|
|
|
GucContext context, GucSource source,
|
|
|
|
|
bool isLocal, bool DoIt);
|
2002-05-16 21:19:19 -04:00
|
|
|
extern void ShowGUCConfigOption(const char *name);
|
2001-06-12 18:54:06 -04:00
|
|
|
extern void ShowAllGUCConfig(void);
|
2002-07-20 11:12:56 -04:00
|
|
|
extern char *GetConfigOptionByName(const char *name, const char **varname);
|
2002-07-30 12:20:03 -04:00
|
|
|
extern char *GetConfigOptionByNum(int varnum, const char **varname, bool *noshow);
|
2002-09-04 16:31:48 -04:00
|
|
|
extern int GetNumConfigOptions(void);
|
2000-05-30 20:28:42 -04:00
|
|
|
|
2002-05-16 21:19:19 -04:00
|
|
|
extern void SetPGVariable(const char *name, List *args, bool is_local);
|
|
|
|
|
extern void GetPGVariable(const char *name);
|
|
|
|
|
extern void ResetPGVariable(const char *name);
|
|
|
|
|
|
|
|
|
|
extern char *flatten_set_variable_args(const char *name, List *args);
|
|
|
|
|
|
2002-03-01 17:45:19 -05:00
|
|
|
extern void ProcessGUCArray(ArrayType *array, GucSource source);
|
|
|
|
|
extern ArrayType *GUCArrayAdd(ArrayType *array, const char *name, const char *value);
|
|
|
|
|
extern ArrayType *GUCArrayDelete(ArrayType *array, const char *name);
|
2000-05-30 20:28:42 -04:00
|
|
|
|
2002-09-02 01:42:54 -04:00
|
|
|
extern const char *assign_min_error_statement(const char *newval, bool doit,
|
2002-09-04 16:31:48 -04:00
|
|
|
bool interactive);
|
2002-09-02 01:42:54 -04:00
|
|
|
|
2002-11-14 18:53:27 -05:00
|
|
|
extern const char *assign_log_min_messages(const char *newval,
|
2002-09-04 16:31:48 -04:00
|
|
|
bool doit, bool interactive);
|
2002-09-02 01:42:54 -04:00
|
|
|
extern const char *assign_client_min_messages(const char *newval,
|
2002-09-04 16:31:48 -04:00
|
|
|
bool doit, bool interactive);
|
2002-11-14 19:47:22 -05:00
|
|
|
extern bool log_statement;
|
|
|
|
|
extern bool log_duration;
|
2000-05-30 20:28:42 -04:00
|
|
|
extern bool Debug_print_plan;
|
|
|
|
|
extern bool Debug_print_parse;
|
|
|
|
|
extern bool Debug_print_rewritten;
|
|
|
|
|
extern bool Debug_pretty_print;
|
|
|
|
|
|
2002-11-14 19:47:22 -05:00
|
|
|
extern bool log_parser_stats;
|
|
|
|
|
extern bool log_planner_stats;
|
|
|
|
|
extern bool log_executor_stats;
|
|
|
|
|
extern bool log_statement_stats;
|
|
|
|
|
extern bool log_btree_build_stats;
|
2000-05-30 20:28:42 -04:00
|
|
|
|
2002-03-23 23:31:09 -05:00
|
|
|
extern bool Explain_pretty_print;
|
|
|
|
|
|
2000-06-22 18:31:24 -04:00
|
|
|
extern bool SQL_inheritance;
|
2001-06-18 12:14:44 -04:00
|
|
|
extern bool Australian_timezones;
|
2001-10-28 01:26:15 -05:00
|
|
|
|
2002-09-02 01:42:54 -04:00
|
|
|
extern int log_min_error_statement;
|
|
|
|
|
extern char *log_min_error_statement_str;
|
|
|
|
|
extern const char log_min_error_statement_str_default[];
|
|
|
|
|
|
2002-11-14 18:53:27 -05:00
|
|
|
extern int log_min_messages;
|
|
|
|
|
extern char *log_min_messages_str;
|
|
|
|
|
extern const char log_min_messages_str_default[];
|
2002-09-02 01:42:54 -04:00
|
|
|
|
2002-09-04 16:31:48 -04:00
|
|
|
extern int client_min_messages;
|
|
|
|
|
extern char *client_min_messages_str;
|
2002-09-02 01:42:54 -04:00
|
|
|
|
|
|
|
|
extern const char client_min_messages_str_default[];
|
|
|
|
|
|
2001-11-05 12:46:40 -05:00
|
|
|
#endif /* GUC_H */
|