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
23
25extern PGDLLIMPORT const char *debug_query_string;
26extern PGDLLIMPORT int PostAuthDelay;
28
29/* GUC-configurable parameters */
30
31typedef enum
32{
33 LOGSTMT_NONE, /* log no statements */
34 LOGSTMT_DDL, /* log data definition statements */
35 LOGSTMT_MOD, /* log modification statements, plus DDL */
36 LOGSTMT_ALL, /* log all statements */
38
40extern PGDLLIMPORT int log_statement;
41
42/* Flags for restrict_nonsystem_relation_kind value */
43#define RESTRICT_RELKIND_VIEW 0x01
44#define RESTRICT_RELKIND_FOREIGN_TABLE 0x02
45
47
48extern List *pg_parse_query(const char *query_string);
49extern List *pg_rewrite_query(Query *query);
51 const char *query_string,
52 const Oid *paramTypes, int numParams,
53 QueryEnvironment *queryEnv);
55 const char *query_string,
56 Oid **paramTypes,
57 int *numParams,
58 QueryEnvironment *queryEnv);
60 const char *query_string,
61 ParserSetupHook parserSetup,
62 void *parserSetupArg,
63 QueryEnvironment *queryEnv);
64extern PlannedStmt *pg_plan_query(Query *querytree, const char *query_string,
65 int cursorOptions,
66 ParamListInfo boundParams);
67extern List *pg_plan_queries(List *querytrees, const char *query_string,
68 int cursorOptions,
69 ParamListInfo boundParams);
70
71extern void die(SIGNAL_ARGS);
76extern void ProcessClientReadInterrupt(bool blocked);
77extern void ProcessClientWriteInterrupt(bool blocked);
78
79extern void process_postgres_switches(int argc, char *argv[],
80 GucContext ctx, const char **dbname);
81extern void PostgresSingleUserMain(int argc, char *argv[],
82 const char *username) pg_attribute_noreturn();
83extern void PostgresMain(const char *dbname,
84 const char *username) pg_attribute_noreturn();
85extern void ResetUsage(void);
86extern void ShowUsage(const char *title);
87extern int check_log_duration(char *msec_str, bool was_logged);
88extern void set_debug_options(int debug_flag,
89 GucContext context, GucSource source);
90extern bool set_plan_disabling_options(const char *arg,
91 GucContext context, GucSource source);
92extern const char *get_stats_option_name(const char *arg);
93
94#endif /* TCOPPROT_H */
Datum querytree(PG_FUNCTION_ARGS)
Definition: _int_bool.c:665
#define PGDLLIMPORT
Definition: c.h:1277
#define SIGNAL_ARGS
Definition: c.h:1306
#define pg_attribute_noreturn()
Definition: c.h:239
CommandDest
Definition: dest.h:86
GucSource
Definition: guc.h:112
GucContext
Definition: guc.h:72
static char * username
Definition: initdb.c:153
void(* ParserSetupHook)(struct ParseState *pstate, void *arg)
Definition: params.h:108
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:50
Definition: pg_list.h:54
PlannedStmt * pg_plan_query(Query *querytree, const char *query_string, int cursorOptions, ParamListInfo boundParams)
Definition: postgres.c:881
List * pg_analyze_and_rewrite_withcb(RawStmt *parsetree, const char *query_string, ParserSetupHook parserSetup, void *parserSetupArg, QueryEnvironment *queryEnv)
Definition: postgres.c:757
List * pg_parse_query(const char *query_string)
Definition: postgres.c:602
void process_postgres_switches(int argc, char *argv[], GucContext ctx, const char **dbname)
Definition: postgres.c:3752
PGDLLIMPORT int PostAuthDelay
Definition: postgres.c:98
PGDLLIMPORT int restrict_nonsystem_relation_kind
Definition: postgres.c:104
void FloatExceptionHandler(SIGNAL_ARGS) pg_attribute_noreturn()
Definition: postgres.c:3048
List * pg_plan_queries(List *querytrees, const char *query_string, int cursorOptions, ParamListInfo boundParams)
Definition: postgres.c:969
void set_debug_options(int debug_flag, GucContext context, GucSource source)
Definition: postgres.c:3641
PGDLLIMPORT const char * debug_query_string
Definition: postgres.c:87
void StatementCancelHandler(SIGNAL_ARGS)
Definition: postgres.c:3031
bool set_plan_disabling_options(const char *arg, GucContext context, GucSource source)
Definition: postgres.c:3670
void PostgresMain(const char *dbname, const char *username) pg_attribute_noreturn()
Definition: postgres.c:4146
List * pg_analyze_and_rewrite_fixedparams(RawStmt *parsetree, const char *query_string, const Oid *paramTypes, int numParams, QueryEnvironment *queryEnv)
Definition: postgres.c:664
int check_log_duration(char *msec_str, bool was_logged)
Definition: postgres.c:2398
const char * get_stats_option_name(const char *arg)
Definition: postgres.c:3712
void HandleRecoveryConflictInterrupt(ProcSignalReason reason)
Definition: postgres.c:3064
List * pg_rewrite_query(Query *query)
Definition: postgres.c:797
LogStmtLevel
Definition: tcopprot.h:32
@ LOGSTMT_NONE
Definition: tcopprot.h:33
@ LOGSTMT_MOD
Definition: tcopprot.h:35
@ LOGSTMT_DDL
Definition: tcopprot.h:34
@ LOGSTMT_ALL
Definition: tcopprot.h:36
void ShowUsage(const char *title)
Definition: postgres.c:4984
void PostgresSingleUserMain(int argc, char *argv[], const char *username) pg_attribute_noreturn()
Definition: postgres.c:4017
PGDLLIMPORT int log_statement
Definition: postgres.c:95
void die(SIGNAL_ARGS)
Definition: postgres.c:3001
void ProcessClientReadInterrupt(bool blocked)
Definition: postgres.c:500
void ProcessClientWriteInterrupt(bool blocked)
Definition: postgres.c:546
void ResetUsage(void)
Definition: postgres.c:4977
void quickdie(SIGNAL_ARGS) pg_attribute_noreturn()
Definition: postgres.c:2904
PGDLLIMPORT bool Log_disconnections
Definition: postgres.c:93
PGDLLIMPORT CommandDest whereToSendOutput
Definition: postgres.c:90
PGDLLIMPORT int client_connection_check_interval
Definition: postgres.c:101
List * pg_analyze_and_rewrite_varparams(RawStmt *parsetree, const char *query_string, Oid **paramTypes, int *numParams, QueryEnvironment *queryEnv)
Definition: postgres.c:703