PostgreSQL Source Code  git master
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-2019, 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_QUERY_NONATOMIC, /* a complete query, nonatomic
24  * execution context */
25  PROCESS_UTILITY_SUBCOMMAND /* a portion of a query */
27 
28 /* Hook for plugins to get control in ProcessUtility() */
29 typedef void (*ProcessUtility_hook_type) (PlannedStmt *pstmt,
30  const char *queryString, ProcessUtilityContext context,
31  ParamListInfo params,
32  QueryEnvironment *queryEnv,
33  DestReceiver *dest, char *completionTag);
35 
36 extern void ProcessUtility(PlannedStmt *pstmt, const char *queryString,
37  ProcessUtilityContext context, ParamListInfo params,
38  QueryEnvironment *queryEnv,
39  DestReceiver *dest, char *completionTag);
40 extern void standard_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
41  ProcessUtilityContext context, ParamListInfo params,
42  QueryEnvironment *queryEnv,
43  DestReceiver *dest, char *completionTag);
44 
45 extern bool UtilityReturnsTuples(Node *parsetree);
46 
47 extern TupleDesc UtilityTupleDescriptor(Node *parsetree);
48 
49 extern Query *UtilityContainsQuery(Node *parsetree);
50 
51 extern const char *CreateCommandTag(Node *parsetree);
52 
53 extern LogStmtLevel GetCommandLogLevel(Node *parsetree);
54 
55 extern bool CommandIsReadOnly(PlannedStmt *pstmt);
56 
57 #endif /* UTILITY_H */
bool UtilityReturnsTuples(Node *parsetree)
Definition: utility.c:1757
LogStmtLevel
Definition: tcopprot.h:35
TupleDesc UtilityTupleDescriptor(Node *parsetree)
Definition: utility.c:1813
LogStmtLevel GetCommandLogLevel(Node *parsetree)
Definition: utility.c:2964
Definition: nodes.h:525
ProcessUtilityContext
Definition: utility.h:19
bool CommandIsReadOnly(PlannedStmt *pstmt)
Definition: utility.c:99
#define PGDLLIMPORT
Definition: c.h:1266
void(* ProcessUtility_hook_type)(PlannedStmt *pstmt, const char *queryString, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, char *completionTag)
Definition: utility.h:29
void standard_ProcessUtility(PlannedStmt *pstmt, const char *queryString, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, char *completionTag)
Definition: utility.c:376
PGDLLIMPORT ProcessUtility_hook_type ProcessUtility_hook
Definition: utility.c:75
Query * UtilityContainsQuery(Node *parsetree)
Definition: utility.c:1907
const char * CreateCommandTag(Node *parsetree)
Definition: utility.c:2093
void ProcessUtility(PlannedStmt *pstmt, const char *queryString, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, char *completionTag)
Definition: utility.c:337