]> granicus.if.org Git - postgresql/blob - src/include/tcop/tcopprot.h
Exit backend from SIGTERM or FATAL by simulating client EOF, rather than
[postgresql] / src / include / tcop / tcopprot.h
1 /*-------------------------------------------------------------------------
2  *
3  * tcopprot.h
4  *        prototypes for postgres.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2003, 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.65 2004/04/11 00:54:45 momjian 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 <setjmp.h>
23
24 #include "executor/execdesc.h"
25 #include "tcop/dest.h"
26 #include "utils/guc.h"
27
28
29 extern DLLIMPORT sigjmp_buf Warn_restart;
30 extern bool Warn_restart_ready;
31 extern bool InError;
32 extern CommandDest whereToSendOutput;
33 extern bool log_hostname;
34 extern DLLIMPORT const char *debug_query_string;
35 extern char *rendezvous_name;
36 extern int      max_stack_depth;
37 extern bool in_fatal_exit;
38
39 /* GUC-configurable parameters */
40
41 typedef enum
42 {
43         /* Reverse order so GUC USERLIMIT is easier */
44         LOGSTMT_ALL,                            /* log all statements */
45         LOGSTMT_DDL,                            /* log data definition statements */
46         LOGSTMT_MOD,                            /* log modification statements, plus DDL */
47         LOGSTMT_NONE                            /* log no statements */
48 } LogStmtLevel;
49
50 extern LogStmtLevel log_statement;
51
52 #ifndef BOOTSTRAP_INCLUDE
53
54 extern List *pg_parse_and_rewrite(const char *query_string,
55                                          Oid *paramTypes, int numParams);
56 extern List *pg_parse_query(const char *query_string);
57 extern List *pg_analyze_and_rewrite(Node *parsetree,
58                                            Oid *paramTypes, int numParams);
59 extern List *pg_rewrite_queries(List *querytree_list);
60 extern Plan *pg_plan_query(Query *querytree);
61 extern List *pg_plan_queries(List *querytrees, bool needSnapshot);
62
63 extern bool assign_max_stack_depth(int newval, bool doit, GucSource source);
64
65 #endif   /* BOOTSTRAP_INCLUDE */
66
67 extern void die(SIGNAL_ARGS);
68 extern void quickdie(SIGNAL_ARGS);
69 extern void authdie(SIGNAL_ARGS);
70 extern int      PostgresMain(int argc, char *argv[], const char *username);
71 extern void ResetUsage(void);
72 extern void ShowUsage(const char *title);
73
74 #endif   /* TCOPPROT_H */