PostgreSQL Source Code  git master
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * tcopprot.h
4  * prototypes for postgres.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/tcop/tcopprot.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef TCOPPROT_H
15 #define TCOPPROT_H
17 #include "nodes/params.h"
18 #include "nodes/parsenodes.h"
19 #include "nodes/plannodes.h"
20 #include "storage/procsignal.h"
21 #include "utils/guc.h"
22 #include "utils/queryenvironment.h"
25 /* Required daylight between max_stack_depth and the kernel limit, in bytes */
26 #define STACK_DEPTH_SLOP (512 * 1024L)
29 extern PGDLLIMPORT const char *debug_query_string;
30 extern PGDLLIMPORT int max_stack_depth;
31 extern PGDLLIMPORT int PostAuthDelay;
34 /* GUC-configurable parameters */
36 typedef enum
37 {
38  LOGSTMT_NONE, /* log no statements */
39  LOGSTMT_DDL, /* log data definition statements */
40  LOGSTMT_MOD, /* log modification statements, plus DDL */
41  LOGSTMT_ALL /* log all statements */
44 extern PGDLLIMPORT int log_statement;
46 extern List *pg_parse_query(const char *query_string);
47 extern List *pg_rewrite_query(Query *query);
49  const char *query_string,
50  const Oid *paramTypes, int numParams,
51  QueryEnvironment *queryEnv);
53  const char *query_string,
54  Oid **paramTypes,
55  int *numParams,
56  QueryEnvironment *queryEnv);
57 extern List *pg_analyze_and_rewrite_withcb(RawStmt *parsetree,
58  const char *query_string,
59  ParserSetupHook parserSetup,
60  void *parserSetupArg,
61  QueryEnvironment *queryEnv);
62 extern PlannedStmt *pg_plan_query(Query *querytree, const char *query_string,
63  int cursorOptions,
64  ParamListInfo boundParams);
65 extern List *pg_plan_queries(List *querytrees, const char *query_string,
66  int cursorOptions,
67  ParamListInfo boundParams);
69 extern void die(SIGNAL_ARGS);
73 extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1
74  * handler */
75 extern void ProcessClientReadInterrupt(bool blocked);
76 extern void ProcessClientWriteInterrupt(bool blocked);
78 extern void process_postgres_switches(int argc, char *argv[],
79  GucContext ctx, const char **dbname);
80 extern void PostgresSingleUserMain(int argc, char *argv[],
81  const char *username) pg_attribute_noreturn();
82 extern void PostgresMain(const char *dbname,
83  const char *username) pg_attribute_noreturn();
84 extern long get_stack_depth_rlimit(void);
85 extern void ResetUsage(void);
86 extern void ShowUsage(const char *title);
87 extern int check_log_duration(char *msec_str, bool was_logged);
88 extern void set_debug_options(int debug_flag,
89  GucContext context, GucSource source);
90 extern bool set_plan_disabling_options(const char *arg,
91  GucContext context, GucSource source);
92 extern const char *get_stats_option_name(const char *arg);
94 #endif /* TCOPPROT_H */
Datum querytree(PG_FUNCTION_ARGS)
Definition: _int_bool.c:666
Definition: c.h:1303
Definition: c.h:1332
#define pg_attribute_noreturn()
Definition: c.h:201
Definition: dest.h:86
Definition: guc.h:108
Definition: guc.h:68
void(* ParserSetupHook)(struct ParseState *pstate, void *arg)
Definition: params.h:108
void * arg
static rewind_source * source
Definition: pg_rewind.c:87
const char * username
Definition: pgbench.c:306
unsigned int Oid
Definition: postgres_ext.h:31
Definition: procsignal.h:31
char * dbname
Definition: streamutil.c:51
Definition: pg_list.h:54
List * pg_parse_query(const char *query_string)
Definition: postgres.c:577
void process_postgres_switches(int argc, char *argv[], GucContext ctx, const char **dbname)
Definition: postgres.c:3703
PGDLLIMPORT int PostAuthDelay
Definition: postgres.c:95
void FloatExceptionHandler(SIGNAL_ARGS) pg_attribute_noreturn()
Definition: postgres.c:2990
void set_debug_options(int debug_flag, GucContext context, GucSource source)
Definition: postgres.c:3592
PGDLLIMPORT const char * debug_query_string
Definition: postgres.c:81
void StatementCancelHandler(SIGNAL_ARGS)
Definition: postgres.c:2969
long get_stack_depth_rlimit(void)
Definition: postgres.c:4838
bool set_plan_disabling_options(const char *arg, GucContext context, GucSource source)
Definition: postgres.c:3621
void PostgresMain(const char *dbname, const char *username) pg_attribute_noreturn()
Definition: postgres.c:4065
int check_log_duration(char *msec_str, bool was_logged)
Definition: postgres.c:2345
List * pg_analyze_and_rewrite_varparams(RawStmt *parsetree, const char *query_string, Oid **paramTypes, int *numParams, QueryEnvironment *queryEnv)
Definition: postgres.c:676
Definition: tcopprot.h:37
Definition: tcopprot.h:38
Definition: tcopprot.h:40
Definition: tcopprot.h:39
Definition: tcopprot.h:41
List * pg_analyze_and_rewrite_withcb(RawStmt *parsetree, const char *query_string, ParserSetupHook parserSetup, void *parserSetupArg, QueryEnvironment *queryEnv)
Definition: postgres.c:730
void ShowUsage(const char *title)
Definition: postgres.c:4877
void PostgresSingleUserMain(int argc, char *argv[], const char *username) pg_attribute_noreturn()
Definition: postgres.c:3955
List * pg_analyze_and_rewrite_fixedparams(RawStmt *parsetree, const char *query_string, const Oid *paramTypes, int numParams, QueryEnvironment *queryEnv)
Definition: postgres.c:637
PGDLLIMPORT int log_statement
Definition: postgres.c:89
PGDLLIMPORT int max_stack_depth
Definition: postgres.c:92
void RecoveryConflictInterrupt(ProcSignalReason reason)
Definition: postgres.c:3008
List * pg_rewrite_query(Query *query)
Definition: postgres.c:770
void die(SIGNAL_ARGS)
Definition: postgres.c:2935
const char * get_stats_option_name(const char *arg)
Definition: postgres.c:3663
void ProcessClientReadInterrupt(bool blocked)
Definition: postgres.c:475
PlannedStmt * pg_plan_query(Query *querytree, const char *query_string, int cursorOptions, ParamListInfo boundParams)
Definition: postgres.c:852
void ProcessClientWriteInterrupt(bool blocked)
Definition: postgres.c:521
void ResetUsage(void)
Definition: postgres.c:4870
List * pg_plan_queries(List *querytrees, const char *query_string, int cursorOptions, ParamListInfo boundParams)
Definition: postgres.c:938
void quickdie(SIGNAL_ARGS) pg_attribute_noreturn()
Definition: postgres.c:2838
PGDLLIMPORT CommandDest whereToSendOutput
Definition: postgres.c:84
PGDLLIMPORT int client_connection_check_interval
Definition: postgres.c:98