OSDN Git Service

rebuid:
[eos/hostdependX86MAC64.git] / util / X86MAC64 / include / postgresql / server / tcop / tcopprot.h
1 /*-------------------------------------------------------------------------
2  *
3  * tcopprot.h
4  *        prototypes for postgres.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/tcop/tcopprot.h
11  *
12  * OLD COMMENTS
13  *        This file was created so that other c files could get the two
14  *        function prototypes without having to include tcop.h which single
15  *        handedly includes the whole f*cking tree -- mer 5 Nov. 1991
16  *
17  *-------------------------------------------------------------------------
18  */
19 #ifndef TCOPPROT_H
20 #define TCOPPROT_H
21
22 #include "nodes/params.h"
23 #include "nodes/parsenodes.h"
24 #include "nodes/plannodes.h"
25 #include "storage/procsignal.h"
26 #include "utils/guc.h"
27
28
29 /* Required daylight between max_stack_depth and the kernel limit, in bytes */
30 #define STACK_DEPTH_SLOP (512 * 1024L)
31
32 extern CommandDest whereToSendOutput;
33 extern PGDLLIMPORT const char *debug_query_string;
34 extern int      max_stack_depth;
35 extern int      PostAuthDelay;
36
37 /* GUC-configurable parameters */
38
39 typedef enum
40 {
41         LOGSTMT_NONE,                           /* log no statements */
42         LOGSTMT_DDL,                            /* log data definition statements */
43         LOGSTMT_MOD,                            /* log modification statements, plus DDL */
44         LOGSTMT_ALL                                     /* log all statements */
45 } LogStmtLevel;
46
47 extern int      log_statement;
48
49 extern List *pg_parse_query(const char *query_string);
50 extern List *pg_analyze_and_rewrite(Node *parsetree, const char *query_string,
51                                            Oid *paramTypes, int numParams);
52 extern List *pg_analyze_and_rewrite_params(Node *parsetree,
53                                                           const char *query_string,
54                                                           ParserSetupHook parserSetup,
55                                                           void *parserSetupArg);
56 extern PlannedStmt *pg_plan_query(Query *querytree, int cursorOptions,
57                           ParamListInfo boundParams);
58 extern List *pg_plan_queries(List *querytrees, int cursorOptions,
59                                 ParamListInfo boundParams);
60
61 extern bool check_max_stack_depth(int *newval, void **extra, GucSource source);
62 extern void assign_max_stack_depth(int newval, void *extra);
63
64 extern void die(SIGNAL_ARGS);
65 extern void quickdie(SIGNAL_ARGS) __attribute__((noreturn));
66 extern void StatementCancelHandler(SIGNAL_ARGS);
67 extern void FloatExceptionHandler(SIGNAL_ARGS) __attribute__((noreturn));
68 extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1
69                                                                                                                                  * handler */
70 extern void prepare_for_client_read(void);
71 extern void client_read_ended(void);
72 extern void process_postgres_switches(int argc, char *argv[],
73                                                   GucContext ctx, const char **dbname);
74 extern void PostgresMain(int argc, char *argv[],
75                          const char *dbname,
76                          const char *username) __attribute__((noreturn));
77 extern long get_stack_depth_rlimit(void);
78 extern void ResetUsage(void);
79 extern void ShowUsage(const char *title);
80 extern int      check_log_duration(char *msec_str, bool was_logged);
81 extern void set_debug_options(int debug_flag,
82                                   GucContext context, GucSource source);
83 extern bool set_plan_disabling_options(const char *arg,
84                                                    GucContext context, GucSource source);
85 extern const char *get_stats_option_name(const char *arg);
86
87 #endif   /* TCOPPROT_H */