1 /*-------------------------------------------------------------------------
4 * prototypes for postgres.c.
7 * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/tcop/tcopprot.h
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
17 *-------------------------------------------------------------------------
22 #include "executor/execdesc.h"
23 #include "nodes/parsenodes.h"
24 #include "storage/procsignal.h"
25 #include "utils/guc.h"
28 /* Required daylight between max_stack_depth and the kernel limit, in bytes */
29 #define STACK_DEPTH_SLOP (512 * 1024L)
31 extern CommandDest whereToSendOutput;
32 extern PGDLLIMPORT const char *debug_query_string;
33 extern int max_stack_depth;
34 extern int PostAuthDelay;
36 /* GUC-configurable parameters */
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 */
46 extern int log_statement;
48 extern List *pg_parse_query(const char *query_string);
49 extern List *pg_analyze_and_rewrite(Node *parsetree, const char *query_string,
50 Oid *paramTypes, int numParams);
51 extern List *pg_analyze_and_rewrite_params(Node *parsetree,
52 const char *query_string,
53 ParserSetupHook parserSetup,
54 void *parserSetupArg);
55 extern PlannedStmt *pg_plan_query(Query *querytree, int cursorOptions,
56 ParamListInfo boundParams);
57 extern List *pg_plan_queries(List *querytrees, int cursorOptions,
58 ParamListInfo boundParams);
60 extern bool assign_max_stack_depth(int newval, bool doit, GucSource source);
62 extern void die(SIGNAL_ARGS);
63 extern void quickdie(SIGNAL_ARGS);
64 extern void StatementCancelHandler(SIGNAL_ARGS);
65 extern void FloatExceptionHandler(SIGNAL_ARGS);
66 extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1
68 extern void prepare_for_client_read(void);
69 extern void client_read_ended(void);
70 extern const char *process_postgres_switches(int argc, char *argv[],
72 extern int PostgresMain(int argc, char *argv[], const char *username);
73 extern long get_stack_depth_rlimit(void);
74 extern void ResetUsage(void);
75 extern void ShowUsage(const char *title);
76 extern int check_log_duration(char *msec_str, bool was_logged);
77 extern void set_debug_options(int debug_flag,
78 GucContext context, GucSource source);
79 extern bool set_plan_disabling_options(const char *arg,
80 GucContext context, GucSource source);
81 extern const char *get_stats_option_name(const char *arg);
83 #endif /* TCOPPROT_H */