utility.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*-------------------------------------------------------------------------
  2. *
  3. * utility.h
  4. * prototypes for utility.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/utility.h
  11. *
  12. *-------------------------------------------------------------------------
  13. */
  14. #ifndef UTILITY_H
  15. #define UTILITY_H
  16. #include "tcop/tcopprot.h"
  17. typedef enum
  18. {
  19. PROCESS_UTILITY_TOPLEVEL, /* toplevel interactive command */
  20. PROCESS_UTILITY_QUERY, /* a complete query, but not toplevel */
  21. PROCESS_UTILITY_SUBCOMMAND /* a portion of a query */
  22. } ProcessUtilityContext;
  23. /* Hook for plugins to get control in ProcessUtility() */
  24. typedef void (*ProcessUtility_hook_type) (Node *parsetree,
  25. const char *queryString, ProcessUtilityContext context,
  26. ParamListInfo params,
  27. DestReceiver *dest, char *completionTag);
  28. extern PGDLLIMPORT ProcessUtility_hook_type ProcessUtility_hook;
  29. extern void ProcessUtility(Node *parsetree, const char *queryString,
  30. ProcessUtilityContext context, ParamListInfo params,
  31. DestReceiver *dest, char *completionTag);
  32. extern void standard_ProcessUtility(Node *parsetree, const char *queryString,
  33. ProcessUtilityContext context, ParamListInfo params,
  34. DestReceiver *dest, char *completionTag);
  35. extern bool UtilityReturnsTuples(Node *parsetree);
  36. extern TupleDesc UtilityTupleDescriptor(Node *parsetree);
  37. extern Query *UtilityContainsQuery(Node *parsetree);
  38. extern const char *CreateCommandTag(Node *parsetree);
  39. extern LogStmtLevel GetCommandLogLevel(Node *parsetree);
  40. extern bool CommandIsReadOnly(Node *parsetree);
  41. #endif /* UTILITY_H */