PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cmdtag.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * cmdtag.h
4 * Declarations for commandtag names and enumeration.
5 *
6 * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
8 *
9 * src/include/tcop/cmdtag.h
10 *
11 *-------------------------------------------------------------------------
12 */
13#ifndef CMDTAG_H
14#define CMDTAG_H
15
16/* buffer size required for command completion tags */
17#define COMPLETION_TAG_BUFSIZE 64
18
19#define PG_CMDTAG(tag, name, evtrgok, rwrok, rowcnt) \
20 tag,
21
22typedef enum CommandTag
23{
24#include "tcop/cmdtaglist.h"
26
27#undef PG_CMDTAG
28
29typedef struct QueryCompletion
30{
34
35
36static inline void
38 uint64 nprocessed)
39{
40 qc->commandTag = commandTag;
41 qc->nprocessed = nprocessed;
42}
43
44static inline void
46{
47 dst->commandTag = src->commandTag;
48 dst->nprocessed = src->nprocessed;
49}
50
51
53extern const char *GetCommandTagName(CommandTag commandTag);
54extern const char *GetCommandTagNameAndLen(CommandTag commandTag, Size *len);
55extern bool command_tag_display_rowcount(CommandTag commandTag);
56extern bool command_tag_event_trigger_ok(CommandTag commandTag);
57extern bool command_tag_table_rewrite_ok(CommandTag commandTag);
58extern CommandTag GetCommandTagEnum(const char *commandname);
59extern Size BuildQueryCompletionString(char *buff, const QueryCompletion *qc,
60 bool nameonly);
61
62#endif /* CMDTAG_H */
uint64_t uint64
Definition: c.h:486
size_t Size
Definition: c.h:559
const char * GetCommandTagNameAndLen(CommandTag commandTag, Size *len)
Definition: cmdtag.c:53
void InitializeQueryCompletion(QueryCompletion *qc)
Definition: cmdtag.c:40
const char * GetCommandTagName(CommandTag commandTag)
Definition: cmdtag.c:47
struct QueryCompletion QueryCompletion
static void SetQueryCompletion(QueryCompletion *qc, CommandTag commandTag, uint64 nprocessed)
Definition: cmdtag.h:37
static void CopyQueryCompletion(QueryCompletion *dst, const QueryCompletion *src)
Definition: cmdtag.h:45
CommandTag GetCommandTagEnum(const char *commandname)
Definition: cmdtag.c:83
bool command_tag_event_trigger_ok(CommandTag commandTag)
Definition: cmdtag.c:66
CommandTag
Definition: cmdtag.h:23
bool command_tag_table_rewrite_ok(CommandTag commandTag)
Definition: cmdtag.c:72
bool command_tag_display_rowcount(CommandTag commandTag)
Definition: cmdtag.c:60
Size BuildQueryCompletionString(char *buff, const QueryCompletion *qc, bool nameonly)
Definition: cmdtag.c:121
const void size_t len
uint64 nprocessed
Definition: cmdtag.h:32
CommandTag commandTag
Definition: cmdtag.h:31