summaryrefslogtreecommitdiffstats
path: root/src/include/tcop/tcopprot.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:15:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:15:05 +0000
commit46651ce6fe013220ed397add242004d764fc0153 (patch)
tree6e5299f990f88e60174a1d3ae6e48eedd2688b2b /src/include/tcop/tcopprot.h
parentInitial commit. (diff)
downloadpostgresql-14-46651ce6fe013220ed397add242004d764fc0153.tar.xz
postgresql-14-46651ce6fe013220ed397add242004d764fc0153.zip
Adding upstream version 14.5.upstream/14.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/include/tcop/tcopprot.h')
-rw-r--r--src/include/tcop/tcopprot.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h
new file mode 100644
index 0000000..9683454
--- /dev/null
+++ b/src/include/tcop/tcopprot.h
@@ -0,0 +1,91 @@
+/*-------------------------------------------------------------------------
+ *
+ * tcopprot.h
+ * prototypes for postgres.c.
+ *
+ *
+ * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/tcop/tcopprot.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef TCOPPROT_H
+#define TCOPPROT_H
+
+#include "nodes/params.h"
+#include "nodes/parsenodes.h"
+#include "nodes/plannodes.h"
+#include "storage/procsignal.h"
+#include "utils/guc.h"
+#include "utils/queryenvironment.h"
+
+
+/* Required daylight between max_stack_depth and the kernel limit, in bytes */
+#define STACK_DEPTH_SLOP (512 * 1024L)
+
+extern CommandDest whereToSendOutput;
+extern PGDLLIMPORT const char *debug_query_string;
+extern int max_stack_depth;
+extern int PostAuthDelay;
+extern int client_connection_check_interval;
+
+/* GUC-configurable parameters */
+
+typedef enum
+{
+ LOGSTMT_NONE, /* log no statements */
+ LOGSTMT_DDL, /* log data definition statements */
+ LOGSTMT_MOD, /* log modification statements, plus DDL */
+ LOGSTMT_ALL /* log all statements */
+} LogStmtLevel;
+
+extern PGDLLIMPORT int log_statement;
+
+extern List *pg_parse_query(const char *query_string);
+extern List *pg_rewrite_query(Query *query);
+extern List *pg_analyze_and_rewrite(RawStmt *parsetree,
+ const char *query_string,
+ Oid *paramTypes, int numParams,
+ QueryEnvironment *queryEnv);
+extern List *pg_analyze_and_rewrite_params(RawStmt *parsetree,
+ const char *query_string,
+ ParserSetupHook parserSetup,
+ void *parserSetupArg,
+ QueryEnvironment *queryEnv);
+extern PlannedStmt *pg_plan_query(Query *querytree, const char *query_string,
+ int cursorOptions,
+ ParamListInfo boundParams);
+extern List *pg_plan_queries(List *querytrees, const char *query_string,
+ int cursorOptions,
+ ParamListInfo boundParams);
+
+extern bool check_max_stack_depth(int *newval, void **extra, GucSource source);
+extern void assign_max_stack_depth(int newval, void *extra);
+
+extern void die(SIGNAL_ARGS);
+extern void quickdie(SIGNAL_ARGS) pg_attribute_noreturn();
+extern void StatementCancelHandler(SIGNAL_ARGS);
+extern void FloatExceptionHandler(SIGNAL_ARGS) pg_attribute_noreturn();
+extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1
+ * handler */
+extern void ProcessClientReadInterrupt(bool blocked);
+extern void ProcessClientWriteInterrupt(bool blocked);
+
+extern void process_postgres_switches(int argc, char *argv[],
+ GucContext ctx, const char **dbname);
+extern void PostgresMain(int argc, char *argv[],
+ const char *dbname,
+ const char *username) pg_attribute_noreturn();
+extern long get_stack_depth_rlimit(void);
+extern void ResetUsage(void);
+extern void ShowUsage(const char *title);
+extern int check_log_duration(char *msec_str, bool was_logged);
+extern void set_debug_options(int debug_flag,
+ GucContext context, GucSource source);
+extern bool set_plan_disabling_options(const char *arg,
+ GucContext context, GucSource source);
+extern const char *get_stats_option_name(const char *arg);
+
+#endif /* TCOPPROT_H */