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-2018, 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 execution context */
24  PROCESS_UTILITY_SUBCOMMAND /* a portion of a query */
26 
27 /* Hook for plugins to get control in ProcessUtility() */
28 typedef void (*ProcessUtility_hook_type) (PlannedStmt *pstmt,
29  const char *queryString, ProcessUtilityContext context,
30  ParamListInfo params,
31  QueryEnvironment *queryEnv,
32  DestReceiver *dest, char *completionTag);
34 
35 extern void ProcessUtility(PlannedStmt *pstmt, const char *queryString,
36  ProcessUtilityContext context, ParamListInfo params,
37  QueryEnvironment *queryEnv,
38  DestReceiver *dest, char *completionTag);
39 extern void standard_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
40  ProcessUtilityContext context, ParamListInfo params,
41  QueryEnvironment *queryEnv,
42  DestReceiver *dest, char *completionTag);
43 
44 extern bool UtilityReturnsTuples(Node *parsetree);
45 
46 extern TupleDesc UtilityTupleDescriptor(Node *parsetree);
47 
48 extern Query *UtilityContainsQuery(Node *parsetree);
49 
50 extern const char *CreateCommandTag(Node *parsetree);
51 
52 extern LogStmtLevel GetCommandLogLevel(Node *parsetree);
53 
54 extern bool CommandIsReadOnly(PlannedStmt *pstmt);
55 
56 #endif /* UTILITY_H */
bool UtilityReturnsTuples(Node *parsetree)
Definition: utility.c:1729
LogStmtLevel
Definition: tcopprot.h:40
TupleDesc UtilityTupleDescriptor(Node *parsetree)
Definition: utility.c:1779
LogStmtLevel GetCommandLogLevel(Node *parsetree)
Definition: utility.c:2916
Definition: nodes.h:517
ProcessUtilityContext
Definition: utility.h:19
bool CommandIsReadOnly(PlannedStmt *pstmt)
Definition: utility.c:99
#define PGDLLIMPORT
Definition: c.h:1105
void(* ProcessUtility_hook_type)(PlannedStmt *pstmt, const char *queryString, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, char *completionTag)
Definition: utility.h:28
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:1870
const char * CreateCommandTag(Node *parsetree)
Definition: utility.c:2056
void ProcessUtility(PlannedStmt *pstmt, const char *queryString, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, char *completionTag)
Definition: utility.c:337