PostgreSQL Source Code  git master
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);
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:3213
CommandDest whereToSendOutput
Definition: postgres.c:88
CommandDest
Definition: dest.h:86
LogStmtLevel
Definition: tcopprot.h:40
void RecoveryConflictInterrupt(ProcSignalReason reason)
Definition: postgres.c:2740
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:3615
#define PGDLLIMPORT
Definition: c.h:1050
List * pg_analyze_and_rewrite(RawStmt *parsetree, const char *query_string, Oid *paramTypes, int numParams, QueryEnvironment *queryEnv)
Definition: postgres.c:649
GucSource
Definition: guc.h:105
List * pg_plan_queries(List *querytrees, int cursorOptions, ParamListInfo boundParams)
Definition: postgres.c:851
bool set_plan_disabling_options(const char *arg, GucContext context, GucSource source)
Definition: postgres.c:3274
int check_log_duration(char *msec_str, bool was_logged)
Definition: postgres.c:2129
void quickdie(SIGNAL_ARGS) pg_attribute_noreturn()
Definition: postgres.c:2591
void(* ParserSetupHook)(struct ParseState *pstate, void *arg)
Definition: params.h:66
PGDLLIMPORT const char * debug_query_string
Definition: postgres.c:85
List * pg_parse_query(const char *query_string)
Definition: postgres.c:607
void process_postgres_switches(int argc, char *argv[], GucContext ctx, const char **dbname)
Definition: postgres.c:3356
void set_debug_options(int debug_flag, GucContext context, GucSource source)
Definition: postgres.c:3245
const char * get_stats_option_name(const char *arg)
Definition: postgres.c:3316
List * pg_analyze_and_rewrite_params(RawStmt *parsetree, const char *query_string, ParserSetupHook parserSetup, void *parserSetupArg, QueryEnvironment *queryEnv)
Definition: postgres.c:686
long get_stack_depth_rlimit(void)
Definition: postgres.c:4401
static char * username
Definition: initdb.c:132
#define SIGNAL_ARGS
Definition: c.h:1066
void ProcessClientReadInterrupt(bool blocked)
Definition: postgres.c:527
char * dbname
Definition: streamutil.c:42
#define newval
PlannedStmt * pg_plan_query(Query *querytree, int cursorOptions, ParamListInfo boundParams)
Definition: postgres.c:790
void StatementCancelHandler(SIGNAL_ARGS)
Definition: postgres.c:2683
Datum querytree(PG_FUNCTION_ARGS)
Definition: _int_bool.c:665
#define pg_attribute_noreturn()
Definition: c.h:146
ProcSignalReason
Definition: procsignal.h:30
void * arg
void ShowUsage(const char *title)
Definition: postgres.c:4444
void die(SIGNAL_ARGS)
Definition: postgres.c:2652
void assign_max_stack_depth(int newval, void *extra)
Definition: postgres.c:3230
void FloatExceptionHandler(SIGNAL_ARGS) pg_attribute_noreturn()
Definition: postgres.c:2704
Definition: pg_list.h:45
int log_statement
Definition: postgres.c:93
void ResetUsage(void)
Definition: postgres.c:4437
void ProcessClientWriteInterrupt(bool blocked)
Definition: postgres.c:565