]> granicus.if.org Git - postgresql/blob - src/include/tcop/tcopprot.h
Rename DLLIMPORT macro to PGDLLIMPORT to avoid conflict with
[postgresql] / src / include / tcop / tcopprot.h
1 /*-------------------------------------------------------------------------
2  *
3  * tcopprot.h
4  *        prototypes for postgres.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * $PostgreSQL: pgsql/src/include/tcop/tcopprot.h,v 1.90 2007/07/25 12:22:54 mha Exp $
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 "utils/guc.h"
25
26
27 /* Required daylight between max_stack_depth and the kernel limit, in bytes */
28 #define STACK_DEPTH_SLOP (512 * 1024L)
29
30 extern CommandDest whereToSendOutput;
31 extern PGDLLIMPORT const char *debug_query_string;
32 extern int      max_stack_depth;
33 extern int      PostAuthDelay;
34
35 /* GUC-configurable parameters */
36
37 typedef enum
38 {
39         LOGSTMT_NONE,                           /* log no statements */
40         LOGSTMT_DDL,                            /* log data definition statements */
41         LOGSTMT_MOD,                            /* log modification statements, plus DDL */
42         LOGSTMT_ALL                                     /* log all statements */
43 } LogStmtLevel;
44
45 extern LogStmtLevel log_statement;
46
47 extern List *pg_parse_and_rewrite(const char *query_string,
48                                          Oid *paramTypes, int numParams);
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 PlannedStmt *pg_plan_query(Query *querytree, int cursorOptions,
53                                                                   ParamListInfo boundParams);
54 extern List *pg_plan_queries(List *querytrees, int cursorOptions,
55                                                          ParamListInfo boundParams, bool needSnapshot);
56
57 extern bool assign_max_stack_depth(int newval, bool doit, GucSource source);
58
59 extern void die(SIGNAL_ARGS);
60 extern void quickdie(SIGNAL_ARGS);
61 extern void authdie(SIGNAL_ARGS);
62 extern void StatementCancelHandler(SIGNAL_ARGS);
63 extern void FloatExceptionHandler(SIGNAL_ARGS);
64 extern void prepare_for_client_read(void);
65 extern void client_read_ended(void);
66 extern int      PostgresMain(int argc, char *argv[], const char *username);
67 extern long get_stack_depth_rlimit(void);
68 extern void ResetUsage(void);
69 extern void ShowUsage(const char *title);
70 extern int      check_log_duration(char *msec_str, bool was_logged);
71 extern void set_debug_options(int debug_flag,
72                                   GucContext context, GucSource source);
73 extern bool set_plan_disabling_options(const char *arg,
74                                                    GucContext context, GucSource source);
75 extern const char *get_stats_option_name(const char *arg);
76
77 #endif   /* TCOPPROT_H */