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-2025, 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
16
17#include "nodes/params.h"
18#include "nodes/plannodes.h"
19#include "storage/procsignal.h"
20#include "utils/guc.h"
22
23typedef struct ExplainState ExplainState; /* defined in explain_state.h */
24
26extern PGDLLIMPORT const char *debug_query_string;
27extern PGDLLIMPORT int PostAuthDelay;
29
30/* GUC-configurable parameters */
31
32typedef enum
33{
34 LOGSTMT_NONE, /* log no statements */
35 LOGSTMT_DDL, /* log data definition statements */
36 LOGSTMT_MOD, /* log modification statements, plus DDL */
37 LOGSTMT_ALL, /* log all statements */
39
41extern PGDLLIMPORT int log_statement;
42
43/* Flags for restrict_nonsystem_relation_kind value */
44#define RESTRICT_RELKIND_VIEW 0x01
45#define RESTRICT_RELKIND_FOREIGN_TABLE 0x02
46
48
49extern List *pg_parse_query(const char *query_string);
50extern List *pg_rewrite_query(Query *query);
52 const char *query_string,
53 const Oid *paramTypes, int numParams,
54 QueryEnvironment *queryEnv);
56 const char *query_string,
57 Oid **paramTypes,
58 int *numParams,
59 QueryEnvironment *queryEnv);
61 const char *query_string,
62 ParserSetupHook parserSetup,
63 void *parserSetupArg,
64 QueryEnvironment *queryEnv);
65extern PlannedStmt *pg_plan_query(Query *querytree, const char *query_string,
66 int cursorOptions,
67 ParamListInfo boundParams,
68 ExplainState *es);
69extern List *pg_plan_queries(List *querytrees, const char *query_string,
70 int cursorOptions,
71 ParamListInfo boundParams);
72
73extern void die(SIGNAL_ARGS);
78extern void ProcessClientReadInterrupt(bool blocked);
79extern void ProcessClientWriteInterrupt(bool blocked);
80
81extern void process_postgres_switches(int argc, char *argv[],
82 GucContext ctx, const char **dbname);
83pg_noreturn extern void PostgresSingleUserMain(int argc, char *argv[],
84 const char *username);
85pg_noreturn extern void PostgresMain(const char *dbname,
86 const char *username);
87extern void ResetUsage(void);
88extern void ShowUsage(const char *title);
89extern int check_log_duration(char *msec_str, bool was_logged);
90extern void set_debug_options(int debug_flag,
91 GucContext context, GucSource source);
92extern bool set_plan_disabling_options(const char *arg,
93 GucContext context, GucSource source);
94extern const char *get_stats_option_name(const char *arg);
95
96#endif /* TCOPPROT_H */
Datum querytree(PG_FUNCTION_ARGS)
Definition: _int_bool.c:665
#define PGDLLIMPORT
Definition: c.h:1320
#define pg_noreturn
Definition: c.h:169
#define SIGNAL_ARGS
Definition: c.h:1349
CommandDest
Definition: dest.h:86
GucSource
Definition: guc.h:112
GucContext
Definition: guc.h:72
static char * username
Definition: initdb.c:153
void(* ParserSetupHook)(ParseState *pstate, void *arg)
Definition: params.h:107
void * arg
static rewind_source * source
Definition: pg_rewind.c:89
unsigned int Oid
Definition: postgres_ext.h:32
ProcSignalReason
Definition: procsignal.h:31
char * dbname
Definition: streamutil.c:49
Definition: pg_list.h:54
List * pg_analyze_and_rewrite_withcb(RawStmt *parsetree, const char *query_string, ParserSetupHook parserSetup, void *parserSetupArg, QueryEnvironment *queryEnv)
Definition: postgres.c:763
List * pg_parse_query(const char *query_string)
Definition: postgres.c:604
void process_postgres_switches(int argc, char *argv[], GucContext ctx, const char **dbname)
Definition: postgres.c:3799
PGDLLIMPORT int PostAuthDelay
Definition: postgres.c:100
PlannedStmt * pg_plan_query(Query *querytree, const char *query_string, int cursorOptions, ParamListInfo boundParams, ExplainState *es)
Definition: postgres.c:887
PGDLLIMPORT int restrict_nonsystem_relation_kind
Definition: postgres.c:106
pg_noreturn void PostgresSingleUserMain(int argc, char *argv[], const char *username)
Definition: postgres.c:4064
List * pg_plan_queries(List *querytrees, const char *query_string, int cursorOptions, ParamListInfo boundParams)
Definition: postgres.c:975
void set_debug_options(int debug_flag, GucContext context, GucSource source)
Definition: postgres.c:3685
PGDLLIMPORT const char * debug_query_string
Definition: postgres.c:89
void StatementCancelHandler(SIGNAL_ARGS)
Definition: postgres.c:3062
bool set_plan_disabling_options(const char *arg, GucContext context, GucSource source)
Definition: postgres.c:3717
List * pg_analyze_and_rewrite_fixedparams(RawStmt *parsetree, const char *query_string, const Oid *paramTypes, int numParams, QueryEnvironment *queryEnv)
Definition: postgres.c:670
int check_log_duration(char *msec_str, bool was_logged)
Definition: postgres.c:2429
const char * get_stats_option_name(const char *arg)
Definition: postgres.c:3759
pg_noreturn void PostgresMain(const char *dbname, const char *username)
Definition: postgres.c:4193
void HandleRecoveryConflictInterrupt(ProcSignalReason reason)
Definition: postgres.c:3095
List * pg_rewrite_query(Query *query)
Definition: postgres.c:803
LogStmtLevel
Definition: tcopprot.h:33
@ LOGSTMT_NONE
Definition: tcopprot.h:34
@ LOGSTMT_MOD
Definition: tcopprot.h:36
@ LOGSTMT_DDL
Definition: tcopprot.h:35
@ LOGSTMT_ALL
Definition: tcopprot.h:37
void ShowUsage(const char *title)
Definition: postgres.c:5068
PGDLLIMPORT int log_statement
Definition: postgres.c:97
void die(SIGNAL_ARGS)
Definition: postgres.c:3032
void ProcessClientReadInterrupt(bool blocked)
Definition: postgres.c:502
pg_noreturn void FloatExceptionHandler(SIGNAL_ARGS)
Definition: postgres.c:3079
void ProcessClientWriteInterrupt(bool blocked)
Definition: postgres.c:548
void ResetUsage(void)
Definition: postgres.c:5061
PGDLLIMPORT bool Log_disconnections
Definition: postgres.c:95
PGDLLIMPORT CommandDest whereToSendOutput
Definition: postgres.c:92
PGDLLIMPORT int client_connection_check_interval
Definition: postgres.c:103
List * pg_analyze_and_rewrite_varparams(RawStmt *parsetree, const char *query_string, Oid **paramTypes, int *numParams, QueryEnvironment *queryEnv)
Definition: postgres.c:709
pg_noreturn void quickdie(SIGNAL_ARGS)
Definition: postgres.c:2935