]> granicus.if.org Git - postgresql/blob - src/include/tcop/tcopprot.h
When using extended-query protocol, postpone planning of unnamed statements
[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.67 2004/06/11 01:09:22 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 <setjmp.h>
23
24 #include "executor/execdesc.h"
25 #include "nodes/params.h"
26 #include "tcop/dest.h"
27 #include "utils/guc.h"
28
29
30 extern DLLIMPORT sigjmp_buf Warn_restart;
31 extern bool Warn_restart_ready;
32 extern bool InError;
33 extern CommandDest whereToSendOutput;
34 extern DLLIMPORT const char *debug_query_string;
35 extern int      max_stack_depth;
36 extern bool in_fatal_exit;
37
38 /* GUC-configurable parameters */
39
40 typedef enum
41 {
42         /* Reverse order so GUC USERLIMIT is easier */
43         LOGSTMT_ALL,                            /* log all statements */
44         LOGSTMT_DDL,                            /* log data definition statements */
45         LOGSTMT_MOD,                            /* log modification statements, plus DDL */
46         LOGSTMT_NONE                            /* log no statements */
47 } LogStmtLevel;
48
49 extern LogStmtLevel log_statement;
50
51 #ifndef BOOTSTRAP_INCLUDE
52
53 extern List *pg_parse_and_rewrite(const char *query_string,
54                                          Oid *paramTypes, int numParams);
55 extern List *pg_parse_query(const char *query_string);
56 extern List *pg_analyze_and_rewrite(Node *parsetree,
57                                            Oid *paramTypes, int numParams);
58 extern List *pg_rewrite_queries(List *querytree_list);
59 extern Plan *pg_plan_query(Query *querytree, ParamListInfo boundParams);
60 extern List *pg_plan_queries(List *querytrees, ParamListInfo boundParams,
61                                                          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 */