]> granicus.if.org Git - postgresql/blobdiff - src/include/tcop/tcopprot.h
Change representation of statement lists, and add statement location info.
[postgresql] / src / include / tcop / tcopprot.h
index ae909eb8af51ccbd41f2f124ef93941b127180fc..1958be85b72019e985c2de5b93fca32a907a744b 100644 (file)
@@ -4,10 +4,10 @@
  *       prototypes for postgres.c.
  *
  *
- * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: tcopprot.h,v 1.50 2002/10/14 23:49:20 tgl Exp $
+ * src/include/tcop/tcopprot.h
  *
  * OLD COMMENTS
  *       This file was created so that other c files could get the two
 #ifndef TCOPPROT_H
 #define TCOPPROT_H
 
-#include <setjmp.h>
+#include "nodes/params.h"
+#include "nodes/parsenodes.h"
+#include "nodes/plannodes.h"
+#include "storage/procsignal.h"
+#include "utils/guc.h"
 
-#include "executor/execdesc.h"
-#include "lib/stringinfo.h"
-#include "tcop/dest.h"
 
+/* Required daylight between max_stack_depth and the kernel limit, in bytes */
+#define STACK_DEPTH_SLOP (512 * 1024L)
 
-extern DLLIMPORT sigjmp_buf Warn_restart;
-extern bool Warn_restart_ready;
-extern bool InError;
 extern CommandDest whereToSendOutput;
-extern bool HostnameLookup;
-extern bool ShowPortNumber;
+extern PGDLLIMPORT const char *debug_query_string;
+extern int     max_stack_depth;
+extern int     PostAuthDelay;
 
-#ifndef BOOTSTRAP_INCLUDE
+/* GUC-configurable parameters */
 
-extern List *pg_parse_query(StringInfo query_string, Oid *typev, int nargs);
-extern List *pg_analyze_and_rewrite(Node *parsetree);
-extern List *pg_parse_and_rewrite(char *query_string,
-                                        Oid *typev, int nargs);
-extern Plan *pg_plan_query(Query *querytree);
-extern void pg_exec_query_string(StringInfo query_string,
-                                        CommandDest dest,
-                                        MemoryContext parse_context);
+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;
 
-#endif   /* BOOTSTRAP_INCLUDE */
+extern int     log_statement;
+
+extern List *pg_parse_query(const char *query_string);
+extern List *pg_analyze_and_rewrite(RawStmt *parsetree,
+                                          const char *query_string,
+                                          Oid *paramTypes, int numParams);
+extern List *pg_analyze_and_rewrite_params(RawStmt *parsetree,
+                                                         const char *query_string,
+                                                         ParserSetupHook parserSetup,
+                                                         void *parserSetupArg);
+extern PlannedStmt *pg_plan_query(Query *querytree, int cursorOptions,
+                         ParamListInfo boundParams);
+extern List *pg_plan_queries(List *querytrees, 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);
-extern void authdie(SIGNAL_ARGS);
-extern int     PostgresMain(int argc, char *argv[], const char *username);
+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 */