summaryrefslogtreecommitdiffstats
path: root/src/include/tcop/cmdtag.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/tcop/cmdtag.h')
-rw-r--r--src/include/tcop/cmdtag.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/include/tcop/cmdtag.h b/src/include/tcop/cmdtag.h
new file mode 100644
index 0000000..f75a91e
--- /dev/null
+++ b/src/include/tcop/cmdtag.h
@@ -0,0 +1,58 @@
+/*-------------------------------------------------------------------------
+ *
+ * cmdtag.h
+ * Declarations for commandtag names and enumeration.
+ *
+ * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/tcop/cmdtag.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef CMDTAG_H
+#define CMDTAG_H
+
+
+#define PG_CMDTAG(tag, name, evtrgok, rwrok, rowcnt) \
+ tag,
+
+typedef enum CommandTag
+{
+#include "tcop/cmdtaglist.h"
+ COMMAND_TAG_NEXTTAG
+} CommandTag;
+
+#undef PG_CMDTAG
+
+typedef struct QueryCompletion
+{
+ CommandTag commandTag;
+ uint64 nprocessed;
+} QueryCompletion;
+
+
+static inline void
+SetQueryCompletion(QueryCompletion *qc, CommandTag commandTag,
+ uint64 nprocessed)
+{
+ qc->commandTag = commandTag;
+ qc->nprocessed = nprocessed;
+}
+
+static inline void
+CopyQueryCompletion(QueryCompletion *dst, const QueryCompletion *src)
+{
+ dst->commandTag = src->commandTag;
+ dst->nprocessed = src->nprocessed;
+}
+
+
+extern void InitializeQueryCompletion(QueryCompletion *qc);
+extern const char *GetCommandTagName(CommandTag commandTag);
+extern bool command_tag_display_rowcount(CommandTag commandTag);
+extern bool command_tag_event_trigger_ok(CommandTag commandTag);
+extern bool command_tag_table_rewrite_ok(CommandTag commandTag);
+extern CommandTag GetCommandTagEnum(const char *tagname);
+
+#endif /* CMDTAG_H */