PostgreSQL Source Code: src/backend/tcop/cmdtag.c Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
15
18
19
21{
27
29
30#define PG_CMDTAG(tag, name, evtrgok, rwrok, rowcnt) \
31 { name, (uint8) (sizeof(name) - 1), evtrgok, rwrok, rowcnt },
32
35};
36
37#undef PG_CMDTAG
38
39void
41{
44}
45
46const char *
48{
50}
51
52const char *
54{
57}
58
59bool
61{
63}
64
65bool
67{
69}
70
71bool
73{
75}
76
77
78
79
80
81
84{
86 *last,
87 *position;
88 int result;
89
90 if (commandname == NULL || *commandname == '\0')
91 return CMDTAG_UNKNOWN;
92
95 while (last >= base)
96 {
97 position = base + ((last - base) >> 1);
99 if (result == 0)
101 else if (result < 0)
102 last = position - 1;
103 else
104 base = position + 1;
105 }
106 return CMDTAG_UNKNOWN;
107}
108
109
110
111
112
113
114
115
116
117
118
119
122 bool nameonly)
123{
127 char *bufp;
128
129
130
131
132
133 memcpy(buff, tagname, taglen);
134 bufp = buff + taglen;
135
136
138
139
140
141
142
143
144
145
147 {
148 if (tag == CMDTAG_INSERT)
149 {
150 *bufp++ = ' ';
151 *bufp++ = '0';
152 }
153 *bufp++ = ' ';
155 }
156
157
158 *bufp = '\0';
159
160 Assert((bufp - buff) == strlen(buff));
161
162 return bufp - buff;
163}
const char * GetCommandTagNameAndLen(CommandTag commandTag, Size *len)
void InitializeQueryCompletion(QueryCompletion *qc)
const char * GetCommandTagName(CommandTag commandTag)
struct CommandTagBehavior CommandTagBehavior
static const CommandTagBehavior tag_behavior[]
CommandTag GetCommandTagEnum(const char *commandname)
bool command_tag_event_trigger_ok(CommandTag commandTag)
bool command_tag_table_rewrite_ok(CommandTag commandTag)
bool command_tag_display_rowcount(CommandTag commandTag)
Size BuildQueryCompletionString(char *buff, const QueryCompletion *qc, bool nameonly)
#define COMPLETION_TAG_BUFSIZE
Assert(PointerIsAligned(start, uint64))
int pg_ulltoa_n(uint64 value, char *a)
int pg_strcasecmp(const char *s1, const char *s2)
const bool table_rewrite_ok
const bool event_trigger_ok
const bool display_rowcount