PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
tcopprot.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * tcopprot.h
4  * prototypes for postgres.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/tcop/tcopprot.h
11  *
12  * OLD COMMENTS
13  * This file was created so that other c files could get the two
14  * function prototypes without having to include tcop.h which single
15  * handedly includes the whole f*cking tree -- mer 5 Nov. 1991
16  *
17  *-------------------------------------------------------------------------
18  */
19 #ifndef TCOPPROT_H
20 #define TCOPPROT_H
21 
22 #include "nodes/params.h"
23 #include "nodes/parsenodes.h"
24 #include "nodes/plannodes.h"
25 #include "storage/procsignal.h"
26 #include "utils/guc.h"
27 #include "utils/queryenvironment.h"
28 
29 
30 /* Required daylight between max_stack_depth and the kernel limit, in bytes */
31 #define STACK_DEPTH_SLOP (512 * 1024L)
32 
34 extern PGDLLIMPORT const char *debug_query_string;
35 extern int max_stack_depth;
36 extern int PostAuthDelay;
37 
38 /* GUC-configurable parameters */
39 
40 typedef enum
41 {
42  LOGSTMT_NONE, /* log no statements */
43  LOGSTMT_DDL, /* log data definition statements */
44  LOGSTMT_MOD, /* log modification statements, plus DDL */
45  LOGSTMT_ALL /* log all statements */
46 } LogStmtLevel;
47 
48 extern int log_statement;
49 
50 extern List *pg_parse_query(const char *query_string);
51 extern List *pg_analyze_and_rewrite(RawStmt *parsetree,
52  const char *query_string,
53  Oid *paramTypes, int numParams,
54  QueryEnvironment *queryEnv);
55 extern List *pg_analyze_and_rewrite_params(RawStmt *parsetree,
56  const char *query_string,
57  ParserSetupHook parserSetup,
58  void *parserSetupArg,
59  QueryEnvironment *queryEnv);
60 extern PlannedStmt *pg_plan_query(Query *querytree, int cursorOptions,
61  ParamListInfo boundParams);
62 extern List *pg_plan_queries(List *querytrees, int cursorOptions,
63  ParamListInfo boundParams);
64 
65 extern bool check_max_stack_depth(int *newval, void **extra, GucSource source);
66 extern void assign_max_stack_depth(int newval, void *extra);
67 
68 extern void die(SIGNAL_ARGS);
71 extern void FloatExceptionHandler(SIGNAL_ARGS) pg_attribute_noreturn();
72 extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1
73  * handler */
74 extern void ProcessClientReadInterrupt(bool blocked);
75 extern void ProcessClientWriteInterrupt(bool blocked);
76 
77 extern void process_postgres_switches(int argc, char *argv[],
78  GucContext ctx, const char **dbname);
79 extern void PostgresMain(int argc, char *argv[],
80  const char *dbname,
81  const char *username) pg_attribute_noreturn();
82 extern long get_stack_depth_rlimit(void);
83 extern void ResetUsage(void);
84 extern void ShowUsage(const char *title);
85 extern int check_log_duration(char *msec_str, bool was_logged);
86 extern void set_debug_options(int debug_flag,
87  GucContext context, GucSource source);
88 extern bool set_plan_disabling_options(const char *arg,
89  GucContext context, GucSource source);
90 extern const char *get_stats_option_name(const char *arg);
91 
92 #endif /* TCOPPROT_H */
int PostAuthDelay
Definition: postgres.c:99
GucContext
Definition: guc.h:68
bool check_max_stack_depth(int *newval, void **extra, GucSource source)
Definition: postgres.c:3207
CommandDest whereToSendOutput
Definition: postgres.c:88
CommandDest
Definition: dest.h:86
LogStmtLevel
Definition: tcopprot.h:40
void RecoveryConflictInterrupt(ProcSignalReason reason)
Definition: postgres.c:2732
unsigned int Oid
Definition: postgres_ext.h:31
int max_stack_depth
Definition: postgres.c:96
void PostgresMain(int argc, char *argv[], const char *dbname, const char *username) pg_attribute_noreturn()
Definition: postgres.c:3609
#define PGDLLIMPORT
Definition: c.h:1052
List * pg_analyze_and_rewrite(RawStmt *parsetree, const char *query_string, Oid *paramTypes, int numParams, QueryEnvironment *queryEnv)
Definition: postgres.c:645
GucSource
Definition: guc.h:105
List * pg_plan_queries(List *querytrees, int cursorOptions, ParamListInfo boundParams)
Definition: postgres.c:847
bool set_plan_disabling_options(const char *arg, GucContext context, GucSource source)
Definition: postgres.c:3268
int check_log_duration(char *msec_str, bool was_logged)
Definition: postgres.c:2125
void quickdie(SIGNAL_ARGS) pg_attribute_noreturn()
Definition: postgres.c:2583
PGDLLIMPORT const char * debug_query_string
Definition: postgres.c:85
List * pg_parse_query(const char *query_string)
Definition: postgres.c:603
void(* ParserSetupHook)(struct ParseState *pstate, void *arg)
Definition: params.h:66
void process_postgres_switches(int argc, char *argv[], GucContext ctx, const char **dbname)
Definition: postgres.c:3350
void set_debug_options(int debug_flag, GucContext context, GucSource source)
Definition: postgres.c:3239
const char * get_stats_option_name(const char *arg)
Definition: postgres.c:3310
List * pg_analyze_and_rewrite_params(RawStmt *parsetree, const char *query_string, ParserSetupHook parserSetup, void *parserSetupArg, QueryEnvironment *queryEnv)
Definition: postgres.c:682
long get_stack_depth_rlimit(void)
Definition: postgres.c:4382
static char * username
Definition: initdb.c:132
#define SIGNAL_ARGS
Definition: c.h:1068
void ProcessClientReadInterrupt(bool blocked)
Definition: postgres.c:523
char * dbname
Definition: streamutil.c:45
#define newval
PlannedStmt * pg_plan_query(Query *querytree, int cursorOptions, ParamListInfo boundParams)
Definition: postgres.c:786
void StatementCancelHandler(SIGNAL_ARGS)
Definition: postgres.c:2675
Datum querytree(PG_FUNCTION_ARGS)
Definition: _int_bool.c:665
#define pg_attribute_noreturn()
Definition: c.h:642
ProcSignalReason
Definition: procsignal.h:30
void * arg
void ShowUsage(const char *title)
Definition: postgres.c:4425
void die(SIGNAL_ARGS)
Definition: postgres.c:2644
void assign_max_stack_depth(int newval, void *extra)
Definition: postgres.c:3224
void FloatExceptionHandler(SIGNAL_ARGS) pg_attribute_noreturn()
Definition: postgres.c:2696
Definition: pg_list.h:45
int log_statement
Definition: postgres.c:93
void ResetUsage(void)
Definition: postgres.c:4418
void ProcessClientWriteInterrupt(bool blocked)
Definition: postgres.c:561