]> granicus.if.org Git - postgresql/blob - src/include/tcop/tcopprot.h
Tweak the behavior of log_duration as proposed by Guillaume Smet: rather
[postgresql] / src / include / tcop / tcopprot.h
1 /*-------------------------------------------------------------------------
2  *
3  * tcopprot.h
4  *        prototypes for postgres.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2006, 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.83 2006/09/08 15:55:53 tgl 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 "utils/guc.h"
24
25
26 extern CommandDest whereToSendOutput;
27 extern DLLIMPORT const char *debug_query_string;
28 extern int      max_stack_depth;
29 extern int      PostAuthDelay;
30
31 /* GUC-configurable parameters */
32
33 typedef enum
34 {
35         LOGSTMT_NONE,                           /* log no statements */
36         LOGSTMT_DDL,                            /* log data definition statements */
37         LOGSTMT_MOD,                            /* log modification statements, plus DDL */
38         LOGSTMT_ALL                                     /* log all statements */
39 } LogStmtLevel;
40
41 extern LogStmtLevel log_statement;
42
43 #ifndef BOOTSTRAP_INCLUDE
44
45 extern List *pg_parse_and_rewrite(const char *query_string,
46                                          Oid *paramTypes, int numParams);
47 extern List *pg_parse_query(const char *query_string);
48 extern List *pg_analyze_and_rewrite(Node *parsetree, const char *query_string,
49                                            Oid *paramTypes, int numParams);
50 extern Plan *pg_plan_query(Query *querytree, ParamListInfo boundParams);
51 extern List *pg_plan_queries(List *querytrees, ParamListInfo boundParams,
52                                 bool needSnapshot);
53
54 extern bool assign_max_stack_depth(int newval, bool doit, GucSource source);
55 #endif   /* BOOTSTRAP_INCLUDE */
56
57 extern void die(SIGNAL_ARGS);
58 extern void quickdie(SIGNAL_ARGS);
59 extern void authdie(SIGNAL_ARGS);
60 extern void StatementCancelHandler(SIGNAL_ARGS);
61 extern void FloatExceptionHandler(SIGNAL_ARGS);
62 extern void prepare_for_client_read(void);
63 extern void client_read_ended(void);
64 extern int      PostgresMain(int argc, char *argv[], const char *username);
65 extern void ResetUsage(void);
66 extern void ShowUsage(const char *title);
67 extern int      check_log_duration(char *msec_str, bool was_logged);
68 extern void set_debug_options(int debug_flag,
69                                   GucContext context, GucSource source);
70 extern bool set_plan_disabling_options(const char *arg,
71                                                                           GucContext context, GucSource source);
72 extern const char *get_stats_option_name(const char *arg);
73
74 #endif   /* TCOPPROT_H */