]> granicus.if.org Git - postgresql/blob - src/include/tcop/tcopprot.h
Rearrange snapshot handling to make rule expansion more consistent.
[postgresql] / src / include / tcop / tcopprot.h
1 /*-------------------------------------------------------------------------
2  *
3  * tcopprot.h
4  *        prototypes for postgres.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2011, 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 "executor/execdesc.h"
23 #include "nodes/parsenodes.h"
24 #include "storage/procsignal.h"
25 #include "utils/guc.h"
26
27
28 /* Required daylight between max_stack_depth and the kernel limit, in bytes */
29 #define STACK_DEPTH_SLOP (512 * 1024L)
30
31 extern CommandDest whereToSendOutput;
32 extern PGDLLIMPORT const char *debug_query_string;
33 extern int      max_stack_depth;
34 extern int      PostAuthDelay;
35
36 /* GUC-configurable parameters */
37
38 typedef enum
39 {
40         LOGSTMT_NONE,                           /* log no statements */
41         LOGSTMT_DDL,                            /* log data definition statements */
42         LOGSTMT_MOD,                            /* log modification statements, plus DDL */
43         LOGSTMT_ALL                                     /* log all statements */
44 } LogStmtLevel;
45
46 extern int      log_statement;
47
48 extern List *pg_parse_query(const char *query_string);
49 extern List *pg_analyze_and_rewrite(Node *parsetree, const char *query_string,
50                                            Oid *paramTypes, int numParams);
51 extern List *pg_analyze_and_rewrite_params(Node *parsetree,
52                                                           const char *query_string,
53                                                           ParserSetupHook parserSetup,
54                                                           void *parserSetupArg);
55 extern PlannedStmt *pg_plan_query(Query *querytree, int cursorOptions,
56                           ParamListInfo boundParams);
57 extern List *pg_plan_queries(List *querytrees, int cursorOptions,
58                                 ParamListInfo boundParams);
59
60 extern bool assign_max_stack_depth(int newval, bool doit, GucSource source);
61
62 extern void die(SIGNAL_ARGS);
63 extern void quickdie(SIGNAL_ARGS);
64 extern void StatementCancelHandler(SIGNAL_ARGS);
65 extern void FloatExceptionHandler(SIGNAL_ARGS);
66 extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1
67                                                                                                                                  * handler */
68 extern void prepare_for_client_read(void);
69 extern void client_read_ended(void);
70 extern const char *process_postgres_switches(int argc, char *argv[],
71                                                   GucContext ctx);
72 extern int      PostgresMain(int argc, char *argv[], const char *username);
73 extern long get_stack_depth_rlimit(void);
74 extern void ResetUsage(void);
75 extern void ShowUsage(const char *title);
76 extern int      check_log_duration(char *msec_str, bool was_logged);
77 extern void set_debug_options(int debug_flag,
78                                   GucContext context, GucSource source);
79 extern bool set_plan_disabling_options(const char *arg,
80                                                    GucContext context, GucSource source);
81 extern const char *get_stats_option_name(const char *arg);
82
83 #endif   /* TCOPPROT_H */