Header And Logo

PostgreSQL
| The world's most advanced open source database.

tcopprot.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * tcopprot.h
00004  *    prototypes for postgres.c.
00005  *
00006  *
00007  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00008  * Portions Copyright (c) 1994, Regents of the University of California
00009  *
00010  * src/include/tcop/tcopprot.h
00011  *
00012  * OLD COMMENTS
00013  *    This file was created so that other c files could get the two
00014  *    function prototypes without having to include tcop.h which single
00015  *    handedly includes the whole f*cking tree -- mer 5 Nov. 1991
00016  *
00017  *-------------------------------------------------------------------------
00018  */
00019 #ifndef TCOPPROT_H
00020 #define TCOPPROT_H
00021 
00022 #include "nodes/params.h"
00023 #include "nodes/parsenodes.h"
00024 #include "nodes/plannodes.h"
00025 #include "storage/procsignal.h"
00026 #include "utils/guc.h"
00027 
00028 
00029 /* Required daylight between max_stack_depth and the kernel limit, in bytes */
00030 #define STACK_DEPTH_SLOP (512 * 1024L)
00031 
00032 extern CommandDest whereToSendOutput;
00033 extern PGDLLIMPORT const char *debug_query_string;
00034 extern int  max_stack_depth;
00035 extern int  PostAuthDelay;
00036 
00037 /* GUC-configurable parameters */
00038 
00039 typedef enum
00040 {
00041     LOGSTMT_NONE,               /* log no statements */
00042     LOGSTMT_DDL,                /* log data definition statements */
00043     LOGSTMT_MOD,                /* log modification statements, plus DDL */
00044     LOGSTMT_ALL                 /* log all statements */
00045 } LogStmtLevel;
00046 
00047 extern int  log_statement;
00048 
00049 extern List *pg_parse_query(const char *query_string);
00050 extern List *pg_analyze_and_rewrite(Node *parsetree, const char *query_string,
00051                        Oid *paramTypes, int numParams);
00052 extern List *pg_analyze_and_rewrite_params(Node *parsetree,
00053                               const char *query_string,
00054                               ParserSetupHook parserSetup,
00055                               void *parserSetupArg);
00056 extern PlannedStmt *pg_plan_query(Query *querytree, int cursorOptions,
00057               ParamListInfo boundParams);
00058 extern List *pg_plan_queries(List *querytrees, int cursorOptions,
00059                 ParamListInfo boundParams);
00060 
00061 extern bool check_max_stack_depth(int *newval, void **extra, GucSource source);
00062 extern void assign_max_stack_depth(int newval, void *extra);
00063 
00064 extern void die(SIGNAL_ARGS);
00065 extern void quickdie(SIGNAL_ARGS) __attribute__((noreturn));
00066 extern void StatementCancelHandler(SIGNAL_ARGS);
00067 extern void FloatExceptionHandler(SIGNAL_ARGS) __attribute__((noreturn));
00068 extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1
00069                                                                  * handler */
00070 extern void prepare_for_client_read(void);
00071 extern void client_read_ended(void);
00072 extern void process_postgres_switches(int argc, char *argv[],
00073                           GucContext ctx, const char **dbname);
00074 extern void PostgresMain(int argc, char *argv[],
00075              const char *dbname,
00076              const char *username) __attribute__((noreturn));
00077 extern long get_stack_depth_rlimit(void);
00078 extern void ResetUsage(void);
00079 extern void ShowUsage(const char *title);
00080 extern int  check_log_duration(char *msec_str, bool was_logged);
00081 extern void set_debug_options(int debug_flag,
00082                   GucContext context, GucSource source);
00083 extern bool set_plan_disabling_options(const char *arg,
00084                            GucContext context, GucSource source);
00085 extern const char *get_stats_option_name(const char *arg);
00086 
00087 #endif   /* TCOPPROT_H */