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 
28 
29 /* Required daylight between max_stack_depth and the kernel limit, in bytes */
30 #define STACK_DEPTH_SLOP (512 * 1024L)
31 
33 extern PGDLLIMPORT const char *debug_query_string;
34 extern int max_stack_depth;
35 extern int PostAuthDelay;
36 
37 /* GUC-configurable parameters */
38 
39 typedef enum
40 {
41  LOGSTMT_NONE, /* log no statements */
42  LOGSTMT_DDL, /* log data definition statements */
43  LOGSTMT_MOD, /* log modification statements, plus DDL */
44  LOGSTMT_ALL /* log all statements */
45 } LogStmtLevel;
46 
47 extern int log_statement;
48 
49 extern List *pg_parse_query(const char *query_string);
50 extern List *pg_analyze_and_rewrite(RawStmt *parsetree,
51  const char *query_string,
52  Oid *paramTypes, int numParams);
53 extern List *pg_analyze_and_rewrite_params(RawStmt *parsetree,
54  const char *query_string,
55  ParserSetupHook parserSetup,
56  void *parserSetupArg);
57 extern PlannedStmt *pg_plan_query(Query *querytree, int cursorOptions,
58  ParamListInfo boundParams);
59 extern List *pg_plan_queries(List *querytrees, int cursorOptions,
60  ParamListInfo boundParams);
61 
62 extern bool check_max_stack_depth(int *newval, void **extra, GucSource source);
63 extern void assign_max_stack_depth(int newval, void *extra);
64 
65 extern void die(SIGNAL_ARGS);
68 extern void FloatExceptionHandler(SIGNAL_ARGS) pg_attribute_noreturn();
69 extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1
70  * handler */
71 extern void ProcessClientReadInterrupt(bool blocked);
72 extern void ProcessClientWriteInterrupt(bool blocked);
73 
74 extern void process_postgres_switches(int argc, char *argv[],
75  GucContext ctx, const char **dbname);
76 extern void PostgresMain(int argc, char *argv[],
77  const char *dbname,
78  const char *username) pg_attribute_noreturn();
79 extern long get_stack_depth_rlimit(void);
80 extern void ResetUsage(void);
81 extern void ShowUsage(const char *title);
82 extern int check_log_duration(char *msec_str, bool was_logged);
83 extern void set_debug_options(int debug_flag,
84  GucContext context, GucSource source);
85 extern bool set_plan_disabling_options(const char *arg,
86  GucContext context, GucSource source);
87 extern const char *get_stats_option_name(const char *arg);
88 
89 #endif /* TCOPPROT_H */
int PostAuthDelay
Definition: postgres.c:97
GucContext
Definition: guc.h:68
bool check_max_stack_depth(int *newval, void **extra, GucSource source)
Definition: postgres.c:3161
CommandDest whereToSendOutput
Definition: postgres.c:86
CommandDest
Definition: dest.h:86
LogStmtLevel
Definition: tcopprot.h:39
void RecoveryConflictInterrupt(ProcSignalReason reason)
Definition: postgres.c:2701
unsigned int Oid
Definition: postgres_ext.h:31
int max_stack_depth
Definition: postgres.c:94
void PostgresMain(int argc, char *argv[], const char *dbname, const char *username) pg_attribute_noreturn()
Definition: postgres.c:3563
#define PGDLLIMPORT
Definition: c.h:1063
GucSource
Definition: guc.h:105
List * pg_plan_queries(List *querytrees, int cursorOptions, ParamListInfo boundParams)
Definition: postgres.c:842
bool set_plan_disabling_options(const char *arg, GucContext context, GucSource source)
Definition: postgres.c:3222
int check_log_duration(char *msec_str, bool was_logged)
Definition: postgres.c:2102
void quickdie(SIGNAL_ARGS) pg_attribute_noreturn()
Definition: postgres.c:2558
PGDLLIMPORT const char * debug_query_string
Definition: postgres.c:83
List * pg_analyze_and_rewrite_params(RawStmt *parsetree, const char *query_string, ParserSetupHook parserSetup, void *parserSetupArg)
Definition: postgres.c:679
List * pg_parse_query(const char *query_string)
Definition: postgres.c:602
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:3304
void set_debug_options(int debug_flag, GucContext context, GucSource source)
Definition: postgres.c:3193
const char * get_stats_option_name(const char *arg)
Definition: postgres.c:3264
long get_stack_depth_rlimit(void)
Definition: postgres.c:4345
static char * username
Definition: initdb.c:131
#define SIGNAL_ARGS
Definition: c.h:1079
void ProcessClientReadInterrupt(bool blocked)
Definition: postgres.c:522
char * dbname
Definition: streamutil.c:38
#define newval
PlannedStmt * pg_plan_query(Query *querytree, int cursorOptions, ParamListInfo boundParams)
Definition: postgres.c:781
void StatementCancelHandler(SIGNAL_ARGS)
Definition: postgres.c:2650
Datum querytree(PG_FUNCTION_ARGS)
Definition: _int_bool.c:665
#define pg_attribute_noreturn()
Definition: c.h:653
List * pg_analyze_and_rewrite(RawStmt *parsetree, const char *query_string, Oid *paramTypes, int numParams)
Definition: postgres.c:644
ProcSignalReason
Definition: procsignal.h:30
void * arg
void ShowUsage(const char *title)
Definition: postgres.c:4388
void die(SIGNAL_ARGS)
Definition: postgres.c:2619
void assign_max_stack_depth(int newval, void *extra)
Definition: postgres.c:3178
void FloatExceptionHandler(SIGNAL_ARGS) pg_attribute_noreturn()
Definition: postgres.c:2671
Definition: pg_list.h:45
int log_statement
Definition: postgres.c:91
void ResetUsage(void)
Definition: postgres.c:4381
void ProcessClientWriteInterrupt(bool blocked)
Definition: postgres.c:560