]> granicus.if.org Git - postgresql/blob - src/include/tcop/tcopprot.h
Stamp copyrights for year 2011.
[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_and_rewrite(const char *query_string,
49                                          Oid *paramTypes, int numParams);
50 extern List *pg_parse_query(const char *query_string);
51 extern List *pg_analyze_and_rewrite(Node *parsetree, const char *query_string,
52                                            Oid *paramTypes, int numParams);
53 extern List *pg_analyze_and_rewrite_params(Node *parsetree,
54                                                           const char *query_string,
55                                                           ParserSetupHook parserSetup,
56                                                           void *parserSetupArg);
57 extern PlannedStmt *pg_plan_query(Query *querytree, int cursorOptions,
58                           ParamListInfo boundParams);
59 extern List *pg_plan_queries(List *querytrees, int cursorOptions,
60                                 ParamListInfo boundParams);
61
62 extern bool assign_max_stack_depth(int newval, bool doit, GucSource source);
63
64 extern void die(SIGNAL_ARGS);
65 extern void quickdie(SIGNAL_ARGS);
66 extern void StatementCancelHandler(SIGNAL_ARGS);
67 extern void FloatExceptionHandler(SIGNAL_ARGS);
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 const char *process_postgres_switches(int argc, char *argv[],
73                                                   GucContext ctx);
74 extern int      PostgresMain(int argc, char *argv[], const char *username);
75 extern long get_stack_depth_rlimit(void);
76 extern void ResetUsage(void);
77 extern void ShowUsage(const char *title);
78 extern int      check_log_duration(char *msec_str, bool was_logged);
79 extern void set_debug_options(int debug_flag,
80                                   GucContext context, GucSource source);
81 extern bool set_plan_disabling_options(const char *arg,
82                                                    GucContext context, GucSource source);
83 extern const char *get_stats_option_name(const char *arg);
84
85 #endif   /* TCOPPROT_H */