tcopprot.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*-------------------------------------------------------------------------
  2. *
  3. * tcopprot.h
  4. * prototypes for postgres.c.
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
  8. * Portions Copyright (c) 1994, Regents of the University of California
  9. *
  10. * src/include/tcop/tcopprot.h
  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. #include "nodes/params.h"
  22. #include "nodes/parsenodes.h"
  23. #include "nodes/plannodes.h"
  24. #include "storage/procsignal.h"
  25. #include "utils/guc.h"
  26. /* Required daylight between max_stack_depth and the kernel limit, in bytes */
  27. #define STACK_DEPTH_SLOP (512 * 1024L)
  28. extern CommandDest whereToSendOutput;
  29. extern PGDLLIMPORT const char *debug_query_string;
  30. extern int max_stack_depth;
  31. extern int PostAuthDelay;
  32. /* GUC-configurable parameters */
  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. extern int log_statement;
  41. extern List *pg_parse_query(const char *query_string);
  42. extern List *pg_analyze_and_rewrite(Node *parsetree, const char *query_string,
  43. Oid *paramTypes, int numParams);
  44. extern List *pg_analyze_and_rewrite_params(Node *parsetree,
  45. const char *query_string,
  46. ParserSetupHook parserSetup,
  47. void *parserSetupArg);
  48. extern PlannedStmt *pg_plan_query(Query *querytree, int cursorOptions,
  49. ParamListInfo boundParams);
  50. extern List *pg_plan_queries(List *querytrees, int cursorOptions,
  51. ParamListInfo boundParams);
  52. extern bool check_max_stack_depth(int *newval, void **extra, GucSource source);
  53. extern void assign_max_stack_depth(int newval, void *extra);
  54. extern void die(SIGNAL_ARGS);
  55. extern void quickdie(SIGNAL_ARGS) pg_attribute_noreturn();
  56. extern void StatementCancelHandler(SIGNAL_ARGS);
  57. extern void FloatExceptionHandler(SIGNAL_ARGS) pg_attribute_noreturn();
  58. extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1
  59. * handler */
  60. extern void ProcessClientReadInterrupt(bool blocked);
  61. extern void ProcessClientWriteInterrupt(bool blocked);
  62. extern void process_postgres_switches(int argc, char *argv[],
  63. GucContext ctx, const char **dbname);
  64. extern void PostgresMain(int argc, char *argv[],
  65. const char *dbname,
  66. const char *username) pg_attribute_noreturn();
  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. #endif /* TCOPPROT_H */