PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
utility.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * utility.h
4  * prototypes for utility.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2017, 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 
17 #include "tcop/tcopprot.h"
18 
19 typedef enum
20 {
21  PROCESS_UTILITY_TOPLEVEL, /* toplevel interactive command */
22  PROCESS_UTILITY_QUERY, /* a complete query, but not toplevel */
23  PROCESS_UTILITY_SUBCOMMAND /* a portion of a query */
25 
26 /* Hook for plugins to get control in ProcessUtility() */
27 typedef void (*ProcessUtility_hook_type) (PlannedStmt *pstmt,
28  const char *queryString, ProcessUtilityContext context,
29  ParamListInfo params,
30  QueryEnvironment *queryEnv,
31  DestReceiver *dest, char *completionTag);
33 
34 extern void ProcessUtility(PlannedStmt *pstmt, const char *queryString,
35  ProcessUtilityContext context, ParamListInfo params,
36  QueryEnvironment *queryEnv,
37  DestReceiver *dest, char *completionTag);
38 extern void standard_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
39  ProcessUtilityContext context, ParamListInfo params,
40  QueryEnvironment *queryEnv,
41  DestReceiver *dest, char *completionTag);
42 
43 extern bool UtilityReturnsTuples(Node *parsetree);
44 
45 extern TupleDesc UtilityTupleDescriptor(Node *parsetree);
46 
47 extern Query *UtilityContainsQuery(Node *parsetree);
48 
49 extern const char *CreateCommandTag(Node *parsetree);
50 
51 extern LogStmtLevel GetCommandLogLevel(Node *parsetree);
52 
53 extern bool CommandIsReadOnly(PlannedStmt *pstmt);
54 
55 #endif /* UTILITY_H */
bool UtilityReturnsTuples(Node *parsetree)
Definition: utility.c:1714
LogStmtLevel
Definition: tcopprot.h:40
TupleDesc UtilityTupleDescriptor(Node *parsetree)
Definition: utility.c:1764
void(* ProcessUtility_hook_type)(PlannedStmt *pstmt, const char *queryString, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, char *completionTag)
Definition: utility.h:27
LogStmtLevel GetCommandLogLevel(Node *parsetree)
Definition: utility.c:2869
Definition: nodes.h:509
ProcessUtilityContext
Definition: utility.h:19
bool CommandIsReadOnly(PlannedStmt *pstmt)
Definition: utility.c:97
#define PGDLLIMPORT
Definition: c.h:1063
void standard_ProcessUtility(PlannedStmt *pstmt, const char *queryString, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, char *completionTag)
Definition: utility.c:374
PGDLLIMPORT ProcessUtility_hook_type ProcessUtility_hook
Definition: utility.c:73
Query * UtilityContainsQuery(Node *parsetree)
Definition: utility.c:1855
const char * CreateCommandTag(Node *parsetree)
Definition: utility.c:2035
void ProcessUtility(PlannedStmt *pstmt, const char *queryString, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, char *completionTag)
Definition: utility.c:335