1 /*-------------------------------------------------------------------------
4 * prototypes for postgres.c.
7 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/tcop/tcopprot.h
12 *-------------------------------------------------------------------------
17 #include "nodes/params.h"
18 #include "nodes/plannodes.h"
19 #include "storage/procsignal.h"
20 #include "utils/guc.h"
21 #include "utils/queryenvironment.h"
24 extern PGDLLIMPORT CommandDest whereToSendOutput
;
25 extern PGDLLIMPORT
const char *debug_query_string
;
26 extern PGDLLIMPORT
int PostAuthDelay
;
27 extern PGDLLIMPORT
int client_connection_check_interval
;
29 /* GUC-configurable parameters */
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 */
39 extern PGDLLIMPORT
bool Log_disconnections
;
40 extern PGDLLIMPORT
int log_statement
;
42 /* Flags for restrict_nonsystem_relation_kind value */
43 #define RESTRICT_RELKIND_VIEW 0x01
44 #define RESTRICT_RELKIND_FOREIGN_TABLE 0x02
46 extern PGDLLIMPORT
int restrict_nonsystem_relation_kind
;
48 extern List
*pg_parse_query(const char *query_string
);
49 extern List
*pg_rewrite_query(Query
*query
);
50 extern List
*pg_analyze_and_rewrite_fixedparams(RawStmt
*parsetree
,
51 const char *query_string
,
52 const Oid
*paramTypes
, int numParams
,
53 QueryEnvironment
*queryEnv
);
54 extern List
*pg_analyze_and_rewrite_varparams(RawStmt
*parsetree
,
55 const char *query_string
,
58 QueryEnvironment
*queryEnv
);
59 extern List
*pg_analyze_and_rewrite_withcb(RawStmt
*parsetree
,
60 const char *query_string
,
61 ParserSetupHook parserSetup
,
63 QueryEnvironment
*queryEnv
);
64 extern PlannedStmt
*pg_plan_query(Query
*querytree
, const char *query_string
,
66 ParamListInfo boundParams
);
67 extern List
*pg_plan_queries(List
*querytrees
, const char *query_string
,
69 ParamListInfo boundParams
);
71 extern void die(SIGNAL_ARGS
);
72 extern void quickdie(SIGNAL_ARGS
) pg_attribute_noreturn();
73 extern void StatementCancelHandler(SIGNAL_ARGS
);
74 extern void FloatExceptionHandler(SIGNAL_ARGS
) pg_attribute_noreturn();
75 extern void HandleRecoveryConflictInterrupt(ProcSignalReason reason
);
76 extern void ProcessClientReadInterrupt(bool blocked
);
77 extern void ProcessClientWriteInterrupt(bool blocked
);
79 extern void process_postgres_switches(int argc
, char *argv
[],
80 GucContext ctx
, const char **dbname
);
81 extern void PostgresSingleUserMain(int argc
, char *argv
[],
82 const char *username
) pg_attribute_noreturn();
83 extern void PostgresMain(const char *dbname
,
84 const char *username
) pg_attribute_noreturn();
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 */