Line data Source code
1 : /* header */
2 : /* src/interfaces/ecpg/preproc/ecpg.header */
3 :
4 : /* Copyright comment */
5 : %{
6 : #include "postgres_fe.h"
7 :
8 : #include "preproc_extern.h"
9 : #include "ecpg_config.h"
10 : #include <unistd.h>
11 :
12 : /* Location tracking support --- simpler than bison's default */
13 : #define YYLLOC_DEFAULT(Current, Rhs, N) \
14 : do { \
15 : if (N) \
16 : (Current) = (Rhs)[1]; \
17 : else \
18 : (Current) = (Rhs)[0]; \
19 : } while (0)
20 :
21 : /*
22 : * The %name-prefix option below will make bison call base_yylex, but we
23 : * really want it to call filtered_base_yylex (see parser.c).
24 : */
25 : #define base_yylex filtered_base_yylex
26 :
27 : /*
28 : * This is only here so the string gets into the POT. Bison uses it
29 : * internally.
30 : */
31 : #define bison_gettext_dummy gettext_noop("syntax error")
32 :
33 : /*
34 : * Variables containing simple states.
35 : */
36 : int struct_level = 0;
37 : int braces_open; /* brace level counter */
38 : char *current_function;
39 : int ecpg_internal_var = 0;
40 : char *connection = NULL;
41 : char *input_filename = NULL;
42 :
43 : static int FoundInto = 0;
44 : static int initializer = 0;
45 : static int pacounter = 1;
46 : static char pacounter_buffer[sizeof(int) * CHAR_BIT * 10 / 3]; /* a rough guess at the size we need */
47 : static struct this_type actual_type[STRUCT_DEPTH];
48 : static char *actual_startline[STRUCT_DEPTH];
49 : static int varchar_counter = 1;
50 : static int bytea_counter = 1;
51 :
52 : /* temporarily store struct members while creating the data structure */
53 : struct ECPGstruct_member *struct_member_list[STRUCT_DEPTH] = { NULL };
54 :
55 : /* also store struct type so we can do a sizeof() later */
56 : static char *ECPGstruct_sizeof = NULL;
57 :
58 : /* for forward declarations we have to store some data as well */
59 : static char *forward_name = NULL;
60 :
61 : struct ECPGtype ecpg_no_indicator = {ECPGt_NO_INDICATOR, NULL, NULL, NULL, {NULL}, 0};
62 : struct variable no_indicator = {"no_indicator", &ecpg_no_indicator, 0, NULL};
63 :
64 : static struct ECPGtype ecpg_query = {ECPGt_char_variable, NULL, NULL, NULL, {NULL}, 0};
65 :
66 : static void vmmerror(int error_code, enum errortype type, const char *error, va_list ap) pg_attribute_printf(3, 0);
67 :
68 : static bool check_declared_list(const char *name);
69 :
70 : /*
71 : * Handle parsing errors and warnings
72 : */
73 : static void
74 0 : vmmerror(int error_code, enum errortype type, const char *error, va_list ap)
75 : {
76 : /* localize the error message string */
77 0 : error = _(error);
78 :
79 0 : fprintf(stderr, "%s:%d: ", input_filename, base_yylineno);
80 :
81 0 : switch(type)
82 : {
83 0 : case ET_WARNING:
84 0 : fprintf(stderr, _("WARNING: "));
85 0 : break;
86 0 : case ET_ERROR:
87 0 : fprintf(stderr, _("ERROR: "));
88 0 : break;
89 : }
90 :
91 0 : vfprintf(stderr, error, ap);
92 :
93 0 : fprintf(stderr, "\n");
94 :
95 0 : switch(type)
96 : {
97 0 : case ET_WARNING:
98 0 : break;
99 0 : case ET_ERROR:
100 0 : ret_value = error_code;
101 0 : break;
102 : }
103 0 : }
104 :
105 : void
106 0 : mmerror(int error_code, enum errortype type, const char *error, ...)
107 : {
108 : va_list ap;
109 :
110 0 : va_start(ap, error);
111 0 : vmmerror(error_code, type, error, ap);
112 0 : va_end(ap);
113 0 : }
114 :
115 : void
116 0 : mmfatal(int error_code, const char *error, ...)
117 : {
118 : va_list ap;
119 :
120 0 : va_start(ap, error);
121 0 : vmmerror(error_code, ET_ERROR, error, ap);
122 0 : va_end(ap);
123 :
124 0 : if (base_yyin)
125 0 : fclose(base_yyin);
126 0 : if (base_yyout)
127 0 : fclose(base_yyout);
128 :
129 0 : if (strcmp(output_filename, "-") != 0 && unlink(output_filename) != 0)
130 0 : fprintf(stderr, _("could not remove output file \"%s\"\n"), output_filename);
131 0 : exit(error_code);
132 : }
133 :
134 : /*
135 : * string concatenation
136 : */
137 :
138 : static char *
139 23104 : cat2_str(char *str1, char *str2)
140 : {
141 23104 : char * res_str = (char *)mm_alloc(strlen(str1) + strlen(str2) + 2);
142 :
143 23104 : strcpy(res_str, str1);
144 23104 : if (strlen(str1) != 0 && strlen(str2) != 0)
145 13880 : strcat(res_str, " ");
146 23104 : strcat(res_str, str2);
147 23104 : free(str1);
148 23104 : free(str2);
149 23104 : return res_str;
150 : }
151 :
152 : static char *
153 7432 : cat_str(int count, ...)
154 : {
155 : va_list args;
156 : int i;
157 : char *res_str;
158 :
159 7432 : va_start(args, count);
160 :
161 7432 : res_str = va_arg(args, char *);
162 :
163 : /* now add all other strings */
164 28978 : for (i = 1; i < count; i++)
165 21546 : res_str = cat2_str(res_str, va_arg(args, char *));
166 :
167 7432 : va_end(args);
168 :
169 7432 : return res_str;
170 : }
171 :
172 : static char *
173 100 : make2_str(char *str1, char *str2)
174 : {
175 100 : char * res_str = (char *)mm_alloc(strlen(str1) + strlen(str2) + 1);
176 :
177 100 : strcpy(res_str, str1);
178 100 : strcat(res_str, str2);
179 100 : free(str1);
180 100 : free(str2);
181 100 : return res_str;
182 : }
183 :
184 : static char *
185 3518 : make3_str(char *str1, char *str2, char *str3)
186 : {
187 3518 : char * res_str = (char *)mm_alloc(strlen(str1) + strlen(str2) +strlen(str3) + 1);
188 :
189 3518 : strcpy(res_str, str1);
190 3518 : strcat(res_str, str2);
191 3518 : strcat(res_str, str3);
192 3518 : free(str1);
193 3518 : free(str2);
194 3518 : free(str3);
195 3518 : return res_str;
196 : }
197 :
198 : /* and the rest */
199 : static char *
200 4636 : make_name(void)
201 : {
202 4636 : return mm_strdup(base_yytext);
203 : }
204 :
205 : static char *
206 246 : create_questionmarks(char *name, bool array)
207 : {
208 246 : struct variable *p = find_variable(name);
209 : int count;
210 246 : char *result = EMPTY;
211 :
212 : /* In case we have a struct, we have to print as many "?" as there are attributes in the struct
213 : * An array is only allowed together with an element argument
214 : * This is essentially only used for inserts, but using a struct as input parameter is an error anywhere else
215 : * so we don't have to worry here. */
216 :
217 246 : if (p->type->type == ECPGt_struct || (array && p->type->type == ECPGt_array && p->type->u.element->type == ECPGt_struct))
218 0 : {
219 : struct ECPGstruct_member *m;
220 :
221 0 : if (p->type->type == ECPGt_struct)
222 0 : m = p->type->u.members;
223 : else
224 0 : m = p->type->u.element->u.members;
225 :
226 0 : for (count = 0; m != NULL; m=m->next, count++);
227 : }
228 : else
229 246 : count = 1;
230 :
231 492 : for (; count > 0; count --)
232 : {
233 246 : sprintf(pacounter_buffer, "$%d", pacounter++);
234 246 : result = cat_str(3, result, mm_strdup(pacounter_buffer), mm_strdup(" , "));
235 : }
236 :
237 : /* removed the trailing " ," */
238 :
239 246 : result[strlen(result)-3] = '\0';
240 246 : return result;
241 : }
242 :
243 : static char *
244 74 : adjust_outofscope_cursor_vars(struct cursor *cur)
245 : {
246 : /* Informix accepts DECLARE with variables that are out of scope when OPEN is called.
247 : * For instance you can DECLARE a cursor in one function, and OPEN/FETCH/CLOSE
248 : * it in another functions. This is very useful for e.g. event-driver programming,
249 : * but may also lead to dangerous programming. The limitation when this is allowed
250 : * and doesn't cause problems have to be documented, like the allocated variables
251 : * must not be realloc()'ed.
252 : *
253 : * We have to change the variables to our own struct and just store the pointer
254 : * instead of the variable. Do it only for local variables, not for globals.
255 : */
256 :
257 74 : char *result = EMPTY;
258 : int insert;
259 :
260 222 : for (insert = 1; insert >= 0; insert--)
261 : {
262 : struct arguments *list;
263 : struct arguments *ptr;
264 148 : struct arguments *newlist = NULL;
265 : struct variable *newvar, *newind;
266 :
267 148 : list = (insert ? cur->argsinsert : cur->argsresult);
268 :
269 214 : for (ptr = list; ptr != NULL; ptr = ptr->next)
270 : {
271 : char var_text[20];
272 : char *original_var;
273 66 : bool skip_set_var = false;
274 66 : bool var_ptr = false;
275 :
276 : /* change variable name to "ECPGget_var(<counter>)" */
277 66 : original_var = ptr->variable->name;
278 66 : sprintf(var_text, "%d))", ecpg_internal_var);
279 :
280 : /* Don't emit ECPGset_var() calls for global variables */
281 66 : if (ptr->variable->brace_level == 0)
282 : {
283 40 : newvar = ptr->variable;
284 40 : skip_set_var = true;
285 : }
286 26 : else if ((ptr->variable->type->type == ECPGt_char_variable)
287 0 : && (strncmp(ptr->variable->name, "ECPGprepared_statement", strlen("ECPGprepared_statement")) == 0))
288 : {
289 0 : newvar = ptr->variable;
290 0 : skip_set_var = true;
291 : }
292 26 : else if ((ptr->variable->type->type != ECPGt_varchar
293 24 : && ptr->variable->type->type != ECPGt_char
294 14 : && ptr->variable->type->type != ECPGt_unsigned_char
295 14 : && ptr->variable->type->type != ECPGt_string
296 14 : && ptr->variable->type->type != ECPGt_bytea)
297 12 : && atoi(ptr->variable->type->size) > 1)
298 : {
299 0 : newvar = new_variable(cat_str(4, mm_strdup("("),
300 0 : mm_strdup(ecpg_type_name(ptr->variable->type->u.element->type)),
301 : mm_strdup(" *)(ECPGget_var("),
302 : mm_strdup(var_text)),
303 0 : ECPGmake_array_type(ECPGmake_simple_type(ptr->variable->type->u.element->type,
304 : mm_strdup("1"),
305 0 : ptr->variable->type->u.element->counter),
306 0 : ptr->variable->type->size),
307 : 0);
308 : }
309 26 : else if ((ptr->variable->type->type == ECPGt_varchar
310 24 : || ptr->variable->type->type == ECPGt_char
311 14 : || ptr->variable->type->type == ECPGt_unsigned_char
312 14 : || ptr->variable->type->type == ECPGt_string
313 14 : || ptr->variable->type->type == ECPGt_bytea)
314 14 : && atoi(ptr->variable->type->size) > 1)
315 : {
316 12 : newvar = new_variable(cat_str(4, mm_strdup("("),
317 6 : mm_strdup(ecpg_type_name(ptr->variable->type->type)),
318 : mm_strdup(" *)(ECPGget_var("),
319 : mm_strdup(var_text)),
320 6 : ECPGmake_simple_type(ptr->variable->type->type,
321 6 : ptr->variable->type->size,
322 6 : ptr->variable->type->counter),
323 : 0);
324 6 : if (ptr->variable->type->type == ECPGt_varchar ||
325 4 : ptr->variable->type->type == ECPGt_bytea)
326 4 : var_ptr = true;
327 : }
328 20 : else if (ptr->variable->type->type == ECPGt_struct
329 20 : || ptr->variable->type->type == ECPGt_union)
330 : {
331 0 : newvar = new_variable(cat_str(5, mm_strdup("(*("),
332 0 : mm_strdup(ptr->variable->type->type_name),
333 : mm_strdup(" *)(ECPGget_var("),
334 : mm_strdup(var_text),
335 : mm_strdup(")")),
336 0 : ECPGmake_struct_type(ptr->variable->type->u.members,
337 0 : ptr->variable->type->type,
338 0 : ptr->variable->type->type_name,
339 0 : ptr->variable->type->struct_sizeof),
340 : 0);
341 0 : var_ptr = true;
342 : }
343 20 : else if (ptr->variable->type->type == ECPGt_array)
344 : {
345 2 : if (ptr->variable->type->u.element->type == ECPGt_struct
346 0 : || ptr->variable->type->u.element->type == ECPGt_union)
347 : {
348 4 : newvar = new_variable(cat_str(5, mm_strdup("(*("),
349 2 : mm_strdup(ptr->variable->type->u.element->type_name),
350 : mm_strdup(" *)(ECPGget_var("),
351 : mm_strdup(var_text),
352 : mm_strdup(")")),
353 2 : ECPGmake_struct_type(ptr->variable->type->u.element->u.members,
354 2 : ptr->variable->type->u.element->type,
355 2 : ptr->variable->type->u.element->type_name,
356 2 : ptr->variable->type->u.element->struct_sizeof),
357 : 0);
358 : }
359 : else
360 : {
361 0 : newvar = new_variable(cat_str(4, mm_strdup("("),
362 0 : mm_strdup(ecpg_type_name(ptr->variable->type->u.element->type)),
363 : mm_strdup(" *)(ECPGget_var("),
364 : mm_strdup(var_text)),
365 0 : ECPGmake_array_type(ECPGmake_simple_type(ptr->variable->type->u.element->type,
366 0 : ptr->variable->type->u.element->size,
367 0 : ptr->variable->type->u.element->counter),
368 0 : ptr->variable->type->size),
369 : 0);
370 0 : var_ptr = true;
371 : }
372 : }
373 : else
374 : {
375 36 : newvar = new_variable(cat_str(4, mm_strdup("*("),
376 18 : mm_strdup(ecpg_type_name(ptr->variable->type->type)),
377 : mm_strdup(" *)(ECPGget_var("),
378 : mm_strdup(var_text)),
379 18 : ECPGmake_simple_type(ptr->variable->type->type,
380 18 : ptr->variable->type->size,
381 18 : ptr->variable->type->counter),
382 : 0);
383 18 : var_ptr = true;
384 : }
385 :
386 : /* create call to "ECPGset_var(<counter>, <connection>, <pointer>. <line number>)" */
387 66 : if (!skip_set_var)
388 : {
389 26 : sprintf(var_text, "%d, %s", ecpg_internal_var++, var_ptr ? "&(" : "(");
390 26 : result = cat_str(5, result, mm_strdup("ECPGset_var("),
391 : mm_strdup(var_text), mm_strdup(original_var),
392 : mm_strdup("), __LINE__);\n"));
393 : }
394 :
395 : /* now the indicator if there is one and it's not a global variable */
396 66 : if ((ptr->indicator->type->type == ECPGt_NO_INDICATOR) || (ptr->indicator->brace_level == 0))
397 : {
398 64 : newind = ptr->indicator;
399 : }
400 : else
401 : {
402 : /* change variable name to "ECPGget_var(<counter>)" */
403 2 : original_var = ptr->indicator->name;
404 2 : sprintf(var_text, "%d))", ecpg_internal_var);
405 2 : var_ptr = false;
406 :
407 2 : if (ptr->indicator->type->type == ECPGt_struct
408 2 : || ptr->indicator->type->type == ECPGt_union)
409 : {
410 0 : newind = new_variable(cat_str(5, mm_strdup("(*("),
411 0 : mm_strdup(ptr->indicator->type->type_name),
412 : mm_strdup(" *)(ECPGget_var("),
413 : mm_strdup(var_text),
414 : mm_strdup(")")),
415 0 : ECPGmake_struct_type(ptr->indicator->type->u.members,
416 0 : ptr->indicator->type->type,
417 0 : ptr->indicator->type->type_name,
418 0 : ptr->indicator->type->struct_sizeof),
419 : 0);
420 0 : var_ptr = true;
421 : }
422 2 : else if (ptr->indicator->type->type == ECPGt_array)
423 : {
424 2 : if (ptr->indicator->type->u.element->type == ECPGt_struct
425 0 : || ptr->indicator->type->u.element->type == ECPGt_union)
426 : {
427 4 : newind = new_variable(cat_str(5, mm_strdup("(*("),
428 2 : mm_strdup(ptr->indicator->type->u.element->type_name),
429 : mm_strdup(" *)(ECPGget_var("),
430 : mm_strdup(var_text),
431 : mm_strdup(")")),
432 2 : ECPGmake_struct_type(ptr->indicator->type->u.element->u.members,
433 2 : ptr->indicator->type->u.element->type,
434 2 : ptr->indicator->type->u.element->type_name,
435 2 : ptr->indicator->type->u.element->struct_sizeof),
436 : 0);
437 : }
438 : else
439 : {
440 0 : newind = new_variable(cat_str(4, mm_strdup("("),
441 0 : mm_strdup(ecpg_type_name(ptr->indicator->type->u.element->type)),
442 : mm_strdup(" *)(ECPGget_var("), mm_strdup(var_text)),
443 0 : ECPGmake_array_type(ECPGmake_simple_type(ptr->indicator->type->u.element->type,
444 0 : ptr->indicator->type->u.element->size,
445 0 : ptr->indicator->type->u.element->counter),
446 0 : ptr->indicator->type->size),
447 : 0);
448 0 : var_ptr = true;
449 : }
450 : }
451 0 : else if (atoi(ptr->indicator->type->size) > 1)
452 : {
453 0 : newind = new_variable(cat_str(4, mm_strdup("("),
454 0 : mm_strdup(ecpg_type_name(ptr->indicator->type->type)),
455 : mm_strdup(" *)(ECPGget_var("),
456 : mm_strdup(var_text)),
457 0 : ECPGmake_simple_type(ptr->indicator->type->type,
458 0 : ptr->indicator->type->size,
459 0 : ptr->variable->type->counter),
460 : 0);
461 : }
462 : else
463 : {
464 0 : newind = new_variable(cat_str(4, mm_strdup("*("),
465 0 : mm_strdup(ecpg_type_name(ptr->indicator->type->type)),
466 : mm_strdup(" *)(ECPGget_var("),
467 : mm_strdup(var_text)),
468 0 : ECPGmake_simple_type(ptr->indicator->type->type,
469 0 : ptr->indicator->type->size,
470 0 : ptr->variable->type->counter),
471 : 0);
472 0 : var_ptr = true;
473 : }
474 :
475 : /* create call to "ECPGset_var(<counter>, <pointer>. <line number>)" */
476 2 : sprintf(var_text, "%d, %s", ecpg_internal_var++, var_ptr ? "&(" : "(");
477 2 : result = cat_str(5, result, mm_strdup("ECPGset_var("),
478 : mm_strdup(var_text), mm_strdup(original_var),
479 : mm_strdup("), __LINE__);\n"));
480 : }
481 :
482 66 : add_variable_to_tail(&newlist, newvar, newind);
483 : }
484 :
485 148 : if (insert)
486 74 : cur->argsinsert_oos = newlist;
487 : else
488 74 : cur->argsresult_oos = newlist;
489 : }
490 :
491 74 : return result;
492 : }
493 :
494 : /* This tests whether the cursor was declared and opened in the same function. */
495 : #define SAMEFUNC(cur) \
496 : ((cur->function == NULL) || \
497 : (cur->function != NULL && strcmp(cur->function, current_function) == 0))
498 :
499 : static struct cursor *
500 202 : add_additional_variables(char *name, bool insert)
501 : {
502 : struct cursor *ptr;
503 : struct arguments *p;
504 202 : int (* strcmp_fn)(const char *, const char *) = ((name[0] == ':' || name[0] == '"') ? strcmp : pg_strcasecmp);
505 :
506 216 : for (ptr = cur; ptr != NULL; ptr=ptr->next)
507 : {
508 216 : if (strcmp_fn(ptr->name, name) == 0)
509 202 : break;
510 : }
511 :
512 202 : if (ptr == NULL)
513 : {
514 0 : mmerror(PARSE_ERROR, ET_ERROR, "cursor \"%s\" does not exist", name);
515 0 : return NULL;
516 : }
517 :
518 202 : if (insert)
519 : {
520 : /* add all those input variables that were given earlier
521 : * note that we have to append here but have to keep the existing order */
522 136 : for (p = (SAMEFUNC(ptr) ? ptr->argsinsert : ptr->argsinsert_oos); p; p = p->next)
523 60 : add_variable_to_tail(&argsinsert, p->variable, p->indicator);
524 : }
525 :
526 : /* add all those output variables that were given earlier */
527 238 : for (p = (SAMEFUNC(ptr) ? ptr->argsresult : ptr->argsresult_oos); p; p = p->next)
528 36 : add_variable_to_tail(&argsresult, p->variable, p->indicator);
529 :
530 202 : return ptr;
531 : }
532 :
533 : static void
534 44 : add_typedef(char *name, char *dimension, char *length, enum ECPGttype type_enum,
535 : char *type_dimension, char *type_index, int initializer, int array)
536 : {
537 : /* add entry to list */
538 : struct typedefs *ptr, *this;
539 :
540 44 : if ((type_enum == ECPGt_struct ||
541 20 : type_enum == ECPGt_union) &&
542 : initializer == 1)
543 0 : mmerror(PARSE_ERROR, ET_ERROR, "initializer not allowed in type definition");
544 44 : else if (INFORMIX_MODE && strcmp(name, "string") == 0)
545 0 : mmerror(PARSE_ERROR, ET_ERROR, "type name \"string\" is reserved in Informix mode");
546 : else
547 : {
548 116 : for (ptr = types; ptr != NULL; ptr = ptr->next)
549 : {
550 72 : if (strcmp(name, ptr->name) == 0)
551 : /* re-definition is a bug */
552 0 : mmerror(PARSE_ERROR, ET_ERROR, "type \"%s\" is already defined", name);
553 : }
554 44 : adjust_array(type_enum, &dimension, &length, type_dimension, type_index, array, true);
555 :
556 44 : this = (struct typedefs *) mm_alloc(sizeof(struct typedefs));
557 :
558 : /* initial definition */
559 44 : this->next = types;
560 44 : this->name = name;
561 44 : this->brace_level = braces_open;
562 44 : this->type = (struct this_type *) mm_alloc(sizeof(struct this_type));
563 44 : this->type->type_enum = type_enum;
564 44 : this->type->type_str = mm_strdup(name);
565 44 : this->type->type_dimension = dimension; /* dimension of array */
566 44 : this->type->type_index = length; /* length of string */
567 44 : this->type->type_sizeof = ECPGstruct_sizeof;
568 28 : this->struct_member_list = (type_enum == ECPGt_struct || type_enum == ECPGt_union) ?
569 72 : ECPGstruct_member_dup(struct_member_list[struct_level]) : NULL;
570 :
571 44 : if (type_enum != ECPGt_varchar &&
572 40 : type_enum != ECPGt_bytea &&
573 28 : type_enum != ECPGt_char &&
574 28 : type_enum != ECPGt_unsigned_char &&
575 28 : type_enum != ECPGt_string &&
576 28 : atoi(this->type->type_index) >= 0)
577 0 : mmerror(PARSE_ERROR, ET_ERROR, "multidimensional arrays for simple data types are not supported");
578 :
579 44 : types = this;
580 : }
581 44 : }
582 :
583 : /*
584 : * check an SQL identifier is declared or not.
585 : * If it is already declared, the global variable
586 : * connection will be changed to the related connection.
587 : */
588 : static bool
589 328 : check_declared_list(const char *name)
590 : {
591 328 : struct declared_list *ptr = NULL;
592 376 : for (ptr = g_declared_list; ptr != NULL; ptr = ptr -> next)
593 : {
594 62 : if (!ptr->connection)
595 36 : continue;
596 26 : if (strcmp(name, ptr -> name) == 0)
597 : {
598 14 : if (connection && strcmp(ptr->connection, connection) != 0)
599 0 : mmerror(PARSE_ERROR, ET_WARNING, "connection %s is overwritten with %s by DECLARE statement %s", connection, ptr->connection, name);
600 14 : connection = mm_strdup(ptr -> connection);
601 14 : return true;
602 : }
603 : }
604 314 : return false;
605 : }
606 : %}
607 :
608 : %expect 0
609 : %name-prefix="base_yy"
610 : %locations
611 :
612 : %union {
613 : double dval;
614 : char *str;
615 : int ival;
616 : struct when action;
617 : struct index index;
618 : int tagname;
619 : struct this_type type;
620 : enum ECPGttype type_enum;
621 : enum ECPGdtype dtype_enum;
622 : struct fetch_desc descriptor;
623 : struct su_symbol struct_union;
624 : struct prep prep;
625 : struct exec exec;
626 : struct describe describe;
627 : }
628 : /* tokens */
629 : /* src/interfaces/ecpg/preproc/ecpg.tokens */
630 :
631 : /* special embedded SQL tokens */
632 : %token SQL_ALLOCATE SQL_AUTOCOMMIT SQL_BOOL SQL_BREAK
633 : SQL_CARDINALITY SQL_CONNECT
634 : SQL_COUNT
635 : SQL_DATETIME_INTERVAL_CODE
636 : SQL_DATETIME_INTERVAL_PRECISION SQL_DESCRIBE
637 : SQL_DESCRIPTOR SQL_DISCONNECT SQL_FOUND
638 : SQL_FREE SQL_GET SQL_GO SQL_GOTO SQL_IDENTIFIED
639 : SQL_INDICATOR SQL_KEY_MEMBER SQL_LENGTH
640 : SQL_LONG SQL_NULLABLE SQL_OCTET_LENGTH
641 : SQL_OPEN SQL_OUTPUT SQL_REFERENCE
642 : SQL_RETURNED_LENGTH SQL_RETURNED_OCTET_LENGTH SQL_SCALE
643 : SQL_SECTION SQL_SHORT SQL_SIGNED SQL_SQLERROR
644 : SQL_SQLPRINT SQL_SQLWARNING SQL_START SQL_STOP
645 : SQL_STRUCT SQL_UNSIGNED SQL_VAR SQL_WHENEVER
646 :
647 : /* C tokens */
648 : %token S_ADD S_AND S_ANYTHING S_AUTO S_CONST S_DEC S_DIV
649 : S_DOTPOINT S_EQUAL S_EXTERN S_INC S_LSHIFT S_MEMPOINT
650 : S_MEMBER S_MOD S_MUL S_NEQUAL S_OR S_REGISTER S_RSHIFT
651 : S_STATIC S_SUB S_VOLATILE
652 : S_TYPEDEF
653 :
654 : %token CSTRING CVARIABLE CPP_LINE IP
655 : /* types */
656 : %type <str> toplevel_stmt
657 : %type <str> stmt
658 : %type <str> opt_single_name
659 : %type <str> opt_qualified_name
660 : %type <str> opt_concurrently
661 : %type <str> opt_drop_behavior
662 : %type <str> CallStmt
663 : %type <str> CreateRoleStmt
664 : %type <str> opt_with
665 : %type <str> OptRoleList
666 : %type <str> AlterOptRoleList
667 : %type <str> AlterOptRoleElem
668 : %type <str> CreateOptRoleElem
669 : %type <str> CreateUserStmt
670 : %type <str> AlterRoleStmt
671 : %type <str> opt_in_database
672 : %type <str> AlterRoleSetStmt
673 : %type <str> DropRoleStmt
674 : %type <str> CreateGroupStmt
675 : %type <str> AlterGroupStmt
676 : %type <str> add_drop
677 : %type <str> CreateSchemaStmt
678 : %type <str> OptSchemaEltList
679 : %type <str> schema_stmt
680 : %type <str> VariableSetStmt
681 : %type <str> set_rest
682 : %type <str> generic_set
683 : %type <str> set_rest_more
684 : %type <str> var_name
685 : %type <str> var_list
686 : %type <str> var_value
687 : %type <str> iso_level
688 : %type <str> opt_boolean_or_string
689 : %type <str> zone_value
690 : %type <str> opt_encoding
691 : %type <str> NonReservedWord_or_Sconst
692 : %type <str> VariableResetStmt
693 : %type <str> reset_rest
694 : %type <str> generic_reset
695 : %type <str> SetResetClause
696 : %type <str> FunctionSetResetClause
697 : %type <str> VariableShowStmt
698 : %type <str> ConstraintsSetStmt
699 : %type <str> constraints_set_list
700 : %type <str> constraints_set_mode
701 : %type <str> CheckPointStmt
702 : %type <str> DiscardStmt
703 : %type <str> AlterTableStmt
704 : %type <str> alter_table_cmds
705 : %type <str> partition_cmd
706 : %type <str> index_partition_cmd
707 : %type <str> alter_table_cmd
708 : %type <str> alter_column_default
709 : %type <str> opt_collate_clause
710 : %type <str> alter_using
711 : %type <str> replica_identity
712 : %type <str> reloptions
713 : %type <str> opt_reloptions
714 : %type <str> reloption_list
715 : %type <str> reloption_elem
716 : %type <str> alter_identity_column_option_list
717 : %type <str> alter_identity_column_option
718 : %type <str> PartitionBoundSpec
719 : %type <str> hash_partbound_elem
720 : %type <str> hash_partbound
721 : %type <str> AlterCompositeTypeStmt
722 : %type <str> alter_type_cmds
723 : %type <str> alter_type_cmd
724 : %type <str> ClosePortalStmt
725 : %type <str> CopyStmt
726 : %type <str> copy_from
727 : %type <str> opt_program
728 : %type <str> copy_file_name
729 : %type <str> copy_options
730 : %type <str> copy_opt_list
731 : %type <str> copy_opt_item
732 : %type <str> opt_binary
733 : %type <str> copy_delimiter
734 : %type <str> opt_using
735 : %type <str> copy_generic_opt_list
736 : %type <str> copy_generic_opt_elem
737 : %type <str> copy_generic_opt_arg
738 : %type <str> copy_generic_opt_arg_list
739 : %type <str> copy_generic_opt_arg_list_item
740 : %type <str> CreateStmt
741 : %type <str> OptTemp
742 : %type <str> OptTableElementList
743 : %type <str> OptTypedTableElementList
744 : %type <str> TableElementList
745 : %type <str> TypedTableElementList
746 : %type <str> TableElement
747 : %type <str> TypedTableElement
748 : %type <str> columnDef
749 : %type <str> columnOptions
750 : %type <str> column_compression
751 : %type <str> opt_column_compression
752 : %type <str> column_storage
753 : %type <str> opt_column_storage
754 : %type <str> ColQualList
755 : %type <str> ColConstraint
756 : %type <str> ColConstraintElem
757 : %type <str> opt_unique_null_treatment
758 : %type <str> generated_when
759 : %type <str> ConstraintAttr
760 : %type <str> TableLikeClause
761 : %type <str> TableLikeOptionList
762 : %type <str> TableLikeOption
763 : %type <str> TableConstraint
764 : %type <str> ConstraintElem
765 : %type <str> opt_no_inherit
766 : %type <str> opt_column_list
767 : %type <str> columnList
768 : %type <str> columnElem
769 : %type <str> opt_c_include
770 : %type <str> key_match
771 : %type <str> ExclusionConstraintList
772 : %type <str> ExclusionConstraintElem
773 : %type <str> OptWhereClause
774 : %type <str> key_actions
775 : %type <str> key_update
776 : %type <str> key_delete
777 : %type <str> key_action
778 : %type <str> OptInherit
779 : %type <str> OptPartitionSpec
780 : %type <str> PartitionSpec
781 : %type <str> part_params
782 : %type <str> part_elem
783 : %type <str> table_access_method_clause
784 : %type <str> OptWith
785 : %type <str> OnCommitOption
786 : %type <str> OptTableSpace
787 : %type <str> OptConsTableSpace
788 : %type <str> ExistingIndex
789 : %type <str> CreateStatsStmt
790 : %type <str> stats_params
791 : %type <str> stats_param
792 : %type <str> AlterStatsStmt
793 : %type <str> create_as_target
794 : %type <str> opt_with_data
795 : %type <str> CreateMatViewStmt
796 : %type <str> create_mv_target
797 : %type <str> OptNoLog
798 : %type <str> RefreshMatViewStmt
799 : %type <str> CreateSeqStmt
800 : %type <str> AlterSeqStmt
801 : %type <str> OptSeqOptList
802 : %type <str> OptParenthesizedSeqOptList
803 : %type <str> SeqOptList
804 : %type <str> SeqOptElem
805 : %type <str> opt_by
806 : %type <str> NumericOnly
807 : %type <str> NumericOnly_list
808 : %type <str> CreatePLangStmt
809 : %type <str> opt_trusted
810 : %type <str> handler_name
811 : %type <str> opt_inline_handler
812 : %type <str> validator_clause
813 : %type <str> opt_validator
814 : %type <str> opt_procedural
815 : %type <str> CreateTableSpaceStmt
816 : %type <str> OptTableSpaceOwner
817 : %type <str> DropTableSpaceStmt
818 : %type <str> CreateExtensionStmt
819 : %type <str> create_extension_opt_list
820 : %type <str> create_extension_opt_item
821 : %type <str> AlterExtensionStmt
822 : %type <str> alter_extension_opt_list
823 : %type <str> alter_extension_opt_item
824 : %type <str> AlterExtensionContentsStmt
825 : %type <str> CreateFdwStmt
826 : %type <str> fdw_option
827 : %type <str> fdw_options
828 : %type <str> opt_fdw_options
829 : %type <str> AlterFdwStmt
830 : %type <str> create_generic_options
831 : %type <str> generic_option_list
832 : %type <str> alter_generic_options
833 : %type <str> alter_generic_option_list
834 : %type <str> alter_generic_option_elem
835 : %type <str> generic_option_elem
836 : %type <str> generic_option_name
837 : %type <str> generic_option_arg
838 : %type <str> CreateForeignServerStmt
839 : %type <str> opt_type
840 : %type <str> foreign_server_version
841 : %type <str> opt_foreign_server_version
842 : %type <str> AlterForeignServerStmt
843 : %type <str> CreateForeignTableStmt
844 : %type <str> ImportForeignSchemaStmt
845 : %type <str> import_qualification_type
846 : %type <str> import_qualification
847 : %type <str> CreateUserMappingStmt
848 : %type <str> auth_ident
849 : %type <str> DropUserMappingStmt
850 : %type <str> AlterUserMappingStmt
851 : %type <str> CreatePolicyStmt
852 : %type <str> AlterPolicyStmt
853 : %type <str> RowSecurityOptionalExpr
854 : %type <str> RowSecurityOptionalWithCheck
855 : %type <str> RowSecurityDefaultToRole
856 : %type <str> RowSecurityOptionalToRole
857 : %type <str> RowSecurityDefaultPermissive
858 : %type <str> RowSecurityDefaultForCmd
859 : %type <str> row_security_cmd
860 : %type <str> CreateAmStmt
861 : %type <str> am_type
862 : %type <str> CreateTrigStmt
863 : %type <str> TriggerActionTime
864 : %type <str> TriggerEvents
865 : %type <str> TriggerOneEvent
866 : %type <str> TriggerReferencing
867 : %type <str> TriggerTransitions
868 : %type <str> TriggerTransition
869 : %type <str> TransitionOldOrNew
870 : %type <str> TransitionRowOrTable
871 : %type <str> TransitionRelName
872 : %type <str> TriggerForSpec
873 : %type <str> TriggerForOptEach
874 : %type <str> TriggerForType
875 : %type <str> TriggerWhen
876 : %type <str> FUNCTION_or_PROCEDURE
877 : %type <str> TriggerFuncArgs
878 : %type <str> TriggerFuncArg
879 : %type <str> OptConstrFromTable
880 : %type <str> ConstraintAttributeSpec
881 : %type <str> ConstraintAttributeElem
882 : %type <str> CreateEventTrigStmt
883 : %type <str> event_trigger_when_list
884 : %type <str> event_trigger_when_item
885 : %type <str> event_trigger_value_list
886 : %type <str> AlterEventTrigStmt
887 : %type <str> enable_trigger
888 : %type <str> CreateAssertionStmt
889 : %type <str> DefineStmt
890 : %type <str> definition
891 : %type <str> def_list
892 : %type <str> def_elem
893 : %type <str> def_arg
894 : %type <str> old_aggr_definition
895 : %type <str> old_aggr_list
896 : %type <str> old_aggr_elem
897 : %type <str> opt_enum_val_list
898 : %type <str> enum_val_list
899 : %type <str> AlterEnumStmt
900 : %type <str> opt_if_not_exists
901 : %type <str> CreateOpClassStmt
902 : %type <str> opclass_item_list
903 : %type <str> opclass_item
904 : %type <str> opt_default
905 : %type <str> opt_opfamily
906 : %type <str> opclass_purpose
907 : %type <str> opt_recheck
908 : %type <str> CreateOpFamilyStmt
909 : %type <str> AlterOpFamilyStmt
910 : %type <str> opclass_drop_list
911 : %type <str> opclass_drop
912 : %type <str> DropOpClassStmt
913 : %type <str> DropOpFamilyStmt
914 : %type <str> DropOwnedStmt
915 : %type <str> ReassignOwnedStmt
916 : %type <str> DropStmt
917 : %type <str> object_type_any_name
918 : %type <str> object_type_name
919 : %type <str> drop_type_name
920 : %type <str> object_type_name_on_any_name
921 : %type <str> any_name_list
922 : %type <str> any_name
923 : %type <str> attrs
924 : %type <str> type_name_list
925 : %type <str> TruncateStmt
926 : %type <str> opt_restart_seqs
927 : %type <str> CommentStmt
928 : %type <str> comment_text
929 : %type <str> SecLabelStmt
930 : %type <str> opt_provider
931 : %type <str> security_label
932 : %type <str> FetchStmt
933 : %type <str> fetch_args
934 : %type <str> from_in
935 : %type <str> opt_from_in
936 : %type <str> GrantStmt
937 : %type <str> RevokeStmt
938 : %type <str> privileges
939 : %type <str> privilege_list
940 : %type <str> privilege
941 : %type <str> parameter_name_list
942 : %type <str> parameter_name
943 : %type <str> privilege_target
944 : %type <str> grantee_list
945 : %type <str> grantee
946 : %type <str> opt_grant_grant_option
947 : %type <str> GrantRoleStmt
948 : %type <str> RevokeRoleStmt
949 : %type <str> grant_role_opt_list
950 : %type <str> grant_role_opt
951 : %type <str> grant_role_opt_value
952 : %type <str> opt_granted_by
953 : %type <str> AlterDefaultPrivilegesStmt
954 : %type <str> DefACLOptionList
955 : %type <str> DefACLOption
956 : %type <str> DefACLAction
957 : %type <str> defacl_privilege_target
958 : %type <str> IndexStmt
959 : %type <str> opt_unique
960 : %type <str> access_method_clause
961 : %type <str> index_params
962 : %type <str> index_elem_options
963 : %type <str> index_elem
964 : %type <str> opt_include
965 : %type <str> index_including_params
966 : %type <str> opt_collate
967 : %type <str> opt_asc_desc
968 : %type <str> opt_nulls_order
969 : %type <str> CreateFunctionStmt
970 : %type <str> opt_or_replace
971 : %type <str> func_args
972 : %type <str> func_args_list
973 : %type <str> function_with_argtypes_list
974 : %type <str> function_with_argtypes
975 : %type <str> func_args_with_defaults
976 : %type <str> func_args_with_defaults_list
977 : %type <str> func_arg
978 : %type <str> arg_class
979 : %type <str> param_name
980 : %type <str> func_return
981 : %type <str> func_type
982 : %type <str> func_arg_with_default
983 : %type <str> aggr_arg
984 : %type <str> aggr_args
985 : %type <str> aggr_args_list
986 : %type <str> aggregate_with_argtypes
987 : %type <str> aggregate_with_argtypes_list
988 : %type <str> opt_createfunc_opt_list
989 : %type <str> createfunc_opt_list
990 : %type <str> common_func_opt_item
991 : %type <str> createfunc_opt_item
992 : %type <str> func_as
993 : %type <str> ReturnStmt
994 : %type <str> opt_routine_body
995 : %type <str> routine_body_stmt_list
996 : %type <str> routine_body_stmt
997 : %type <str> transform_type_list
998 : %type <str> opt_definition
999 : %type <str> table_func_column
1000 : %type <str> table_func_column_list
1001 : %type <str> AlterFunctionStmt
1002 : %type <str> alterfunc_opt_list
1003 : %type <str> opt_restrict
1004 : %type <str> RemoveFuncStmt
1005 : %type <str> RemoveAggrStmt
1006 : %type <str> RemoveOperStmt
1007 : %type <str> oper_argtypes
1008 : %type <str> any_operator
1009 : %type <str> operator_with_argtypes_list
1010 : %type <str> operator_with_argtypes
1011 : %type <str> DoStmt
1012 : %type <str> dostmt_opt_list
1013 : %type <str> dostmt_opt_item
1014 : %type <str> CreateCastStmt
1015 : %type <str> cast_context
1016 : %type <str> DropCastStmt
1017 : %type <str> opt_if_exists
1018 : %type <str> CreateTransformStmt
1019 : %type <str> transform_element_list
1020 : %type <str> DropTransformStmt
1021 : %type <str> ReindexStmt
1022 : %type <str> reindex_target_relation
1023 : %type <str> reindex_target_all
1024 : %type <str> opt_reindex_option_list
1025 : %type <str> AlterTblSpcStmt
1026 : %type <str> RenameStmt
1027 : %type <str> opt_column
1028 : %type <str> opt_set_data
1029 : %type <str> AlterObjectDependsStmt
1030 : %type <str> opt_no
1031 : %type <str> AlterObjectSchemaStmt
1032 : %type <str> AlterOperatorStmt
1033 : %type <str> operator_def_list
1034 : %type <str> operator_def_elem
1035 : %type <str> operator_def_arg
1036 : %type <str> AlterTypeStmt
1037 : %type <str> AlterOwnerStmt
1038 : %type <str> CreatePublicationStmt
1039 : %type <str> PublicationObjSpec
1040 : %type <str> pub_obj_list
1041 : %type <str> AlterPublicationStmt
1042 : %type <str> CreateSubscriptionStmt
1043 : %type <str> AlterSubscriptionStmt
1044 : %type <str> DropSubscriptionStmt
1045 : %type <str> RuleStmt
1046 : %type <str> RuleActionList
1047 : %type <str> RuleActionMulti
1048 : %type <str> RuleActionStmt
1049 : %type <str> RuleActionStmtOrEmpty
1050 : %type <str> event
1051 : %type <str> opt_instead
1052 : %type <str> NotifyStmt
1053 : %type <str> notify_payload
1054 : %type <str> ListenStmt
1055 : %type <str> UnlistenStmt
1056 : %type <str> TransactionStmt
1057 : %type <str> TransactionStmtLegacy
1058 : %type <str> opt_transaction
1059 : %type <str> transaction_mode_item
1060 : %type <str> transaction_mode_list
1061 : %type <str> transaction_mode_list_or_empty
1062 : %type <str> opt_transaction_chain
1063 : %type <str> ViewStmt
1064 : %type <str> opt_check_option
1065 : %type <str> LoadStmt
1066 : %type <str> CreatedbStmt
1067 : %type <str> createdb_opt_list
1068 : %type <str> createdb_opt_items
1069 : %type <str> createdb_opt_item
1070 : %type <str> createdb_opt_name
1071 : %type <str> opt_equal
1072 : %type <str> AlterDatabaseStmt
1073 : %type <str> AlterDatabaseSetStmt
1074 : %type <str> DropdbStmt
1075 : %type <str> drop_option_list
1076 : %type <str> drop_option
1077 : %type <str> AlterCollationStmt
1078 : %type <str> AlterSystemStmt
1079 : %type <str> CreateDomainStmt
1080 : %type <str> AlterDomainStmt
1081 : %type <str> opt_as
1082 : %type <str> AlterTSDictionaryStmt
1083 : %type <str> AlterTSConfigurationStmt
1084 : %type <str> any_with
1085 : %type <str> CreateConversionStmt
1086 : %type <str> ClusterStmt
1087 : %type <str> cluster_index_specification
1088 : %type <str> VacuumStmt
1089 : %type <str> AnalyzeStmt
1090 : %type <str> utility_option_list
1091 : %type <str> analyze_keyword
1092 : %type <str> utility_option_elem
1093 : %type <str> utility_option_name
1094 : %type <str> utility_option_arg
1095 : %type <str> opt_analyze
1096 : %type <str> opt_verbose
1097 : %type <str> opt_full
1098 : %type <str> opt_freeze
1099 : %type <str> opt_name_list
1100 : %type <str> vacuum_relation
1101 : %type <str> vacuum_relation_list
1102 : %type <str> opt_vacuum_relation_list
1103 : %type <str> ExplainStmt
1104 : %type <str> ExplainableStmt
1105 : %type <prep> PrepareStmt
1106 : %type <str> prep_type_clause
1107 : %type <str> PreparableStmt
1108 : %type <exec> ExecuteStmt
1109 : %type <str> execute_param_clause
1110 : %type <str> InsertStmt
1111 : %type <str> insert_target
1112 : %type <str> insert_rest
1113 : %type <str> override_kind
1114 : %type <str> insert_column_list
1115 : %type <str> insert_column_item
1116 : %type <str> opt_on_conflict
1117 : %type <str> opt_conf_expr
1118 : %type <str> returning_clause
1119 : %type <str> DeleteStmt
1120 : %type <str> using_clause
1121 : %type <str> LockStmt
1122 : %type <str> opt_lock
1123 : %type <str> lock_type
1124 : %type <str> opt_nowait
1125 : %type <str> opt_nowait_or_skip
1126 : %type <str> UpdateStmt
1127 : %type <str> set_clause_list
1128 : %type <str> set_clause
1129 : %type <str> set_target
1130 : %type <str> set_target_list
1131 : %type <str> MergeStmt
1132 : %type <str> merge_when_list
1133 : %type <str> merge_when_clause
1134 : %type <str> opt_merge_when_condition
1135 : %type <str> merge_update
1136 : %type <str> merge_delete
1137 : %type <str> merge_insert
1138 : %type <str> merge_values_clause
1139 : %type <str> DeclareCursorStmt
1140 : %type <str> cursor_name
1141 : %type <str> cursor_options
1142 : %type <str> opt_hold
1143 : %type <str> SelectStmt
1144 : %type <str> select_with_parens
1145 : %type <str> select_no_parens
1146 : %type <str> select_clause
1147 : %type <str> simple_select
1148 : %type <str> with_clause
1149 : %type <str> cte_list
1150 : %type <str> common_table_expr
1151 : %type <str> opt_materialized
1152 : %type <str> opt_search_clause
1153 : %type <str> opt_cycle_clause
1154 : %type <str> opt_with_clause
1155 : %type <str> into_clause
1156 : %type <str> OptTempTableName
1157 : %type <str> opt_table
1158 : %type <str> set_quantifier
1159 : %type <str> distinct_clause
1160 : %type <str> opt_all_clause
1161 : %type <str> opt_sort_clause
1162 : %type <str> sort_clause
1163 : %type <str> sortby_list
1164 : %type <str> sortby
1165 : %type <str> select_limit
1166 : %type <str> opt_select_limit
1167 : %type <str> limit_clause
1168 : %type <str> offset_clause
1169 : %type <str> select_limit_value
1170 : %type <str> select_offset_value
1171 : %type <str> select_fetch_first_value
1172 : %type <str> I_or_F_const
1173 : %type <str> row_or_rows
1174 : %type <str> first_or_next
1175 : %type <str> group_clause
1176 : %type <str> group_by_list
1177 : %type <str> group_by_item
1178 : %type <str> empty_grouping_set
1179 : %type <str> rollup_clause
1180 : %type <str> cube_clause
1181 : %type <str> grouping_sets_clause
1182 : %type <str> having_clause
1183 : %type <str> for_locking_clause
1184 : %type <str> opt_for_locking_clause
1185 : %type <str> for_locking_items
1186 : %type <str> for_locking_item
1187 : %type <str> for_locking_strength
1188 : %type <str> locked_rels_list
1189 : %type <str> values_clause
1190 : %type <str> from_clause
1191 : %type <str> from_list
1192 : %type <str> table_ref
1193 : %type <str> joined_table
1194 : %type <str> alias_clause
1195 : %type <str> opt_alias_clause
1196 : %type <str> opt_alias_clause_for_join_using
1197 : %type <str> func_alias_clause
1198 : %type <str> join_type
1199 : %type <str> opt_outer
1200 : %type <str> join_qual
1201 : %type <str> relation_expr
1202 : %type <str> extended_relation_expr
1203 : %type <str> relation_expr_list
1204 : %type <str> relation_expr_opt_alias
1205 : %type <str> tablesample_clause
1206 : %type <str> opt_repeatable_clause
1207 : %type <str> func_table
1208 : %type <str> rowsfrom_item
1209 : %type <str> rowsfrom_list
1210 : %type <str> opt_col_def_list
1211 : %type <str> opt_ordinality
1212 : %type <str> where_clause
1213 : %type <str> where_or_current_clause
1214 : %type <str> OptTableFuncElementList
1215 : %type <str> TableFuncElementList
1216 : %type <str> TableFuncElement
1217 : %type <str> xmltable
1218 : %type <str> xmltable_column_list
1219 : %type <str> xmltable_column_el
1220 : %type <str> xmltable_column_option_list
1221 : %type <str> xmltable_column_option_el
1222 : %type <str> xml_namespace_list
1223 : %type <str> xml_namespace_el
1224 : %type <str> Typename
1225 : %type <index> opt_array_bounds
1226 : %type <str> SimpleTypename
1227 : %type <str> ConstTypename
1228 : %type <str> GenericType
1229 : %type <str> opt_type_modifiers
1230 : %type <str> Numeric
1231 : %type <str> opt_float
1232 : %type <str> Bit
1233 : %type <str> ConstBit
1234 : %type <str> BitWithLength
1235 : %type <str> BitWithoutLength
1236 : %type <str> Character
1237 : %type <str> ConstCharacter
1238 : %type <str> CharacterWithLength
1239 : %type <str> CharacterWithoutLength
1240 : %type <str> character
1241 : %type <str> opt_varying
1242 : %type <str> ConstDatetime
1243 : %type <str> ConstInterval
1244 : %type <str> opt_timezone
1245 : %type <str> opt_interval
1246 : %type <str> interval_second
1247 : %type <str> JsonType
1248 : %type <str> a_expr
1249 : %type <str> b_expr
1250 : %type <str> c_expr
1251 : %type <str> func_application
1252 : %type <str> func_expr
1253 : %type <str> func_expr_windowless
1254 : %type <str> func_expr_common_subexpr
1255 : %type <str> xml_root_version
1256 : %type <str> opt_xml_root_standalone
1257 : %type <str> xml_attributes
1258 : %type <str> xml_attribute_list
1259 : %type <str> xml_attribute_el
1260 : %type <str> document_or_content
1261 : %type <str> xml_indent_option
1262 : %type <str> xml_whitespace_option
1263 : %type <str> xmlexists_argument
1264 : %type <str> xml_passing_mech
1265 : %type <str> within_group_clause
1266 : %type <str> filter_clause
1267 : %type <str> window_clause
1268 : %type <str> window_definition_list
1269 : %type <str> window_definition
1270 : %type <str> over_clause
1271 : %type <str> window_specification
1272 : %type <str> opt_existing_window_name
1273 : %type <str> opt_partition_clause
1274 : %type <str> opt_frame_clause
1275 : %type <str> frame_extent
1276 : %type <str> frame_bound
1277 : %type <str> opt_window_exclusion_clause
1278 : %type <str> row
1279 : %type <str> explicit_row
1280 : %type <str> implicit_row
1281 : %type <str> sub_type
1282 : %type <str> all_Op
1283 : %type <str> MathOp
1284 : %type <str> qual_Op
1285 : %type <str> qual_all_Op
1286 : %type <str> subquery_Op
1287 : %type <str> expr_list
1288 : %type <str> func_arg_list
1289 : %type <str> func_arg_expr
1290 : %type <str> func_arg_list_opt
1291 : %type <str> type_list
1292 : %type <str> array_expr
1293 : %type <str> array_expr_list
1294 : %type <str> extract_list
1295 : %type <str> extract_arg
1296 : %type <str> unicode_normal_form
1297 : %type <str> overlay_list
1298 : %type <str> position_list
1299 : %type <str> substr_list
1300 : %type <str> trim_list
1301 : %type <str> in_expr
1302 : %type <str> case_expr
1303 : %type <str> when_clause_list
1304 : %type <str> when_clause
1305 : %type <str> case_default
1306 : %type <str> case_arg
1307 : %type <str> columnref
1308 : %type <str> indirection_el
1309 : %type <str> opt_slice_bound
1310 : %type <str> indirection
1311 : %type <str> opt_indirection
1312 : %type <str> opt_asymmetric
1313 : %type <str> json_value_expr
1314 : %type <str> json_format_clause_opt
1315 : %type <str> json_encoding_clause_opt
1316 : %type <str> json_returning_clause_opt
1317 : %type <str> json_predicate_type_constraint
1318 : %type <str> json_key_uniqueness_constraint_opt
1319 : %type <str> json_name_and_value_list
1320 : %type <str> json_name_and_value
1321 : %type <str> json_object_constructor_null_clause_opt
1322 : %type <str> json_array_constructor_null_clause_opt
1323 : %type <str> json_value_expr_list
1324 : %type <str> json_aggregate_func
1325 : %type <str> json_array_aggregate_order_by_clause_opt
1326 : %type <str> opt_target_list
1327 : %type <str> target_list
1328 : %type <str> target_el
1329 : %type <str> qualified_name_list
1330 : %type <str> qualified_name
1331 : %type <str> name_list
1332 : %type <str> name
1333 : %type <str> attr_name
1334 : %type <str> file_name
1335 : %type <str> func_name
1336 : %type <str> AexprConst
1337 : %type <str> Iconst
1338 : %type <str> SignedIconst
1339 : %type <str> RoleId
1340 : %type <str> RoleSpec
1341 : %type <str> role_list
1342 : %type <str> NonReservedWord
1343 : %type <str> BareColLabel
1344 : %type <str> unreserved_keyword
1345 : %type <str> col_name_keyword
1346 : %type <str> type_func_name_keyword
1347 : %type <str> reserved_keyword
1348 : %type <str> bare_label_keyword
1349 : /* ecpgtype */
1350 : /* src/interfaces/ecpg/preproc/ecpg.type */
1351 : %type <str> ECPGAllocateDescr
1352 : %type <str> ECPGCKeywords
1353 : %type <str> ECPGColId
1354 : %type <str> ECPGColLabel
1355 : %type <str> ECPGConnect
1356 : %type <str> ECPGCursorStmt
1357 : %type <str> ECPGDeallocateDescr
1358 : %type <str> ECPGDeclaration
1359 : %type <str> ECPGDeclare
1360 : %type <str> ECPGDeclareStmt
1361 : %type <str> ECPGDisconnect
1362 : %type <str> ECPGExecuteImmediateStmt
1363 : %type <str> ECPGFree
1364 : %type <str> ECPGGetDescHeaderItem
1365 : %type <str> ECPGGetDescItem
1366 : %type <str> ECPGGetDescriptorHeader
1367 : %type <str> ECPGKeywords
1368 : %type <str> ECPGKeywords_rest
1369 : %type <str> ECPGKeywords_vanames
1370 : %type <str> ECPGOpen
1371 : %type <str> ECPGSetAutocommit
1372 : %type <str> ECPGSetConnection
1373 : %type <str> ECPGSetDescHeaderItem
1374 : %type <str> ECPGSetDescItem
1375 : %type <str> ECPGSetDescriptorHeader
1376 : %type <str> ECPGTypeName
1377 : %type <str> ECPGTypedef
1378 : %type <str> ECPGVar
1379 : %type <str> ECPGVarDeclaration
1380 : %type <str> ECPGWhenever
1381 : %type <str> ECPGunreserved_interval
1382 : %type <str> UsingConst
1383 : %type <str> UsingValue
1384 : %type <str> all_unreserved_keyword
1385 : %type <str> c_anything
1386 : %type <str> c_args
1387 : %type <str> c_list
1388 : %type <str> c_stuff
1389 : %type <str> c_stuff_item
1390 : %type <str> c_term
1391 : %type <str> c_thing
1392 : %type <str> char_variable
1393 : %type <str> char_civar
1394 : %type <str> civar
1395 : %type <str> civarind
1396 : %type <str> ColId
1397 : %type <str> ColLabel
1398 : %type <str> connect_options
1399 : %type <str> connection_object
1400 : %type <str> connection_target
1401 : %type <str> coutputvariable
1402 : %type <str> cvariable
1403 : %type <str> db_prefix
1404 : %type <str> CreateAsStmt
1405 : %type <str> DeallocateStmt
1406 : %type <str> dis_name
1407 : %type <str> ecpg_bconst
1408 : %type <str> ecpg_fconst
1409 : %type <str> ecpg_ident
1410 : %type <str> ecpg_interval
1411 : %type <str> ecpg_into
1412 : %type <str> ecpg_fetch_into
1413 : %type <str> ecpg_param
1414 : %type <str> ecpg_sconst
1415 : %type <str> ecpg_using
1416 : %type <str> ecpg_xconst
1417 : %type <str> enum_definition
1418 : %type <str> enum_type
1419 : %type <str> execstring
1420 : %type <str> execute_rest
1421 : %type <str> indicator
1422 : %type <str> into_descriptor
1423 : %type <str> into_sqlda
1424 : %type <str> Iresult
1425 : %type <str> on_off
1426 : %type <str> opt_bit_field
1427 : %type <str> opt_connection_name
1428 : %type <str> opt_database_name
1429 : %type <str> opt_ecpg_into
1430 : %type <str> opt_ecpg_fetch_into
1431 : %type <str> opt_ecpg_using
1432 : %type <str> opt_initializer
1433 : %type <str> opt_options
1434 : %type <str> opt_output
1435 : %type <str> opt_pointer
1436 : %type <str> opt_port
1437 : %type <str> opt_reference
1438 : %type <str> opt_scale
1439 : %type <str> opt_server
1440 : %type <str> opt_user
1441 : %type <str> opt_opt_value
1442 : %type <str> ora_user
1443 : %type <str> precision
1444 : %type <str> prepared_name
1445 : %type <str> quoted_ident_stringvar
1446 : %type <str> s_struct_union
1447 : %type <str> server
1448 : %type <str> server_name
1449 : %type <str> single_vt_declaration
1450 : %type <str> storage_clause
1451 : %type <str> storage_declaration
1452 : %type <str> storage_modifier
1453 : %type <str> struct_union_type
1454 : %type <str> struct_union_type_with_symbol
1455 : %type <str> symbol
1456 : %type <str> type_declaration
1457 : %type <str> type_function_name
1458 : %type <str> user_name
1459 : %type <str> using_descriptor
1460 : %type <str> var_declaration
1461 : %type <str> var_type_declarations
1462 : %type <str> variable
1463 : %type <str> variable_declarations
1464 : %type <str> variable_list
1465 : %type <str> vt_declarations
1466 :
1467 : %type <str> Op
1468 : %type <str> IntConstVar
1469 : %type <str> AllConstVar
1470 : %type <str> CSTRING
1471 : %type <str> CPP_LINE
1472 : %type <str> CVARIABLE
1473 : %type <str> BCONST
1474 : %type <str> SCONST
1475 : %type <str> XCONST
1476 : %type <str> IDENT
1477 :
1478 : %type <struct_union> s_struct_union_symbol
1479 :
1480 : %type <descriptor> ECPGGetDescriptor
1481 : %type <descriptor> ECPGSetDescriptor
1482 :
1483 : %type <type_enum> simple_type
1484 : %type <type_enum> signed_type
1485 : %type <type_enum> unsigned_type
1486 :
1487 : %type <dtype_enum> descriptor_item
1488 : %type <dtype_enum> desc_header_item
1489 :
1490 : %type <type> var_type
1491 :
1492 : %type <action> action
1493 :
1494 : %type <describe> ECPGDescribe
1495 : /* orig_tokens */
1496 : %token IDENT UIDENT FCONST SCONST USCONST BCONST XCONST Op
1497 : %token ICONST PARAM
1498 : %token TYPECAST DOT_DOT COLON_EQUALS EQUALS_GREATER
1499 : %token LESS_EQUALS GREATER_EQUALS NOT_EQUALS
1500 :
1501 :
1502 :
1503 :
1504 :
1505 :
1506 :
1507 :
1508 :
1509 : %token ABORT_P ABSENT ABSOLUTE_P ACCESS ACTION ADD_P ADMIN AFTER
1510 : AGGREGATE ALL ALSO ALTER ALWAYS ANALYSE ANALYZE AND ANY ARRAY AS ASC
1511 : ASENSITIVE ASSERTION ASSIGNMENT ASYMMETRIC ATOMIC AT ATTACH ATTRIBUTE AUTHORIZATION
1512 :
1513 : BACKWARD BEFORE BEGIN_P BETWEEN BIGINT BINARY BIT
1514 : BOOLEAN_P BOTH BREADTH BY
1515 :
1516 : CACHE CALL CALLED CASCADE CASCADED CASE CAST CATALOG_P CHAIN CHAR_P
1517 : CHARACTER CHARACTERISTICS CHECK CHECKPOINT CLASS CLOSE
1518 : CLUSTER COALESCE COLLATE COLLATION COLUMN COLUMNS COMMENT COMMENTS COMMIT
1519 : COMMITTED COMPRESSION CONCURRENTLY CONFIGURATION CONFLICT
1520 : CONNECTION CONSTRAINT CONSTRAINTS CONTENT_P CONTINUE_P CONVERSION_P COPY
1521 : COST CREATE CROSS CSV CUBE CURRENT_P
1522 : CURRENT_CATALOG CURRENT_DATE CURRENT_ROLE CURRENT_SCHEMA
1523 : CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURSOR CYCLE
1524 :
1525 : DATA_P DATABASE DAY_P DEALLOCATE DEC DECIMAL_P DECLARE DEFAULT DEFAULTS
1526 : DEFERRABLE DEFERRED DEFINER DELETE_P DELIMITER DELIMITERS DEPENDS DEPTH DESC
1527 : DETACH DICTIONARY DISABLE_P DISCARD DISTINCT DO DOCUMENT_P DOMAIN_P
1528 : DOUBLE_P DROP
1529 :
1530 : EACH ELSE ENABLE_P ENCODING ENCRYPTED END_P ENUM_P ESCAPE EVENT EXCEPT
1531 : EXCLUDE EXCLUDING EXCLUSIVE EXECUTE EXISTS EXPLAIN EXPRESSION
1532 : EXTENSION EXTERNAL EXTRACT
1533 :
1534 : FALSE_P FAMILY FETCH FILTER FINALIZE FIRST_P FLOAT_P FOLLOWING FOR
1535 : FORCE FOREIGN FORMAT FORWARD FREEZE FROM FULL FUNCTION FUNCTIONS
1536 :
1537 : GENERATED GLOBAL GRANT GRANTED GREATEST GROUP_P GROUPING GROUPS
1538 :
1539 : HANDLER HAVING HEADER_P HOLD HOUR_P
1540 :
1541 : IDENTITY_P IF_P ILIKE IMMEDIATE IMMUTABLE IMPLICIT_P IMPORT_P IN_P INCLUDE
1542 : INCLUDING INCREMENT INDENT INDEX INDEXES INHERIT INHERITS INITIALLY INLINE_P
1543 : INNER_P INOUT INPUT_P INSENSITIVE INSERT INSTEAD INT_P INTEGER
1544 : INTERSECT INTERVAL INTO INVOKER IS ISNULL ISOLATION
1545 :
1546 : JOIN JSON JSON_ARRAY JSON_ARRAYAGG JSON_OBJECT JSON_OBJECTAGG
1547 : JSON_SCALAR JSON_SERIALIZE
1548 :
1549 : KEY KEYS
1550 :
1551 : LABEL LANGUAGE LARGE_P LAST_P LATERAL_P
1552 : LEADING LEAKPROOF LEAST LEFT LEVEL LIKE LIMIT LISTEN LOAD LOCAL
1553 : LOCALTIME LOCALTIMESTAMP LOCATION LOCK_P LOCKED LOGGED
1554 :
1555 : MAPPING MATCH MATCHED MATERIALIZED MAXVALUE MERGE METHOD
1556 : MINUTE_P MINVALUE MODE MONTH_P MOVE
1557 :
1558 : NAME_P NAMES NATIONAL NATURAL NCHAR NEW NEXT NFC NFD NFKC NFKD NO NONE
1559 : NORMALIZE NORMALIZED
1560 : NOT NOTHING NOTIFY NOTNULL NOWAIT NULL_P NULLIF
1561 : NULLS_P NUMERIC
1562 :
1563 : OBJECT_P OF OFF OFFSET OIDS OLD ON ONLY OPERATOR OPTION OPTIONS OR
1564 : ORDER ORDINALITY OTHERS OUT_P OUTER_P
1565 : OVER OVERLAPS OVERLAY OVERRIDING OWNED OWNER
1566 :
1567 : PARALLEL PARAMETER PARSER PARTIAL PARTITION PASSING PASSWORD
1568 : PLACING PLANS POLICY
1569 : POSITION PRECEDING PRECISION PRESERVE PREPARE PREPARED PRIMARY
1570 : PRIOR PRIVILEGES PROCEDURAL PROCEDURE PROCEDURES PROGRAM PUBLICATION
1571 :
1572 : QUOTE
1573 :
1574 : RANGE READ REAL REASSIGN RECHECK RECURSIVE REF_P REFERENCES REFERENCING
1575 : REFRESH REINDEX RELATIVE_P RELEASE RENAME REPEATABLE REPLACE REPLICA
1576 : RESET RESTART RESTRICT RETURN RETURNING RETURNS REVOKE RIGHT ROLE ROLLBACK ROLLUP
1577 : ROUTINE ROUTINES ROW ROWS RULE
1578 :
1579 : SAVEPOINT SCALAR SCHEMA SCHEMAS SCROLL SEARCH SECOND_P SECURITY SELECT
1580 : SEQUENCE SEQUENCES
1581 : SERIALIZABLE SERVER SESSION SESSION_USER SET SETS SETOF SHARE SHOW
1582 : SIMILAR SIMPLE SKIP SMALLINT SNAPSHOT SOME SQL_P STABLE STANDALONE_P
1583 : START STATEMENT STATISTICS STDIN STDOUT STORAGE STORED STRICT_P STRIP_P
1584 : SUBSCRIPTION SUBSTRING SUPPORT SYMMETRIC SYSID SYSTEM_P SYSTEM_USER
1585 :
1586 : TABLE TABLES TABLESAMPLE TABLESPACE TEMP TEMPLATE TEMPORARY TEXT_P THEN
1587 : TIES TIME TIMESTAMP TO TRAILING TRANSACTION TRANSFORM
1588 : TREAT TRIGGER TRIM TRUE_P
1589 : TRUNCATE TRUSTED TYPE_P TYPES_P
1590 :
1591 : UESCAPE UNBOUNDED UNCOMMITTED UNENCRYPTED UNION UNIQUE UNKNOWN
1592 : UNLISTEN UNLOGGED UNTIL UPDATE USER USING
1593 :
1594 : VACUUM VALID VALIDATE VALIDATOR VALUE_P VALUES VARCHAR VARIADIC VARYING
1595 : VERBOSE VERSION_P VIEW VIEWS VOLATILE
1596 :
1597 : WHEN WHERE WHITESPACE_P WINDOW WITH WITHIN WITHOUT WORK WRAPPER WRITE
1598 :
1599 : XML_P XMLATTRIBUTES XMLCONCAT XMLELEMENT XMLEXISTS XMLFOREST XMLNAMESPACES
1600 : XMLPARSE XMLPI XMLROOT XMLSERIALIZE XMLTABLE
1601 :
1602 : YEAR_P YES_P
1603 :
1604 : ZONE
1605 :
1606 :
1607 :
1608 :
1609 :
1610 :
1611 :
1612 :
1613 :
1614 :
1615 :
1616 :
1617 : %token FORMAT_LA NOT_LA NULLS_LA WITH_LA WITHOUT_LA
1618 :
1619 :
1620 :
1621 :
1622 :
1623 :
1624 :
1625 :
1626 : %token MODE_TYPE_NAME
1627 : %token MODE_PLPGSQL_EXPR
1628 : %token MODE_PLPGSQL_ASSIGN1
1629 : %token MODE_PLPGSQL_ASSIGN2
1630 : %token MODE_PLPGSQL_ASSIGN3
1631 :
1632 :
1633 :
1634 : %left UNION EXCEPT
1635 : %left INTERSECT
1636 : %left OR
1637 : %left AND
1638 : %right NOT
1639 : %nonassoc IS ISNULL NOTNULL
1640 : %nonassoc '<' '>' '=' LESS_EQUALS GREATER_EQUALS NOT_EQUALS
1641 : %nonassoc BETWEEN IN_P LIKE ILIKE SIMILAR NOT_LA
1642 : %nonassoc ESCAPE
1643 :
1644 :
1645 :
1646 :
1647 :
1648 :
1649 :
1650 :
1651 :
1652 :
1653 :
1654 :
1655 :
1656 :
1657 :
1658 :
1659 :
1660 :
1661 :
1662 :
1663 :
1664 :
1665 :
1666 :
1667 :
1668 :
1669 :
1670 :
1671 :
1672 :
1673 :
1674 :
1675 :
1676 :
1677 :
1678 :
1679 :
1680 :
1681 :
1682 :
1683 :
1684 :
1685 :
1686 :
1687 : %nonassoc UNBOUNDED
1688 : %nonassoc IDENT
1689 : %nonassoc CSTRING PARTITION RANGE ROWS GROUPS PRECEDING FOLLOWING CUBE ROLLUP
1690 : SET KEYS OBJECT_P SCALAR VALUE_P WITH WITHOUT
1691 : %left Op OPERATOR
1692 : %left '+' '-'
1693 : %left '*' '/' '%'
1694 : %left '^'
1695 :
1696 : %left AT
1697 : %left COLLATE
1698 : %right UMINUS
1699 : %left '[' ']'
1700 : %left '(' ')'
1701 : %left TYPECAST
1702 : %left '.'
1703 :
1704 :
1705 :
1706 :
1707 :
1708 :
1709 :
1710 : %left JOIN CROSS LEFT FULL RIGHT INNER_P NATURAL
1711 :
1712 : %%
1713 : prog: statements;
1714 : /* rules */
1715 : toplevel_stmt:
1716 : stmt
1717 : {
1718 2344 : $$ = $1;
1719 : }
1720 : | TransactionStmtLegacy
1721 : {
1722 16 : fprintf(base_yyout, "{ ECPGtrans(__LINE__, %s, \"%s\");", connection ? connection : "NULL", $1);
1723 16 : whenever_action(2);
1724 16 : free($1);
1725 : }
1726 : ;
1727 :
1728 :
1729 : stmt:
1730 : AlterEventTrigStmt
1731 0 : { output_statement($1, 0, ECPGst_normal); }
1732 : | AlterCollationStmt
1733 0 : { output_statement($1, 0, ECPGst_normal); }
1734 : | AlterDatabaseStmt
1735 0 : { output_statement($1, 0, ECPGst_normal); }
1736 : | AlterDatabaseSetStmt
1737 0 : { output_statement($1, 0, ECPGst_normal); }
1738 : | AlterDefaultPrivilegesStmt
1739 0 : { output_statement($1, 0, ECPGst_normal); }
1740 : | AlterDomainStmt
1741 0 : { output_statement($1, 0, ECPGst_normal); }
1742 : | AlterEnumStmt
1743 0 : { output_statement($1, 0, ECPGst_normal); }
1744 : | AlterExtensionStmt
1745 0 : { output_statement($1, 0, ECPGst_normal); }
1746 : | AlterExtensionContentsStmt
1747 0 : { output_statement($1, 0, ECPGst_normal); }
1748 : | AlterFdwStmt
1749 0 : { output_statement($1, 0, ECPGst_normal); }
1750 : | AlterForeignServerStmt
1751 0 : { output_statement($1, 0, ECPGst_normal); }
1752 : | AlterFunctionStmt
1753 0 : { output_statement($1, 0, ECPGst_normal); }
1754 : | AlterGroupStmt
1755 0 : { output_statement($1, 0, ECPGst_normal); }
1756 : | AlterObjectDependsStmt
1757 0 : { output_statement($1, 0, ECPGst_normal); }
1758 : | AlterObjectSchemaStmt
1759 0 : { output_statement($1, 0, ECPGst_normal); }
1760 : | AlterOwnerStmt
1761 0 : { output_statement($1, 0, ECPGst_normal); }
1762 : | AlterOperatorStmt
1763 0 : { output_statement($1, 0, ECPGst_normal); }
1764 : | AlterTypeStmt
1765 0 : { output_statement($1, 0, ECPGst_normal); }
1766 : | AlterPolicyStmt
1767 0 : { output_statement($1, 0, ECPGst_normal); }
1768 : | AlterSeqStmt
1769 0 : { output_statement($1, 0, ECPGst_normal); }
1770 : | AlterSystemStmt
1771 0 : { output_statement($1, 0, ECPGst_normal); }
1772 : | AlterTableStmt
1773 4 : { output_statement($1, 0, ECPGst_normal); }
1774 : | AlterTblSpcStmt
1775 0 : { output_statement($1, 0, ECPGst_normal); }
1776 : | AlterCompositeTypeStmt
1777 0 : { output_statement($1, 0, ECPGst_normal); }
1778 : | AlterPublicationStmt
1779 0 : { output_statement($1, 0, ECPGst_normal); }
1780 : | AlterRoleSetStmt
1781 0 : { output_statement($1, 0, ECPGst_normal); }
1782 : | AlterRoleStmt
1783 6 : { output_statement($1, 0, ECPGst_normal); }
1784 : | AlterSubscriptionStmt
1785 0 : { output_statement($1, 0, ECPGst_normal); }
1786 : | AlterStatsStmt
1787 0 : { output_statement($1, 0, ECPGst_normal); }
1788 : | AlterTSConfigurationStmt
1789 0 : { output_statement($1, 0, ECPGst_normal); }
1790 : | AlterTSDictionaryStmt
1791 0 : { output_statement($1, 0, ECPGst_normal); }
1792 : | AlterUserMappingStmt
1793 0 : { output_statement($1, 0, ECPGst_normal); }
1794 : | AnalyzeStmt
1795 0 : { output_statement($1, 0, ECPGst_normal); }
1796 : | CallStmt
1797 0 : { output_statement($1, 0, ECPGst_normal); }
1798 : | CheckPointStmt
1799 0 : { output_statement($1, 0, ECPGst_normal); }
1800 : | ClosePortalStmt
1801 : {
1802 76 : if (INFORMIX_MODE)
1803 : {
1804 8 : if (pg_strcasecmp($1+strlen("close "), "database") == 0)
1805 : {
1806 4 : if (connection)
1807 0 : mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in CLOSE DATABASE statement");
1808 :
1809 4 : fprintf(base_yyout, "{ ECPGdisconnect(__LINE__, \"CURRENT\");");
1810 4 : whenever_action(2);
1811 4 : free($1);
1812 4 : break;
1813 : }
1814 : }
1815 :
1816 72 : output_statement($1, 0, ECPGst_normal);
1817 : }
1818 : | ClusterStmt
1819 0 : { output_statement($1, 0, ECPGst_normal); }
1820 : | CommentStmt
1821 0 : { output_statement($1, 0, ECPGst_normal); }
1822 : | ConstraintsSetStmt
1823 0 : { output_statement($1, 0, ECPGst_normal); }
1824 : | CopyStmt
1825 2 : { output_statement($1, 0, ECPGst_normal); }
1826 : | CreateAmStmt
1827 0 : { output_statement($1, 0, ECPGst_normal); }
1828 : | CreateAsStmt
1829 4 : { output_statement($1, 0, ECPGst_normal); }
1830 : | CreateAssertionStmt
1831 0 : { output_statement($1, 0, ECPGst_normal); }
1832 : | CreateCastStmt
1833 0 : { output_statement($1, 0, ECPGst_normal); }
1834 : | CreateConversionStmt
1835 0 : { output_statement($1, 0, ECPGst_normal); }
1836 : | CreateDomainStmt
1837 0 : { output_statement($1, 0, ECPGst_normal); }
1838 : | CreateExtensionStmt
1839 0 : { output_statement($1, 0, ECPGst_normal); }
1840 : | CreateFdwStmt
1841 0 : { output_statement($1, 0, ECPGst_normal); }
1842 : | CreateForeignServerStmt
1843 0 : { output_statement($1, 0, ECPGst_normal); }
1844 : | CreateForeignTableStmt
1845 0 : { output_statement($1, 0, ECPGst_normal); }
1846 : | CreateFunctionStmt
1847 2 : { output_statement($1, 0, ECPGst_normal); }
1848 : | CreateGroupStmt
1849 0 : { output_statement($1, 0, ECPGst_normal); }
1850 : | CreateMatViewStmt
1851 0 : { output_statement($1, 0, ECPGst_normal); }
1852 : | CreateOpClassStmt
1853 0 : { output_statement($1, 0, ECPGst_normal); }
1854 : | CreateOpFamilyStmt
1855 0 : { output_statement($1, 0, ECPGst_normal); }
1856 : | CreatePublicationStmt
1857 0 : { output_statement($1, 0, ECPGst_normal); }
1858 : | AlterOpFamilyStmt
1859 0 : { output_statement($1, 0, ECPGst_normal); }
1860 : | CreatePolicyStmt
1861 0 : { output_statement($1, 0, ECPGst_normal); }
1862 : | CreatePLangStmt
1863 0 : { output_statement($1, 0, ECPGst_normal); }
1864 : | CreateSchemaStmt
1865 0 : { output_statement($1, 0, ECPGst_normal); }
1866 : | CreateSeqStmt
1867 0 : { output_statement($1, 0, ECPGst_normal); }
1868 : | CreateStmt
1869 100 : { output_statement($1, 0, ECPGst_normal); }
1870 : | CreateSubscriptionStmt
1871 0 : { output_statement($1, 0, ECPGst_normal); }
1872 : | CreateStatsStmt
1873 0 : { output_statement($1, 0, ECPGst_normal); }
1874 : | CreateTableSpaceStmt
1875 0 : { output_statement($1, 0, ECPGst_normal); }
1876 : | CreateTransformStmt
1877 0 : { output_statement($1, 0, ECPGst_normal); }
1878 : | CreateTrigStmt
1879 2 : { output_statement($1, 0, ECPGst_normal); }
1880 : | CreateEventTrigStmt
1881 0 : { output_statement($1, 0, ECPGst_normal); }
1882 : | CreateRoleStmt
1883 0 : { output_statement($1, 0, ECPGst_normal); }
1884 : | CreateUserStmt
1885 0 : { output_statement($1, 0, ECPGst_normal); }
1886 : | CreateUserMappingStmt
1887 0 : { output_statement($1, 0, ECPGst_normal); }
1888 : | CreatedbStmt
1889 0 : { output_statement($1, 0, ECPGst_normal); }
1890 : | DeallocateStmt
1891 : {
1892 76 : output_deallocate_prepare_statement($1);
1893 : }
1894 : | DeclareCursorStmt
1895 34 : { output_simple_statement($1, (strncmp($1, "ECPGset_var", strlen("ECPGset_var")) == 0) ? 4 : 0); }
1896 : | DefineStmt
1897 0 : { output_statement($1, 0, ECPGst_normal); }
1898 : | DeleteStmt
1899 4 : { output_statement($1, 1, ECPGst_prepnormal); }
1900 : | DiscardStmt
1901 0 : { output_statement($1, 1, ECPGst_normal); }
1902 : | DoStmt
1903 0 : { output_statement($1, 0, ECPGst_normal); }
1904 : | DropCastStmt
1905 0 : { output_statement($1, 0, ECPGst_normal); }
1906 : | DropOpClassStmt
1907 0 : { output_statement($1, 0, ECPGst_normal); }
1908 : | DropOpFamilyStmt
1909 0 : { output_statement($1, 0, ECPGst_normal); }
1910 : | DropOwnedStmt
1911 0 : { output_statement($1, 0, ECPGst_normal); }
1912 : | DropStmt
1913 76 : { output_statement($1, 0, ECPGst_normal); }
1914 : | DropSubscriptionStmt
1915 0 : { output_statement($1, 0, ECPGst_normal); }
1916 : | DropTableSpaceStmt
1917 0 : { output_statement($1, 0, ECPGst_normal); }
1918 : | DropTransformStmt
1919 0 : { output_statement($1, 0, ECPGst_normal); }
1920 : | DropRoleStmt
1921 0 : { output_statement($1, 0, ECPGst_normal); }
1922 : | DropUserMappingStmt
1923 0 : { output_statement($1, 0, ECPGst_normal); }
1924 : | DropdbStmt
1925 0 : { output_statement($1, 0, ECPGst_normal); }
1926 : | ExecuteStmt
1927 : {
1928 66 : check_declared_list($1.name);
1929 66 : if ($1.type == NULL || strlen($1.type) == 0)
1930 48 : output_statement($1.name, 1, ECPGst_execute);
1931 : else
1932 : {
1933 18 : if ($1.name[0] != '"')
1934 : /* case of char_variable */
1935 8 : add_variable_to_tail(&argsinsert, find_variable($1.name), &no_indicator);
1936 : else
1937 : {
1938 : /* case of ecpg_ident or CSTRING */
1939 10 : char *length = mm_alloc(sizeof(int) * CHAR_BIT * 10 / 3);
1940 10 : char *str = mm_strdup($1.name + 1);
1941 :
1942 : /* It must be cut off double quotation because new_variable() double-quotes. */
1943 10 : str[strlen(str) - 1] = '\0';
1944 10 : sprintf(length, "%zu", strlen(str));
1945 10 : add_variable_to_tail(&argsinsert, new_variable(str, ECPGmake_simple_type(ECPGt_const, length, 0), 0), &no_indicator);
1946 : }
1947 18 : output_statement(cat_str(3, mm_strdup("execute"), mm_strdup("$0"), $1.type), 0, ECPGst_exec_with_exprlist);
1948 : }
1949 : }
1950 : | ExplainStmt
1951 0 : { output_statement($1, 0, ECPGst_normal); }
1952 : | FetchStmt
1953 126 : { output_statement($1, 1, ECPGst_normal); }
1954 : | GrantStmt
1955 0 : { output_statement($1, 0, ECPGst_normal); }
1956 : | GrantRoleStmt
1957 0 : { output_statement($1, 0, ECPGst_normal); }
1958 : | ImportForeignSchemaStmt
1959 0 : { output_statement($1, 0, ECPGst_normal); }
1960 : | IndexStmt
1961 0 : { output_statement($1, 0, ECPGst_normal); }
1962 : | InsertStmt
1963 224 : { output_statement($1, 1, ECPGst_prepnormal); }
1964 : | ListenStmt
1965 0 : { output_statement($1, 0, ECPGst_normal); }
1966 : | RefreshMatViewStmt
1967 0 : { output_statement($1, 0, ECPGst_normal); }
1968 : | LoadStmt
1969 0 : { output_statement($1, 0, ECPGst_normal); }
1970 : | LockStmt
1971 0 : { output_statement($1, 0, ECPGst_normal); }
1972 : | MergeStmt
1973 0 : { output_statement($1, 0, ECPGst_normal); }
1974 : | NotifyStmt
1975 0 : { output_statement($1, 0, ECPGst_normal); }
1976 : | PrepareStmt
1977 : {
1978 106 : check_declared_list($1.name);
1979 106 : if ($1.type == NULL)
1980 94 : output_prepare_statement($1.name, $1.stmt);
1981 12 : else if (strlen($1.type) == 0)
1982 : {
1983 2 : char *stmt = cat_str(3, mm_strdup("\""), $1.stmt, mm_strdup("\""));
1984 2 : output_prepare_statement($1.name, stmt);
1985 : }
1986 : else
1987 : {
1988 10 : if ($1.name[0] != '"')
1989 : /* case of char_variable */
1990 4 : add_variable_to_tail(&argsinsert, find_variable($1.name), &no_indicator);
1991 : else
1992 : {
1993 6 : char *length = mm_alloc(sizeof(int) * CHAR_BIT * 10 / 3);
1994 6 : char *str = mm_strdup($1.name + 1);
1995 :
1996 : /* It must be cut off double quotation because new_variable() double-quotes. */
1997 6 : str[strlen(str) - 1] = '\0';
1998 6 : sprintf(length, "%zu", strlen(str));
1999 6 : add_variable_to_tail(&argsinsert, new_variable(str, ECPGmake_simple_type(ECPGt_const, length, 0), 0), &no_indicator);
2000 : }
2001 10 : output_statement(cat_str(5, mm_strdup("prepare"), mm_strdup("$0"), $1.type, mm_strdup("as"), $1.stmt), 0, ECPGst_prepare);
2002 : }
2003 : }
2004 : | ReassignOwnedStmt
2005 0 : { output_statement($1, 0, ECPGst_normal); }
2006 : | ReindexStmt
2007 0 : { output_statement($1, 0, ECPGst_normal); }
2008 : | RemoveAggrStmt
2009 0 : { output_statement($1, 0, ECPGst_normal); }
2010 : | RemoveFuncStmt
2011 2 : { output_statement($1, 0, ECPGst_normal); }
2012 : | RemoveOperStmt
2013 0 : { output_statement($1, 0, ECPGst_normal); }
2014 : | RenameStmt
2015 0 : { output_statement($1, 0, ECPGst_normal); }
2016 : | RevokeStmt
2017 0 : { output_statement($1, 0, ECPGst_normal); }
2018 : | RevokeRoleStmt
2019 0 : { output_statement($1, 0, ECPGst_normal); }
2020 : | RuleStmt
2021 0 : { output_statement($1, 0, ECPGst_normal); }
2022 : | SecLabelStmt
2023 0 : { output_statement($1, 0, ECPGst_normal); }
2024 : | SelectStmt
2025 192 : { output_statement($1, 1, ECPGst_prepnormal); }
2026 : | TransactionStmt
2027 : {
2028 158 : fprintf(base_yyout, "{ ECPGtrans(__LINE__, %s, \"%s\");", connection ? connection : "NULL", $1);
2029 158 : whenever_action(2);
2030 158 : free($1);
2031 : }
2032 : | TruncateStmt
2033 44 : { output_statement($1, 0, ECPGst_normal); }
2034 : | UnlistenStmt
2035 0 : { output_statement($1, 0, ECPGst_normal); }
2036 : | UpdateStmt
2037 10 : { output_statement($1, 1, ECPGst_prepnormal); }
2038 : | VacuumStmt
2039 0 : { output_statement($1, 0, ECPGst_normal); }
2040 : | VariableResetStmt
2041 0 : { output_statement($1, 0, ECPGst_normal); }
2042 : | VariableSetStmt
2043 46 : { output_statement($1, 0, ECPGst_normal); }
2044 : | VariableShowStmt
2045 14 : { output_statement($1, 0, ECPGst_normal); }
2046 : | ViewStmt
2047 0 : { output_statement($1, 0, ECPGst_normal); }
2048 : | ECPGAllocateDescr
2049 : {
2050 36 : fprintf(base_yyout,"ECPGallocate_desc(__LINE__, %s);",$1);
2051 36 : whenever_action(0);
2052 36 : free($1);
2053 : }
2054 : | ECPGConnect
2055 : {
2056 184 : if (connection)
2057 0 : mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in CONNECT statement");
2058 :
2059 184 : fprintf(base_yyout, "{ ECPGconnect(__LINE__, %d, %s, %d); ", compat, $1, autocommit);
2060 184 : reset_variables();
2061 184 : whenever_action(2);
2062 184 : free($1);
2063 : }
2064 : | ECPGDeclareStmt
2065 : {
2066 10 : output_simple_statement($1, 0);
2067 : }
2068 : | ECPGCursorStmt
2069 : {
2070 40 : output_simple_statement($1, (strncmp($1, "ECPGset_var", strlen("ECPGset_var")) == 0) ? 4 : 0);
2071 : }
2072 : | ECPGDeallocateDescr
2073 : {
2074 32 : fprintf(base_yyout,"ECPGdeallocate_desc(__LINE__, %s);",$1);
2075 32 : whenever_action(0);
2076 32 : free($1);
2077 : }
2078 : | ECPGDeclare
2079 : {
2080 0 : output_simple_statement($1, 0);
2081 : }
2082 : | ECPGDescribe
2083 : {
2084 42 : check_declared_list($1.stmt_name);
2085 :
2086 42 : fprintf(base_yyout, "{ ECPGdescribe(__LINE__, %d, %d, %s, %s,", compat, $1.input, connection ? connection : "NULL", $1.stmt_name);
2087 42 : dump_variables(argsresult, 1);
2088 42 : fputs("ECPGt_EORT);", base_yyout);
2089 42 : fprintf(base_yyout, "}");
2090 42 : output_line_number();
2091 :
2092 42 : free($1.stmt_name);
2093 : }
2094 : | ECPGDisconnect
2095 : {
2096 170 : if (connection)
2097 0 : mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in DISCONNECT statement");
2098 :
2099 170 : fprintf(base_yyout, "{ ECPGdisconnect(__LINE__, %s);",
2100 170 : $1 ? $1 : "\"CURRENT\"");
2101 170 : whenever_action(2);
2102 170 : free($1);
2103 : }
2104 14 : | ECPGExecuteImmediateStmt { output_statement($1, 0, ECPGst_exec_immediate); }
2105 : | ECPGFree
2106 : {
2107 2 : const char *con = connection ? connection : "NULL";
2108 :
2109 2 : if (strcmp($1, "all") == 0)
2110 0 : fprintf(base_yyout, "{ ECPGdeallocate_all(__LINE__, %d, %s);", compat, con);
2111 2 : else if ($1[0] == ':')
2112 0 : fprintf(base_yyout, "{ ECPGdeallocate(__LINE__, %d, %s, %s);", compat, con, $1+1);
2113 : else
2114 2 : fprintf(base_yyout, "{ ECPGdeallocate(__LINE__, %d, %s, \"%s\");", compat, con, $1);
2115 :
2116 2 : whenever_action(2);
2117 2 : free($1);
2118 : }
2119 : | ECPGGetDescriptor
2120 : {
2121 62 : lookup_descriptor($1.name, connection);
2122 62 : output_get_descr($1.name, $1.str);
2123 62 : free($1.name);
2124 62 : free($1.str);
2125 : }
2126 : | ECPGGetDescriptorHeader
2127 : {
2128 22 : lookup_descriptor($1, connection);
2129 22 : output_get_descr_header($1);
2130 22 : free($1);
2131 : }
2132 : | ECPGOpen
2133 : {
2134 : struct cursor *ptr;
2135 :
2136 76 : if ((ptr = add_additional_variables($1, true)) != NULL)
2137 : {
2138 76 : connection = ptr->connection ? mm_strdup(ptr->connection) : NULL;
2139 76 : output_statement(mm_strdup(ptr->command), 0, ECPGst_normal);
2140 76 : ptr->opened = true;
2141 : }
2142 : }
2143 : | ECPGSetAutocommit
2144 : {
2145 24 : fprintf(base_yyout, "{ ECPGsetcommit(__LINE__, \"%s\", %s);", $1, connection ? connection : "NULL");
2146 24 : whenever_action(2);
2147 24 : free($1);
2148 : }
2149 : | ECPGSetConnection
2150 : {
2151 4 : if (connection)
2152 0 : mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in SET CONNECTION statement");
2153 :
2154 4 : fprintf(base_yyout, "{ ECPGsetconn(__LINE__, %s);", $1);
2155 4 : whenever_action(2);
2156 4 : free($1);
2157 : }
2158 : | ECPGSetDescriptor
2159 : {
2160 22 : lookup_descriptor($1.name, connection);
2161 22 : output_set_descr($1.name, $1.str);
2162 22 : free($1.name);
2163 22 : free($1.str);
2164 : }
2165 : | ECPGSetDescriptorHeader
2166 : {
2167 2 : lookup_descriptor($1, connection);
2168 2 : output_set_descr_header($1);
2169 2 : free($1);
2170 : }
2171 : | ECPGTypedef
2172 : {
2173 26 : if (connection)
2174 0 : mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in TYPE statement");
2175 :
2176 26 : fprintf(base_yyout, "%s", $1);
2177 26 : free($1);
2178 26 : output_line_number();
2179 : }
2180 : | ECPGVar
2181 : {
2182 4 : if (connection)
2183 0 : mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in VAR statement");
2184 :
2185 4 : output_simple_statement($1, 0);
2186 : }
2187 : | ECPGWhenever
2188 : {
2189 198 : if (connection)
2190 0 : mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in WHENEVER statement");
2191 :
2192 198 : output_simple_statement($1, 0);
2193 : }
2194 : |
2195 0 : { $$ = NULL; }
2196 : ;
2197 :
2198 :
2199 : opt_single_name:
2200 : ColId
2201 : {
2202 0 : $$ = $1;
2203 : }
2204 : |
2205 : {
2206 0 : $$=EMPTY; }
2207 : ;
2208 :
2209 :
2210 : opt_qualified_name:
2211 : any_name
2212 : {
2213 0 : $$ = $1;
2214 : }
2215 : |
2216 : {
2217 0 : $$=EMPTY; }
2218 : ;
2219 :
2220 :
2221 : opt_concurrently:
2222 : CONCURRENTLY
2223 : {
2224 0 : $$ = mm_strdup("concurrently");
2225 : }
2226 : |
2227 : {
2228 0 : $$=EMPTY; }
2229 : ;
2230 :
2231 :
2232 : opt_drop_behavior:
2233 : CASCADE
2234 : {
2235 0 : $$ = mm_strdup("cascade");
2236 : }
2237 : | RESTRICT
2238 : {
2239 0 : $$ = mm_strdup("restrict");
2240 : }
2241 : |
2242 : {
2243 122 : $$=EMPTY; }
2244 : ;
2245 :
2246 :
2247 : CallStmt:
2248 : CALL func_application
2249 : {
2250 0 : $$ = cat_str(2,mm_strdup("call"),$2);
2251 : }
2252 : ;
2253 :
2254 :
2255 : CreateRoleStmt:
2256 : CREATE ROLE RoleId opt_with OptRoleList
2257 : {
2258 0 : $$ = cat_str(4,mm_strdup("create role"),$3,$4,$5);
2259 : }
2260 : ;
2261 :
2262 :
2263 : opt_with:
2264 : WITH
2265 : {
2266 2 : $$ = mm_strdup("with");
2267 : }
2268 : | WITH_LA
2269 : {
2270 0 : $$ = mm_strdup("with");
2271 : }
2272 : |
2273 : {
2274 6 : $$=EMPTY; }
2275 : ;
2276 :
2277 :
2278 : OptRoleList:
2279 : OptRoleList CreateOptRoleElem
2280 : {
2281 0 : $$ = cat_str(2,$1,$2);
2282 : }
2283 : |
2284 : {
2285 0 : $$=EMPTY; }
2286 : ;
2287 :
2288 :
2289 : AlterOptRoleList:
2290 : AlterOptRoleList AlterOptRoleElem
2291 : {
2292 6 : $$ = cat_str(2,$1,$2);
2293 : }
2294 : |
2295 : {
2296 6 : $$=EMPTY; }
2297 : ;
2298 :
2299 :
2300 : AlterOptRoleElem:
2301 : PASSWORD ecpg_sconst
2302 : {
2303 0 : $$ = cat_str(2,mm_strdup("password"),$2);
2304 : }
2305 : | PASSWORD NULL_P
2306 : {
2307 0 : $$ = mm_strdup("password null");
2308 : }
2309 : | ENCRYPTED PASSWORD ecpg_sconst
2310 : {
2311 6 : $$ = cat_str(2,mm_strdup("encrypted password"),$3);
2312 : }
2313 : | UNENCRYPTED PASSWORD ecpg_sconst
2314 : {
2315 0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
2316 0 : $$ = cat_str(2,mm_strdup("unencrypted password"),$3);
2317 : }
2318 : | INHERIT
2319 : {
2320 0 : $$ = mm_strdup("inherit");
2321 : }
2322 : | CONNECTION LIMIT SignedIconst
2323 : {
2324 0 : $$ = cat_str(2,mm_strdup("connection limit"),$3);
2325 : }
2326 : | VALID UNTIL ecpg_sconst
2327 : {
2328 0 : $$ = cat_str(2,mm_strdup("valid until"),$3);
2329 : }
2330 : | USER role_list
2331 : {
2332 0 : $$ = cat_str(2,mm_strdup("user"),$2);
2333 : }
2334 : | ecpg_ident
2335 : {
2336 0 : $$ = $1;
2337 : }
2338 : ;
2339 :
2340 :
2341 : CreateOptRoleElem:
2342 : AlterOptRoleElem
2343 : {
2344 0 : $$ = $1;
2345 : }
2346 : | SYSID Iconst
2347 : {
2348 0 : $$ = cat_str(2,mm_strdup("sysid"),$2);
2349 : }
2350 : | ADMIN role_list
2351 : {
2352 0 : $$ = cat_str(2,mm_strdup("admin"),$2);
2353 : }
2354 : | ROLE role_list
2355 : {
2356 0 : $$ = cat_str(2,mm_strdup("role"),$2);
2357 : }
2358 : | IN_P ROLE role_list
2359 : {
2360 0 : $$ = cat_str(2,mm_strdup("in role"),$3);
2361 : }
2362 : | IN_P GROUP_P role_list
2363 : {
2364 0 : $$ = cat_str(2,mm_strdup("in group"),$3);
2365 : }
2366 : ;
2367 :
2368 :
2369 : CreateUserStmt:
2370 : CREATE USER RoleId opt_with OptRoleList
2371 : {
2372 0 : $$ = cat_str(4,mm_strdup("create user"),$3,$4,$5);
2373 : }
2374 : ;
2375 :
2376 :
2377 : AlterRoleStmt:
2378 : ALTER ROLE RoleSpec opt_with AlterOptRoleList
2379 : {
2380 0 : $$ = cat_str(4,mm_strdup("alter role"),$3,$4,$5);
2381 : }
2382 : | ALTER USER RoleSpec opt_with AlterOptRoleList
2383 : {
2384 6 : $$ = cat_str(4,mm_strdup("alter user"),$3,$4,$5);
2385 : }
2386 : ;
2387 :
2388 :
2389 : opt_in_database:
2390 :
2391 : {
2392 0 : $$=EMPTY; }
2393 : | IN_P DATABASE name
2394 : {
2395 0 : $$ = cat_str(2,mm_strdup("in database"),$3);
2396 : }
2397 : ;
2398 :
2399 :
2400 : AlterRoleSetStmt:
2401 : ALTER ROLE RoleSpec opt_in_database SetResetClause
2402 : {
2403 0 : $$ = cat_str(4,mm_strdup("alter role"),$3,$4,$5);
2404 : }
2405 : | ALTER ROLE ALL opt_in_database SetResetClause
2406 : {
2407 0 : $$ = cat_str(3,mm_strdup("alter role all"),$4,$5);
2408 : }
2409 : | ALTER USER RoleSpec opt_in_database SetResetClause
2410 : {
2411 0 : $$ = cat_str(4,mm_strdup("alter user"),$3,$4,$5);
2412 : }
2413 : | ALTER USER ALL opt_in_database SetResetClause
2414 : {
2415 0 : $$ = cat_str(3,mm_strdup("alter user all"),$4,$5);
2416 : }
2417 : ;
2418 :
2419 :
2420 : DropRoleStmt:
2421 : DROP ROLE role_list
2422 : {
2423 0 : $$ = cat_str(2,mm_strdup("drop role"),$3);
2424 : }
2425 : | DROP ROLE IF_P EXISTS role_list
2426 : {
2427 0 : $$ = cat_str(2,mm_strdup("drop role if exists"),$5);
2428 : }
2429 : | DROP USER role_list
2430 : {
2431 0 : $$ = cat_str(2,mm_strdup("drop user"),$3);
2432 : }
2433 : | DROP USER IF_P EXISTS role_list
2434 : {
2435 0 : $$ = cat_str(2,mm_strdup("drop user if exists"),$5);
2436 : }
2437 : | DROP GROUP_P role_list
2438 : {
2439 0 : $$ = cat_str(2,mm_strdup("drop group"),$3);
2440 : }
2441 : | DROP GROUP_P IF_P EXISTS role_list
2442 : {
2443 0 : $$ = cat_str(2,mm_strdup("drop group if exists"),$5);
2444 : }
2445 : ;
2446 :
2447 :
2448 : CreateGroupStmt:
2449 : CREATE GROUP_P RoleId opt_with OptRoleList
2450 : {
2451 0 : $$ = cat_str(4,mm_strdup("create group"),$3,$4,$5);
2452 : }
2453 : ;
2454 :
2455 :
2456 : AlterGroupStmt:
2457 : ALTER GROUP_P RoleSpec add_drop USER role_list
2458 : {
2459 0 : $$ = cat_str(5,mm_strdup("alter group"),$3,$4,mm_strdup("user"),$6);
2460 : }
2461 : ;
2462 :
2463 :
2464 : add_drop:
2465 : ADD_P
2466 : {
2467 0 : $$ = mm_strdup("add");
2468 : }
2469 : | DROP
2470 : {
2471 0 : $$ = mm_strdup("drop");
2472 : }
2473 : ;
2474 :
2475 :
2476 : CreateSchemaStmt:
2477 : CREATE SCHEMA opt_single_name AUTHORIZATION RoleSpec OptSchemaEltList
2478 : {
2479 0 : $$ = cat_str(5,mm_strdup("create schema"),$3,mm_strdup("authorization"),$5,$6);
2480 : }
2481 : | CREATE SCHEMA ColId OptSchemaEltList
2482 : {
2483 0 : $$ = cat_str(3,mm_strdup("create schema"),$3,$4);
2484 : }
2485 : | CREATE SCHEMA IF_P NOT EXISTS opt_single_name AUTHORIZATION RoleSpec OptSchemaEltList
2486 : {
2487 0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
2488 0 : $$ = cat_str(5,mm_strdup("create schema if not exists"),$6,mm_strdup("authorization"),$8,$9);
2489 : }
2490 : | CREATE SCHEMA IF_P NOT EXISTS ColId OptSchemaEltList
2491 : {
2492 0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
2493 0 : $$ = cat_str(3,mm_strdup("create schema if not exists"),$6,$7);
2494 : }
2495 : ;
2496 :
2497 :
2498 : OptSchemaEltList:
2499 : OptSchemaEltList schema_stmt
2500 : {
2501 0 : $$ = cat_str(2,$1,$2);
2502 : }
2503 : |
2504 : {
2505 0 : $$=EMPTY; }
2506 : ;
2507 :
2508 :
2509 : schema_stmt:
2510 : CreateStmt
2511 : {
2512 0 : $$ = $1;
2513 : }
2514 : | IndexStmt
2515 : {
2516 0 : $$ = $1;
2517 : }
2518 : | CreateSeqStmt
2519 : {
2520 0 : $$ = $1;
2521 : }
2522 : | CreateTrigStmt
2523 : {
2524 0 : $$ = $1;
2525 : }
2526 : | GrantStmt
2527 : {
2528 0 : $$ = $1;
2529 : }
2530 : | ViewStmt
2531 : {
2532 0 : $$ = $1;
2533 : }
2534 : ;
2535 :
2536 :
2537 : VariableSetStmt:
2538 : SET set_rest
2539 : {
2540 46 : $$ = cat_str(2,mm_strdup("set"),$2);
2541 : }
2542 : | SET LOCAL set_rest
2543 : {
2544 0 : $$ = cat_str(2,mm_strdup("set local"),$3);
2545 : }
2546 : | SET SESSION set_rest
2547 : {
2548 0 : $$ = cat_str(2,mm_strdup("set session"),$3);
2549 : }
2550 : ;
2551 :
2552 :
2553 : set_rest:
2554 : TRANSACTION transaction_mode_list
2555 : {
2556 2 : $$ = cat_str(2,mm_strdup("transaction"),$2);
2557 : }
2558 : | SESSION CHARACTERISTICS AS TRANSACTION transaction_mode_list
2559 : {
2560 0 : $$ = cat_str(2,mm_strdup("session characteristics as transaction"),$5);
2561 : }
2562 : | set_rest_more
2563 : {
2564 44 : $$ = $1;
2565 : }
2566 : ;
2567 :
2568 :
2569 : generic_set:
2570 : var_name TO var_list
2571 : {
2572 40 : $$ = cat_str(3,$1,mm_strdup("to"),$3);
2573 : }
2574 : | var_name '=' var_list
2575 : {
2576 2 : $$ = cat_str(3,$1,mm_strdup("="),$3);
2577 : }
2578 : | var_name TO DEFAULT
2579 : {
2580 0 : $$ = cat_str(2,$1,mm_strdup("to default"));
2581 : }
2582 : | var_name '=' DEFAULT
2583 : {
2584 0 : $$ = cat_str(2,$1,mm_strdup("= default"));
2585 : }
2586 : ;
2587 :
2588 :
2589 : set_rest_more:
2590 : generic_set
2591 : {
2592 42 : $$ = $1;
2593 : }
2594 : | var_name FROM CURRENT_P
2595 : {
2596 0 : $$ = cat_str(2,$1,mm_strdup("from current"));
2597 : }
2598 : | TIME ZONE zone_value
2599 : {
2600 2 : $$ = cat_str(2,mm_strdup("time zone"),$3);
2601 : }
2602 : | CATALOG_P ecpg_sconst
2603 : {
2604 0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
2605 0 : $$ = cat_str(2,mm_strdup("catalog"),$2);
2606 : }
2607 : | SCHEMA ecpg_sconst
2608 : {
2609 0 : $$ = cat_str(2,mm_strdup("schema"),$2);
2610 : }
2611 : | NAMES opt_encoding
2612 : {
2613 0 : $$ = cat_str(2,mm_strdup("names"),$2);
2614 : }
2615 : | ROLE NonReservedWord_or_Sconst
2616 : {
2617 0 : $$ = cat_str(2,mm_strdup("role"),$2);
2618 : }
2619 : | SESSION AUTHORIZATION NonReservedWord_or_Sconst
2620 : {
2621 0 : $$ = cat_str(2,mm_strdup("session authorization"),$3);
2622 : }
2623 : | SESSION AUTHORIZATION DEFAULT
2624 : {
2625 0 : $$ = mm_strdup("session authorization default");
2626 : }
2627 : | XML_P OPTION document_or_content
2628 : {
2629 0 : $$ = cat_str(2,mm_strdup("xml option"),$3);
2630 : }
2631 : | TRANSACTION SNAPSHOT ecpg_sconst
2632 : {
2633 0 : $$ = cat_str(2,mm_strdup("transaction snapshot"),$3);
2634 : }
2635 : ;
2636 :
2637 :
2638 : var_name:
2639 : ECPGColId
2640 : {
2641 52 : $$ = $1;
2642 : }
2643 : | var_name '.' ColId
2644 : {
2645 0 : $$ = cat_str(3,$1,mm_strdup("."),$3);
2646 : }
2647 : ;
2648 :
2649 :
2650 : var_list:
2651 : var_value
2652 : {
2653 42 : $$ = $1;
2654 : }
2655 : | var_list ',' var_value
2656 : {
2657 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
2658 : }
2659 : ;
2660 :
2661 :
2662 : var_value:
2663 : opt_boolean_or_string
2664 : {
2665 40 : $$ = $1;
2666 : }
2667 : | NumericOnly
2668 : {
2669 2 : if ($1[0] == '$')
2670 : {
2671 2 : free($1);
2672 2 : $1 = mm_strdup("$0");
2673 : }
2674 :
2675 2 : $$ = $1;
2676 : }
2677 : ;
2678 :
2679 :
2680 : iso_level:
2681 : READ UNCOMMITTED
2682 : {
2683 0 : $$ = mm_strdup("read uncommitted");
2684 : }
2685 : | READ COMMITTED
2686 : {
2687 2 : $$ = mm_strdup("read committed");
2688 : }
2689 : | REPEATABLE READ
2690 : {
2691 0 : $$ = mm_strdup("repeatable read");
2692 : }
2693 : | SERIALIZABLE
2694 : {
2695 0 : $$ = mm_strdup("serializable");
2696 : }
2697 : ;
2698 :
2699 :
2700 : opt_boolean_or_string:
2701 : TRUE_P
2702 : {
2703 0 : $$ = mm_strdup("true");
2704 : }
2705 : | FALSE_P
2706 : {
2707 0 : $$ = mm_strdup("false");
2708 : }
2709 : | ON
2710 : {
2711 4 : $$ = mm_strdup("on");
2712 : }
2713 : | NonReservedWord_or_Sconst
2714 : {
2715 36 : $$ = $1;
2716 : }
2717 : ;
2718 :
2719 :
2720 : zone_value:
2721 : ecpg_sconst
2722 : {
2723 0 : $$ = $1;
2724 : }
2725 : | ecpg_ident
2726 : {
2727 2 : $$ = $1;
2728 : }
2729 : | ConstInterval ecpg_sconst opt_interval
2730 : {
2731 0 : $$ = cat_str(3,$1,$2,$3);
2732 : }
2733 : | ConstInterval '(' Iconst ')' ecpg_sconst
2734 : {
2735 0 : $$ = cat_str(5,$1,mm_strdup("("),$3,mm_strdup(")"),$5);
2736 : }
2737 : | NumericOnly
2738 : {
2739 0 : $$ = $1;
2740 : }
2741 : | DEFAULT
2742 : {
2743 0 : $$ = mm_strdup("default");
2744 : }
2745 : | LOCAL
2746 : {
2747 0 : $$ = mm_strdup("local");
2748 : }
2749 : ;
2750 :
2751 :
2752 : opt_encoding:
2753 : ecpg_sconst
2754 : {
2755 0 : $$ = $1;
2756 : }
2757 : | DEFAULT
2758 : {
2759 0 : $$ = mm_strdup("default");
2760 : }
2761 : |
2762 : {
2763 0 : $$=EMPTY; }
2764 : ;
2765 :
2766 :
2767 : NonReservedWord_or_Sconst:
2768 : NonReservedWord
2769 : {
2770 32 : $$ = $1;
2771 : }
2772 : | ecpg_sconst
2773 : {
2774 6 : $$ = $1;
2775 : }
2776 : ;
2777 :
2778 :
2779 : VariableResetStmt:
2780 : RESET reset_rest
2781 : {
2782 0 : $$ = cat_str(2,mm_strdup("reset"),$2);
2783 : }
2784 : ;
2785 :
2786 :
2787 : reset_rest:
2788 : generic_reset
2789 : {
2790 0 : $$ = $1;
2791 : }
2792 : | TIME ZONE
2793 : {
2794 0 : $$ = mm_strdup("time zone");
2795 : }
2796 : | TRANSACTION ISOLATION LEVEL
2797 : {
2798 0 : $$ = mm_strdup("transaction isolation level");
2799 : }
2800 : | SESSION AUTHORIZATION
2801 : {
2802 0 : $$ = mm_strdup("session authorization");
2803 : }
2804 : ;
2805 :
2806 :
2807 : generic_reset:
2808 : var_name
2809 : {
2810 0 : $$ = $1;
2811 : }
2812 : | ALL
2813 : {
2814 0 : $$ = mm_strdup("all");
2815 : }
2816 : ;
2817 :
2818 :
2819 : SetResetClause:
2820 : SET set_rest
2821 : {
2822 0 : $$ = cat_str(2,mm_strdup("set"),$2);
2823 : }
2824 : | VariableResetStmt
2825 : {
2826 0 : $$ = $1;
2827 : }
2828 : ;
2829 :
2830 :
2831 : FunctionSetResetClause:
2832 : SET set_rest_more
2833 : {
2834 0 : $$ = cat_str(2,mm_strdup("set"),$2);
2835 : }
2836 : | VariableResetStmt
2837 : {
2838 0 : $$ = $1;
2839 : }
2840 : ;
2841 :
2842 :
2843 : VariableShowStmt:
2844 : SHOW var_name ecpg_into
2845 : {
2846 10 : $$ = cat_str(2,mm_strdup("show"),$2);
2847 : }
2848 : | SHOW TIME ZONE ecpg_into
2849 : {
2850 2 : $$ = mm_strdup("show time zone");
2851 : }
2852 : | SHOW TRANSACTION ISOLATION LEVEL ecpg_into
2853 : {
2854 2 : $$ = mm_strdup("show transaction isolation level");
2855 : }
2856 : | SHOW SESSION AUTHORIZATION ecpg_into
2857 : {
2858 0 : $$ = mm_strdup("show session authorization");
2859 : }
2860 : | SHOW ALL
2861 : {
2862 0 : mmerror(PARSE_ERROR, ET_ERROR, "SHOW ALL is not implemented");
2863 0 : $$ = EMPTY;
2864 : }
2865 : ;
2866 :
2867 :
2868 : ConstraintsSetStmt:
2869 : SET CONSTRAINTS constraints_set_list constraints_set_mode
2870 : {
2871 0 : $$ = cat_str(3,mm_strdup("set constraints"),$3,$4);
2872 : }
2873 : ;
2874 :
2875 :
2876 : constraints_set_list:
2877 : ALL
2878 : {
2879 0 : $$ = mm_strdup("all");
2880 : }
2881 : | qualified_name_list
2882 : {
2883 0 : $$ = $1;
2884 : }
2885 : ;
2886 :
2887 :
2888 : constraints_set_mode:
2889 : DEFERRED
2890 : {
2891 0 : $$ = mm_strdup("deferred");
2892 : }
2893 : | IMMEDIATE
2894 : {
2895 0 : $$ = mm_strdup("immediate");
2896 : }
2897 : ;
2898 :
2899 :
2900 : CheckPointStmt:
2901 : CHECKPOINT
2902 : {
2903 0 : $$ = mm_strdup("checkpoint");
2904 : }
2905 : ;
2906 :
2907 :
2908 : DiscardStmt:
2909 : DISCARD ALL
2910 : {
2911 0 : $$ = mm_strdup("discard all");
2912 : }
2913 : | DISCARD TEMP
2914 : {
2915 0 : $$ = mm_strdup("discard temp");
2916 : }
2917 : | DISCARD TEMPORARY
2918 : {
2919 0 : $$ = mm_strdup("discard temporary");
2920 : }
2921 : | DISCARD PLANS
2922 : {
2923 0 : $$ = mm_strdup("discard plans");
2924 : }
2925 : | DISCARD SEQUENCES
2926 : {
2927 0 : $$ = mm_strdup("discard sequences");
2928 : }
2929 : ;
2930 :
2931 :
2932 : AlterTableStmt:
2933 : ALTER TABLE relation_expr alter_table_cmds
2934 : {
2935 4 : $$ = cat_str(3,mm_strdup("alter table"),$3,$4);
2936 : }
2937 : | ALTER TABLE IF_P EXISTS relation_expr alter_table_cmds
2938 : {
2939 0 : $$ = cat_str(3,mm_strdup("alter table if exists"),$5,$6);
2940 : }
2941 : | ALTER TABLE relation_expr partition_cmd
2942 : {
2943 0 : $$ = cat_str(3,mm_strdup("alter table"),$3,$4);
2944 : }
2945 : | ALTER TABLE IF_P EXISTS relation_expr partition_cmd
2946 : {
2947 0 : $$ = cat_str(3,mm_strdup("alter table if exists"),$5,$6);
2948 : }
2949 : | ALTER TABLE ALL IN_P TABLESPACE name SET TABLESPACE name opt_nowait
2950 : {
2951 0 : $$ = cat_str(5,mm_strdup("alter table all in tablespace"),$6,mm_strdup("set tablespace"),$9,$10);
2952 : }
2953 : | ALTER TABLE ALL IN_P TABLESPACE name OWNED BY role_list SET TABLESPACE name opt_nowait
2954 : {
2955 0 : $$ = cat_str(7,mm_strdup("alter table all in tablespace"),$6,mm_strdup("owned by"),$9,mm_strdup("set tablespace"),$12,$13);
2956 : }
2957 : | ALTER INDEX qualified_name alter_table_cmds
2958 : {
2959 0 : $$ = cat_str(3,mm_strdup("alter index"),$3,$4);
2960 : }
2961 : | ALTER INDEX IF_P EXISTS qualified_name alter_table_cmds
2962 : {
2963 0 : $$ = cat_str(3,mm_strdup("alter index if exists"),$5,$6);
2964 : }
2965 : | ALTER INDEX qualified_name index_partition_cmd
2966 : {
2967 0 : $$ = cat_str(3,mm_strdup("alter index"),$3,$4);
2968 : }
2969 : | ALTER INDEX ALL IN_P TABLESPACE name SET TABLESPACE name opt_nowait
2970 : {
2971 0 : $$ = cat_str(5,mm_strdup("alter index all in tablespace"),$6,mm_strdup("set tablespace"),$9,$10);
2972 : }
2973 : | ALTER INDEX ALL IN_P TABLESPACE name OWNED BY role_list SET TABLESPACE name opt_nowait
2974 : {
2975 0 : $$ = cat_str(7,mm_strdup("alter index all in tablespace"),$6,mm_strdup("owned by"),$9,mm_strdup("set tablespace"),$12,$13);
2976 : }
2977 : | ALTER SEQUENCE qualified_name alter_table_cmds
2978 : {
2979 0 : $$ = cat_str(3,mm_strdup("alter sequence"),$3,$4);
2980 : }
2981 : | ALTER SEQUENCE IF_P EXISTS qualified_name alter_table_cmds
2982 : {
2983 0 : $$ = cat_str(3,mm_strdup("alter sequence if exists"),$5,$6);
2984 : }
2985 : | ALTER VIEW qualified_name alter_table_cmds
2986 : {
2987 0 : $$ = cat_str(3,mm_strdup("alter view"),$3,$4);
2988 : }
2989 : | ALTER VIEW IF_P EXISTS qualified_name alter_table_cmds
2990 : {
2991 0 : $$ = cat_str(3,mm_strdup("alter view if exists"),$5,$6);
2992 : }
2993 : | ALTER MATERIALIZED VIEW qualified_name alter_table_cmds
2994 : {
2995 0 : $$ = cat_str(3,mm_strdup("alter materialized view"),$4,$5);
2996 : }
2997 : | ALTER MATERIALIZED VIEW IF_P EXISTS qualified_name alter_table_cmds
2998 : {
2999 0 : $$ = cat_str(3,mm_strdup("alter materialized view if exists"),$6,$7);
3000 : }
3001 : | ALTER MATERIALIZED VIEW ALL IN_P TABLESPACE name SET TABLESPACE name opt_nowait
3002 : {
3003 0 : $$ = cat_str(5,mm_strdup("alter materialized view all in tablespace"),$7,mm_strdup("set tablespace"),$10,$11);
3004 : }
3005 : | ALTER MATERIALIZED VIEW ALL IN_P TABLESPACE name OWNED BY role_list SET TABLESPACE name opt_nowait
3006 : {
3007 0 : $$ = cat_str(7,mm_strdup("alter materialized view all in tablespace"),$7,mm_strdup("owned by"),$10,mm_strdup("set tablespace"),$13,$14);
3008 : }
3009 : | ALTER FOREIGN TABLE relation_expr alter_table_cmds
3010 : {
3011 0 : $$ = cat_str(3,mm_strdup("alter foreign table"),$4,$5);
3012 : }
3013 : | ALTER FOREIGN TABLE IF_P EXISTS relation_expr alter_table_cmds
3014 : {
3015 0 : $$ = cat_str(3,mm_strdup("alter foreign table if exists"),$6,$7);
3016 : }
3017 : ;
3018 :
3019 :
3020 : alter_table_cmds:
3021 : alter_table_cmd
3022 : {
3023 4 : $$ = $1;
3024 : }
3025 : | alter_table_cmds ',' alter_table_cmd
3026 : {
3027 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
3028 : }
3029 : ;
3030 :
3031 :
3032 : partition_cmd:
3033 : ATTACH PARTITION qualified_name PartitionBoundSpec
3034 : {
3035 0 : $$ = cat_str(3,mm_strdup("attach partition"),$3,$4);
3036 : }
3037 : | DETACH PARTITION qualified_name opt_concurrently
3038 : {
3039 0 : $$ = cat_str(3,mm_strdup("detach partition"),$3,$4);
3040 : }
3041 : | DETACH PARTITION qualified_name FINALIZE
3042 : {
3043 0 : $$ = cat_str(3,mm_strdup("detach partition"),$3,mm_strdup("finalize"));
3044 : }
3045 : ;
3046 :
3047 :
3048 : index_partition_cmd:
3049 : ATTACH PARTITION qualified_name
3050 : {
3051 0 : $$ = cat_str(2,mm_strdup("attach partition"),$3);
3052 : }
3053 : ;
3054 :
3055 :
3056 : alter_table_cmd:
3057 : ADD_P columnDef
3058 : {
3059 0 : $$ = cat_str(2,mm_strdup("add"),$2);
3060 : }
3061 : | ADD_P IF_P NOT EXISTS columnDef
3062 : {
3063 0 : $$ = cat_str(2,mm_strdup("add if not exists"),$5);
3064 : }
3065 : | ADD_P COLUMN columnDef
3066 : {
3067 0 : $$ = cat_str(2,mm_strdup("add column"),$3);
3068 : }
3069 : | ADD_P COLUMN IF_P NOT EXISTS columnDef
3070 : {
3071 0 : $$ = cat_str(2,mm_strdup("add column if not exists"),$6);
3072 : }
3073 : | ALTER opt_column ColId alter_column_default
3074 : {
3075 0 : $$ = cat_str(4,mm_strdup("alter"),$2,$3,$4);
3076 : }
3077 : | ALTER opt_column ColId DROP NOT NULL_P
3078 : {
3079 0 : $$ = cat_str(4,mm_strdup("alter"),$2,$3,mm_strdup("drop not null"));
3080 : }
3081 : | ALTER opt_column ColId SET NOT NULL_P
3082 : {
3083 0 : $$ = cat_str(4,mm_strdup("alter"),$2,$3,mm_strdup("set not null"));
3084 : }
3085 : | ALTER opt_column ColId DROP EXPRESSION
3086 : {
3087 0 : $$ = cat_str(4,mm_strdup("alter"),$2,$3,mm_strdup("drop expression"));
3088 : }
3089 : | ALTER opt_column ColId DROP EXPRESSION IF_P EXISTS
3090 : {
3091 0 : $$ = cat_str(4,mm_strdup("alter"),$2,$3,mm_strdup("drop expression if exists"));
3092 : }
3093 : | ALTER opt_column ColId SET STATISTICS SignedIconst
3094 : {
3095 0 : $$ = cat_str(5,mm_strdup("alter"),$2,$3,mm_strdup("set statistics"),$6);
3096 : }
3097 : | ALTER opt_column Iconst SET STATISTICS SignedIconst
3098 : {
3099 0 : $$ = cat_str(5,mm_strdup("alter"),$2,$3,mm_strdup("set statistics"),$6);
3100 : }
3101 : | ALTER opt_column ColId SET reloptions
3102 : {
3103 0 : $$ = cat_str(5,mm_strdup("alter"),$2,$3,mm_strdup("set"),$5);
3104 : }
3105 : | ALTER opt_column ColId RESET reloptions
3106 : {
3107 0 : $$ = cat_str(5,mm_strdup("alter"),$2,$3,mm_strdup("reset"),$5);
3108 : }
3109 : | ALTER opt_column ColId SET column_storage
3110 : {
3111 0 : $$ = cat_str(5,mm_strdup("alter"),$2,$3,mm_strdup("set"),$5);
3112 : }
3113 : | ALTER opt_column ColId SET column_compression
3114 : {
3115 0 : $$ = cat_str(5,mm_strdup("alter"),$2,$3,mm_strdup("set"),$5);
3116 : }
3117 : | ALTER opt_column ColId ADD_P GENERATED generated_when AS IDENTITY_P OptParenthesizedSeqOptList
3118 : {
3119 0 : $$ = cat_str(7,mm_strdup("alter"),$2,$3,mm_strdup("add generated"),$6,mm_strdup("as identity"),$9);
3120 : }
3121 : | ALTER opt_column ColId alter_identity_column_option_list
3122 : {
3123 0 : $$ = cat_str(4,mm_strdup("alter"),$2,$3,$4);
3124 : }
3125 : | ALTER opt_column ColId DROP IDENTITY_P
3126 : {
3127 0 : $$ = cat_str(4,mm_strdup("alter"),$2,$3,mm_strdup("drop identity"));
3128 : }
3129 : | ALTER opt_column ColId DROP IDENTITY_P IF_P EXISTS
3130 : {
3131 0 : $$ = cat_str(4,mm_strdup("alter"),$2,$3,mm_strdup("drop identity if exists"));
3132 : }
3133 : | DROP opt_column IF_P EXISTS ColId opt_drop_behavior
3134 : {
3135 0 : $$ = cat_str(5,mm_strdup("drop"),$2,mm_strdup("if exists"),$5,$6);
3136 : }
3137 : | DROP opt_column ColId opt_drop_behavior
3138 : {
3139 0 : $$ = cat_str(4,mm_strdup("drop"),$2,$3,$4);
3140 : }
3141 : | ALTER opt_column ColId opt_set_data TYPE_P Typename opt_collate_clause alter_using
3142 : {
3143 4 : $$ = cat_str(8,mm_strdup("alter"),$2,$3,$4,mm_strdup("type"),$6,$7,$8);
3144 : }
3145 : | ALTER opt_column ColId alter_generic_options
3146 : {
3147 0 : $$ = cat_str(4,mm_strdup("alter"),$2,$3,$4);
3148 : }
3149 : | ADD_P TableConstraint
3150 : {
3151 0 : $$ = cat_str(2,mm_strdup("add"),$2);
3152 : }
3153 : | ALTER CONSTRAINT name ConstraintAttributeSpec
3154 : {
3155 0 : $$ = cat_str(3,mm_strdup("alter constraint"),$3,$4);
3156 : }
3157 : | VALIDATE CONSTRAINT name
3158 : {
3159 0 : $$ = cat_str(2,mm_strdup("validate constraint"),$3);
3160 : }
3161 : | DROP CONSTRAINT IF_P EXISTS name opt_drop_behavior
3162 : {
3163 0 : $$ = cat_str(3,mm_strdup("drop constraint if exists"),$5,$6);
3164 : }
3165 : | DROP CONSTRAINT name opt_drop_behavior
3166 : {
3167 0 : $$ = cat_str(3,mm_strdup("drop constraint"),$3,$4);
3168 : }
3169 : | SET WITHOUT OIDS
3170 : {
3171 0 : $$ = mm_strdup("set without oids");
3172 : }
3173 : | CLUSTER ON name
3174 : {
3175 0 : $$ = cat_str(2,mm_strdup("cluster on"),$3);
3176 : }
3177 : | SET WITHOUT CLUSTER
3178 : {
3179 0 : $$ = mm_strdup("set without cluster");
3180 : }
3181 : | SET LOGGED
3182 : {
3183 0 : $$ = mm_strdup("set logged");
3184 : }
3185 : | SET UNLOGGED
3186 : {
3187 0 : $$ = mm_strdup("set unlogged");
3188 : }
3189 : | ENABLE_P TRIGGER name
3190 : {
3191 0 : $$ = cat_str(2,mm_strdup("enable trigger"),$3);
3192 : }
3193 : | ENABLE_P ALWAYS TRIGGER name
3194 : {
3195 0 : $$ = cat_str(2,mm_strdup("enable always trigger"),$4);
3196 : }
3197 : | ENABLE_P REPLICA TRIGGER name
3198 : {
3199 0 : $$ = cat_str(2,mm_strdup("enable replica trigger"),$4);
3200 : }
3201 : | ENABLE_P TRIGGER ALL
3202 : {
3203 0 : $$ = mm_strdup("enable trigger all");
3204 : }
3205 : | ENABLE_P TRIGGER USER
3206 : {
3207 0 : $$ = mm_strdup("enable trigger user");
3208 : }
3209 : | DISABLE_P TRIGGER name
3210 : {
3211 0 : $$ = cat_str(2,mm_strdup("disable trigger"),$3);
3212 : }
3213 : | DISABLE_P TRIGGER ALL
3214 : {
3215 0 : $$ = mm_strdup("disable trigger all");
3216 : }
3217 : | DISABLE_P TRIGGER USER
3218 : {
3219 0 : $$ = mm_strdup("disable trigger user");
3220 : }
3221 : | ENABLE_P RULE name
3222 : {
3223 0 : $$ = cat_str(2,mm_strdup("enable rule"),$3);
3224 : }
3225 : | ENABLE_P ALWAYS RULE name
3226 : {
3227 0 : $$ = cat_str(2,mm_strdup("enable always rule"),$4);
3228 : }
3229 : | ENABLE_P REPLICA RULE name
3230 : {
3231 0 : $$ = cat_str(2,mm_strdup("enable replica rule"),$4);
3232 : }
3233 : | DISABLE_P RULE name
3234 : {
3235 0 : $$ = cat_str(2,mm_strdup("disable rule"),$3);
3236 : }
3237 : | INHERIT qualified_name
3238 : {
3239 0 : $$ = cat_str(2,mm_strdup("inherit"),$2);
3240 : }
3241 : | NO INHERIT qualified_name
3242 : {
3243 0 : $$ = cat_str(2,mm_strdup("no inherit"),$3);
3244 : }
3245 : | OF any_name
3246 : {
3247 0 : $$ = cat_str(2,mm_strdup("of"),$2);
3248 : }
3249 : | NOT OF
3250 : {
3251 0 : $$ = mm_strdup("not of");
3252 : }
3253 : | OWNER TO RoleSpec
3254 : {
3255 0 : $$ = cat_str(2,mm_strdup("owner to"),$3);
3256 : }
3257 : | SET ACCESS METHOD name
3258 : {
3259 0 : $$ = cat_str(2,mm_strdup("set access method"),$4);
3260 : }
3261 : | SET TABLESPACE name
3262 : {
3263 0 : $$ = cat_str(2,mm_strdup("set tablespace"),$3);
3264 : }
3265 : | SET reloptions
3266 : {
3267 0 : $$ = cat_str(2,mm_strdup("set"),$2);
3268 : }
3269 : | RESET reloptions
3270 : {
3271 0 : $$ = cat_str(2,mm_strdup("reset"),$2);
3272 : }
3273 : | REPLICA IDENTITY_P replica_identity
3274 : {
3275 0 : $$ = cat_str(2,mm_strdup("replica identity"),$3);
3276 : }
3277 : | ENABLE_P ROW LEVEL SECURITY
3278 : {
3279 0 : $$ = mm_strdup("enable row level security");
3280 : }
3281 : | DISABLE_P ROW LEVEL SECURITY
3282 : {
3283 0 : $$ = mm_strdup("disable row level security");
3284 : }
3285 : | FORCE ROW LEVEL SECURITY
3286 : {
3287 0 : $$ = mm_strdup("force row level security");
3288 : }
3289 : | NO FORCE ROW LEVEL SECURITY
3290 : {
3291 0 : $$ = mm_strdup("no force row level security");
3292 : }
3293 : | alter_generic_options
3294 : {
3295 0 : $$ = $1;
3296 : }
3297 : ;
3298 :
3299 :
3300 : alter_column_default:
3301 : SET DEFAULT a_expr
3302 : {
3303 0 : $$ = cat_str(2,mm_strdup("set default"),$3);
3304 : }
3305 : | DROP DEFAULT
3306 : {
3307 0 : $$ = mm_strdup("drop default");
3308 : }
3309 : ;
3310 :
3311 :
3312 : opt_collate_clause:
3313 : COLLATE any_name
3314 : {
3315 0 : $$ = cat_str(2,mm_strdup("collate"),$2);
3316 : }
3317 : |
3318 : {
3319 4 : $$=EMPTY; }
3320 : ;
3321 :
3322 :
3323 : alter_using:
3324 : USING a_expr
3325 : {
3326 0 : $$ = cat_str(2,mm_strdup("using"),$2);
3327 : }
3328 : |
3329 : {
3330 4 : $$=EMPTY; }
3331 : ;
3332 :
3333 :
3334 : replica_identity:
3335 : NOTHING
3336 : {
3337 0 : $$ = mm_strdup("nothing");
3338 : }
3339 : | FULL
3340 : {
3341 0 : $$ = mm_strdup("full");
3342 : }
3343 : | DEFAULT
3344 : {
3345 0 : $$ = mm_strdup("default");
3346 : }
3347 : | USING INDEX name
3348 : {
3349 0 : $$ = cat_str(2,mm_strdup("using index"),$3);
3350 : }
3351 : ;
3352 :
3353 :
3354 : reloptions:
3355 : '(' reloption_list ')'
3356 : {
3357 0 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
3358 : }
3359 : ;
3360 :
3361 :
3362 : opt_reloptions:
3363 : WITH reloptions
3364 : {
3365 0 : $$ = cat_str(2,mm_strdup("with"),$2);
3366 : }
3367 : |
3368 : {
3369 0 : $$=EMPTY; }
3370 : ;
3371 :
3372 :
3373 : reloption_list:
3374 : reloption_elem
3375 : {
3376 0 : $$ = $1;
3377 : }
3378 : | reloption_list ',' reloption_elem
3379 : {
3380 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
3381 : }
3382 : ;
3383 :
3384 :
3385 : reloption_elem:
3386 : ColLabel '=' def_arg
3387 : {
3388 0 : $$ = cat_str(3,$1,mm_strdup("="),$3);
3389 : }
3390 : | ColLabel
3391 : {
3392 0 : $$ = $1;
3393 : }
3394 : | ColLabel '.' ColLabel '=' def_arg
3395 : {
3396 0 : $$ = cat_str(5,$1,mm_strdup("."),$3,mm_strdup("="),$5);
3397 : }
3398 : | ColLabel '.' ColLabel
3399 : {
3400 0 : $$ = cat_str(3,$1,mm_strdup("."),$3);
3401 : }
3402 : ;
3403 :
3404 :
3405 : alter_identity_column_option_list:
3406 : alter_identity_column_option
3407 : {
3408 0 : $$ = $1;
3409 : }
3410 : | alter_identity_column_option_list alter_identity_column_option
3411 : {
3412 0 : $$ = cat_str(2,$1,$2);
3413 : }
3414 : ;
3415 :
3416 :
3417 : alter_identity_column_option:
3418 : RESTART
3419 : {
3420 0 : $$ = mm_strdup("restart");
3421 : }
3422 : | RESTART opt_with NumericOnly
3423 : {
3424 0 : $$ = cat_str(3,mm_strdup("restart"),$2,$3);
3425 : }
3426 : | SET SeqOptElem
3427 : {
3428 0 : $$ = cat_str(2,mm_strdup("set"),$2);
3429 : }
3430 : | SET GENERATED generated_when
3431 : {
3432 0 : $$ = cat_str(2,mm_strdup("set generated"),$3);
3433 : }
3434 : ;
3435 :
3436 :
3437 : PartitionBoundSpec:
3438 : FOR VALUES WITH '(' hash_partbound ')'
3439 : {
3440 0 : $$ = cat_str(3,mm_strdup("for values with ("),$5,mm_strdup(")"));
3441 : }
3442 : | FOR VALUES IN_P '(' expr_list ')'
3443 : {
3444 0 : $$ = cat_str(3,mm_strdup("for values in ("),$5,mm_strdup(")"));
3445 : }
3446 : | FOR VALUES FROM '(' expr_list ')' TO '(' expr_list ')'
3447 : {
3448 0 : $$ = cat_str(5,mm_strdup("for values from ("),$5,mm_strdup(") to ("),$9,mm_strdup(")"));
3449 : }
3450 : | DEFAULT
3451 : {
3452 0 : $$ = mm_strdup("default");
3453 : }
3454 : ;
3455 :
3456 :
3457 : hash_partbound_elem:
3458 : NonReservedWord Iconst
3459 : {
3460 0 : $$ = cat_str(2,$1,$2);
3461 : }
3462 : ;
3463 :
3464 :
3465 : hash_partbound:
3466 : hash_partbound_elem
3467 : {
3468 0 : $$ = $1;
3469 : }
3470 : | hash_partbound ',' hash_partbound_elem
3471 : {
3472 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
3473 : }
3474 : ;
3475 :
3476 :
3477 : AlterCompositeTypeStmt:
3478 : ALTER TYPE_P any_name alter_type_cmds
3479 : {
3480 0 : $$ = cat_str(3,mm_strdup("alter type"),$3,$4);
3481 : }
3482 : ;
3483 :
3484 :
3485 : alter_type_cmds:
3486 : alter_type_cmd
3487 : {
3488 0 : $$ = $1;
3489 : }
3490 : | alter_type_cmds ',' alter_type_cmd
3491 : {
3492 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
3493 : }
3494 : ;
3495 :
3496 :
3497 : alter_type_cmd:
3498 : ADD_P ATTRIBUTE TableFuncElement opt_drop_behavior
3499 : {
3500 0 : $$ = cat_str(3,mm_strdup("add attribute"),$3,$4);
3501 : }
3502 : | DROP ATTRIBUTE IF_P EXISTS ColId opt_drop_behavior
3503 : {
3504 0 : $$ = cat_str(3,mm_strdup("drop attribute if exists"),$5,$6);
3505 : }
3506 : | DROP ATTRIBUTE ColId opt_drop_behavior
3507 : {
3508 0 : $$ = cat_str(3,mm_strdup("drop attribute"),$3,$4);
3509 : }
3510 : | ALTER ATTRIBUTE ColId opt_set_data TYPE_P Typename opt_collate_clause opt_drop_behavior
3511 : {
3512 0 : $$ = cat_str(7,mm_strdup("alter attribute"),$3,$4,mm_strdup("type"),$6,$7,$8);
3513 : }
3514 : ;
3515 :
3516 :
3517 : ClosePortalStmt:
3518 : CLOSE cursor_name
3519 : {
3520 76 : char *cursor_marker = $2[0] == ':' ? mm_strdup("$0") : $2;
3521 76 : struct cursor *ptr = NULL;
3522 80 : for (ptr = cur; ptr != NULL; ptr = ptr -> next)
3523 : {
3524 76 : if (strcmp($2, ptr -> name) == 0)
3525 : {
3526 72 : if (ptr -> connection)
3527 16 : connection = mm_strdup(ptr -> connection);
3528 :
3529 72 : break;
3530 : }
3531 : }
3532 76 : $$ = cat2_str(mm_strdup("close"), cursor_marker);
3533 : }
3534 : | CLOSE ALL
3535 : {
3536 0 : $$ = mm_strdup("close all");
3537 : }
3538 : ;
3539 :
3540 :
3541 : CopyStmt:
3542 : COPY opt_binary qualified_name opt_column_list copy_from opt_program copy_file_name copy_delimiter opt_with copy_options where_clause
3543 : {
3544 2 : if (strcmp($6, "from") == 0 &&
3545 0 : (strcmp($7, "stdin") == 0 || strcmp($7, "stdout") == 0))
3546 0 : mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented");
3547 :
3548 2 : $$ = cat_str(11,mm_strdup("copy"),$2,$3,$4,$5,$6,$7,$8,$9,$10,$11);
3549 : }
3550 : | COPY '(' PreparableStmt ')' TO opt_program copy_file_name opt_with copy_options
3551 : {
3552 0 : $$ = cat_str(7,mm_strdup("copy ("),$3,mm_strdup(") to"),$6,$7,$8,$9);
3553 : }
3554 : ;
3555 :
3556 :
3557 : copy_from:
3558 : FROM
3559 : {
3560 0 : $$ = mm_strdup("from");
3561 : }
3562 : | TO
3563 : {
3564 2 : $$ = mm_strdup("to");
3565 : }
3566 : ;
3567 :
3568 :
3569 : opt_program:
3570 : PROGRAM
3571 : {
3572 0 : $$ = mm_strdup("program");
3573 : }
3574 : |
3575 : {
3576 2 : $$=EMPTY; }
3577 : ;
3578 :
3579 :
3580 : copy_file_name:
3581 : ecpg_sconst
3582 : {
3583 0 : $$ = $1;
3584 : }
3585 : | STDIN
3586 : {
3587 0 : $$ = mm_strdup("stdin");
3588 : }
3589 : | STDOUT
3590 : {
3591 2 : $$ = mm_strdup("stdout");
3592 : }
3593 : ;
3594 :
3595 :
3596 : copy_options:
3597 : copy_opt_list
3598 : {
3599 2 : $$ = $1;
3600 : }
3601 : | '(' copy_generic_opt_list ')'
3602 : {
3603 0 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
3604 : }
3605 : ;
3606 :
3607 :
3608 : copy_opt_list:
3609 : copy_opt_list copy_opt_item
3610 : {
3611 2 : $$ = cat_str(2,$1,$2);
3612 : }
3613 : |
3614 : {
3615 2 : $$=EMPTY; }
3616 : ;
3617 :
3618 :
3619 : copy_opt_item:
3620 : BINARY
3621 : {
3622 0 : $$ = mm_strdup("binary");
3623 : }
3624 : | FREEZE
3625 : {
3626 0 : $$ = mm_strdup("freeze");
3627 : }
3628 : | DELIMITER opt_as ecpg_sconst
3629 : {
3630 2 : $$ = cat_str(3,mm_strdup("delimiter"),$2,$3);
3631 : }
3632 : | NULL_P opt_as ecpg_sconst
3633 : {
3634 0 : $$ = cat_str(3,mm_strdup("null"),$2,$3);
3635 : }
3636 : | CSV
3637 : {
3638 0 : $$ = mm_strdup("csv");
3639 : }
3640 : | HEADER_P
3641 : {
3642 0 : $$ = mm_strdup("header");
3643 : }
3644 : | QUOTE opt_as ecpg_sconst
3645 : {
3646 0 : $$ = cat_str(3,mm_strdup("quote"),$2,$3);
3647 : }
3648 : | ESCAPE opt_as ecpg_sconst
3649 : {
3650 0 : $$ = cat_str(3,mm_strdup("escape"),$2,$3);
3651 : }
3652 : | FORCE QUOTE columnList
3653 : {
3654 0 : $$ = cat_str(2,mm_strdup("force quote"),$3);
3655 : }
3656 : | FORCE QUOTE '*'
3657 : {
3658 0 : $$ = mm_strdup("force quote *");
3659 : }
3660 : | FORCE NOT NULL_P columnList
3661 : {
3662 0 : $$ = cat_str(2,mm_strdup("force not null"),$4);
3663 : }
3664 : | FORCE NOT NULL_P '*'
3665 : {
3666 0 : $$ = mm_strdup("force not null *");
3667 : }
3668 : | FORCE NULL_P columnList
3669 : {
3670 0 : $$ = cat_str(2,mm_strdup("force null"),$3);
3671 : }
3672 : | FORCE NULL_P '*'
3673 : {
3674 0 : $$ = mm_strdup("force null *");
3675 : }
3676 : | ENCODING ecpg_sconst
3677 : {
3678 0 : $$ = cat_str(2,mm_strdup("encoding"),$2);
3679 : }
3680 : ;
3681 :
3682 :
3683 : opt_binary:
3684 : BINARY
3685 : {
3686 0 : $$ = mm_strdup("binary");
3687 : }
3688 : |
3689 : {
3690 2 : $$=EMPTY; }
3691 : ;
3692 :
3693 :
3694 : copy_delimiter:
3695 : opt_using DELIMITERS ecpg_sconst
3696 : {
3697 0 : $$ = cat_str(3,$1,mm_strdup("delimiters"),$3);
3698 : }
3699 : |
3700 : {
3701 2 : $$=EMPTY; }
3702 : ;
3703 :
3704 :
3705 : opt_using:
3706 : USING
3707 : {
3708 0 : $$ = mm_strdup("using");
3709 : }
3710 : |
3711 : {
3712 0 : $$=EMPTY; }
3713 : ;
3714 :
3715 :
3716 : copy_generic_opt_list:
3717 : copy_generic_opt_elem
3718 : {
3719 0 : $$ = $1;
3720 : }
3721 : | copy_generic_opt_list ',' copy_generic_opt_elem
3722 : {
3723 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
3724 : }
3725 : ;
3726 :
3727 :
3728 : copy_generic_opt_elem:
3729 : ColLabel copy_generic_opt_arg
3730 : {
3731 0 : $$ = cat_str(2,$1,$2);
3732 : }
3733 : ;
3734 :
3735 :
3736 : copy_generic_opt_arg:
3737 : opt_boolean_or_string
3738 : {
3739 0 : $$ = $1;
3740 : }
3741 : | NumericOnly
3742 : {
3743 0 : $$ = $1;
3744 : }
3745 : | '*'
3746 : {
3747 0 : $$ = mm_strdup("*");
3748 : }
3749 : | '(' copy_generic_opt_arg_list ')'
3750 : {
3751 0 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
3752 : }
3753 : |
3754 : {
3755 0 : $$=EMPTY; }
3756 : ;
3757 :
3758 :
3759 : copy_generic_opt_arg_list:
3760 : copy_generic_opt_arg_list_item
3761 : {
3762 0 : $$ = $1;
3763 : }
3764 : | copy_generic_opt_arg_list ',' copy_generic_opt_arg_list_item
3765 : {
3766 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
3767 : }
3768 : ;
3769 :
3770 :
3771 : copy_generic_opt_arg_list_item:
3772 : opt_boolean_or_string
3773 : {
3774 0 : $$ = $1;
3775 : }
3776 : ;
3777 :
3778 :
3779 : CreateStmt:
3780 : CREATE OptTemp TABLE qualified_name '(' OptTableElementList ')' OptInherit OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace
3781 : {
3782 98 : $$ = cat_str(13,mm_strdup("create"),$2,mm_strdup("table"),$4,mm_strdup("("),$6,mm_strdup(")"),$8,$9,$10,$11,$12,$13);
3783 : }
3784 : | CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name '(' OptTableElementList ')' OptInherit OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace
3785 : {
3786 2 : $$ = cat_str(13,mm_strdup("create"),$2,mm_strdup("table if not exists"),$7,mm_strdup("("),$9,mm_strdup(")"),$11,$12,$13,$14,$15,$16);
3787 : }
3788 : | CREATE OptTemp TABLE qualified_name OF any_name OptTypedTableElementList OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace
3789 : {
3790 0 : $$ = cat_str(12,mm_strdup("create"),$2,mm_strdup("table"),$4,mm_strdup("of"),$6,$7,$8,$9,$10,$11,$12);
3791 : }
3792 : | CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name OF any_name OptTypedTableElementList OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace
3793 : {
3794 0 : $$ = cat_str(12,mm_strdup("create"),$2,mm_strdup("table if not exists"),$7,mm_strdup("of"),$9,$10,$11,$12,$13,$14,$15);
3795 : }
3796 : | CREATE OptTemp TABLE qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace
3797 : {
3798 0 : $$ = cat_str(13,mm_strdup("create"),$2,mm_strdup("table"),$4,mm_strdup("partition of"),$7,$8,$9,$10,$11,$12,$13,$14);
3799 : }
3800 : | CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace
3801 : {
3802 0 : $$ = cat_str(13,mm_strdup("create"),$2,mm_strdup("table if not exists"),$7,mm_strdup("partition of"),$10,$11,$12,$13,$14,$15,$16,$17);
3803 : }
3804 : ;
3805 :
3806 :
3807 : OptTemp:
3808 : TEMPORARY
3809 : {
3810 0 : $$ = mm_strdup("temporary");
3811 : }
3812 : | TEMP
3813 : {
3814 0 : $$ = mm_strdup("temp");
3815 : }
3816 : | LOCAL TEMPORARY
3817 : {
3818 0 : $$ = mm_strdup("local temporary");
3819 : }
3820 : | LOCAL TEMP
3821 : {
3822 0 : $$ = mm_strdup("local temp");
3823 : }
3824 : | GLOBAL TEMPORARY
3825 : {
3826 0 : $$ = mm_strdup("global temporary");
3827 : }
3828 : | GLOBAL TEMP
3829 : {
3830 0 : $$ = mm_strdup("global temp");
3831 : }
3832 : | UNLOGGED
3833 : {
3834 0 : $$ = mm_strdup("unlogged");
3835 : }
3836 : |
3837 : {
3838 104 : $$=EMPTY; }
3839 : ;
3840 :
3841 :
3842 : OptTableElementList:
3843 : TableElementList
3844 : {
3845 100 : $$ = $1;
3846 : }
3847 : |
3848 : {
3849 0 : $$=EMPTY; }
3850 : ;
3851 :
3852 :
3853 : OptTypedTableElementList:
3854 : '(' TypedTableElementList ')'
3855 : {
3856 0 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
3857 : }
3858 : |
3859 : {
3860 0 : $$=EMPTY; }
3861 : ;
3862 :
3863 :
3864 : TableElementList:
3865 : TableElement
3866 : {
3867 100 : $$ = $1;
3868 : }
3869 : | TableElementList ',' TableElement
3870 : {
3871 212 : $$ = cat_str(3,$1,mm_strdup(","),$3);
3872 : }
3873 : ;
3874 :
3875 :
3876 : TypedTableElementList:
3877 : TypedTableElement
3878 : {
3879 0 : $$ = $1;
3880 : }
3881 : | TypedTableElementList ',' TypedTableElement
3882 : {
3883 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
3884 : }
3885 : ;
3886 :
3887 :
3888 : TableElement:
3889 : columnDef
3890 : {
3891 308 : $$ = $1;
3892 : }
3893 : | TableLikeClause
3894 : {
3895 0 : $$ = $1;
3896 : }
3897 : | TableConstraint
3898 : {
3899 4 : $$ = $1;
3900 : }
3901 : ;
3902 :
3903 :
3904 : TypedTableElement:
3905 : columnOptions
3906 : {
3907 0 : $$ = $1;
3908 : }
3909 : | TableConstraint
3910 : {
3911 0 : $$ = $1;
3912 : }
3913 : ;
3914 :
3915 :
3916 : columnDef:
3917 : ColId Typename opt_column_storage opt_column_compression create_generic_options ColQualList
3918 : {
3919 308 : $$ = cat_str(6,$1,$2,$3,$4,$5,$6);
3920 : }
3921 : ;
3922 :
3923 :
3924 : columnOptions:
3925 : ColId ColQualList
3926 : {
3927 0 : $$ = cat_str(2,$1,$2);
3928 : }
3929 : | ColId WITH OPTIONS ColQualList
3930 : {
3931 0 : $$ = cat_str(3,$1,mm_strdup("with options"),$4);
3932 : }
3933 : ;
3934 :
3935 :
3936 : column_compression:
3937 : COMPRESSION ColId
3938 : {
3939 0 : $$ = cat_str(2,mm_strdup("compression"),$2);
3940 : }
3941 : | COMPRESSION DEFAULT
3942 : {
3943 0 : $$ = mm_strdup("compression default");
3944 : }
3945 : ;
3946 :
3947 :
3948 : opt_column_compression:
3949 : column_compression
3950 : {
3951 0 : $$ = $1;
3952 : }
3953 : |
3954 : {
3955 308 : $$=EMPTY; }
3956 : ;
3957 :
3958 :
3959 : column_storage:
3960 : STORAGE ColId
3961 : {
3962 0 : $$ = cat_str(2,mm_strdup("storage"),$2);
3963 : }
3964 : | STORAGE DEFAULT
3965 : {
3966 0 : $$ = mm_strdup("storage default");
3967 : }
3968 : ;
3969 :
3970 :
3971 : opt_column_storage:
3972 : column_storage
3973 : {
3974 0 : $$ = $1;
3975 : }
3976 : |
3977 : {
3978 308 : $$=EMPTY; }
3979 : ;
3980 :
3981 :
3982 : ColQualList:
3983 : ColQualList ColConstraint
3984 : {
3985 38 : $$ = cat_str(2,$1,$2);
3986 : }
3987 : |
3988 : {
3989 308 : $$=EMPTY; }
3990 : ;
3991 :
3992 :
3993 : ColConstraint:
3994 : CONSTRAINT name ColConstraintElem
3995 : {
3996 0 : $$ = cat_str(3,mm_strdup("constraint"),$2,$3);
3997 : }
3998 : | ColConstraintElem
3999 : {
4000 38 : $$ = $1;
4001 : }
4002 : | ConstraintAttr
4003 : {
4004 0 : $$ = $1;
4005 : }
4006 : | COLLATE any_name
4007 : {
4008 0 : $$ = cat_str(2,mm_strdup("collate"),$2);
4009 : }
4010 : ;
4011 :
4012 :
4013 : ColConstraintElem:
4014 : NOT NULL_P opt_no_inherit
4015 : {
4016 16 : $$ = cat_str(2,mm_strdup("not null"),$3);
4017 : }
4018 : | NULL_P
4019 : {
4020 2 : $$ = mm_strdup("null");
4021 : }
4022 : | UNIQUE opt_unique_null_treatment opt_definition OptConsTableSpace
4023 : {
4024 0 : $$ = cat_str(4,mm_strdup("unique"),$2,$3,$4);
4025 : }
4026 : | PRIMARY KEY opt_definition OptConsTableSpace
4027 : {
4028 16 : $$ = cat_str(3,mm_strdup("primary key"),$3,$4);
4029 : }
4030 : | CHECK '(' a_expr ')' opt_no_inherit
4031 : {
4032 0 : $$ = cat_str(4,mm_strdup("check ("),$3,mm_strdup(")"),$5);
4033 : }
4034 : | DEFAULT b_expr
4035 : {
4036 4 : $$ = cat_str(2,mm_strdup("default"),$2);
4037 : }
4038 : | GENERATED generated_when AS IDENTITY_P OptParenthesizedSeqOptList
4039 : {
4040 0 : $$ = cat_str(4,mm_strdup("generated"),$2,mm_strdup("as identity"),$5);
4041 : }
4042 : | GENERATED generated_when AS '(' a_expr ')' STORED
4043 : {
4044 0 : $$ = cat_str(5,mm_strdup("generated"),$2,mm_strdup("as ("),$5,mm_strdup(") stored"));
4045 : }
4046 : | REFERENCES qualified_name opt_column_list key_match key_actions
4047 : {
4048 0 : $$ = cat_str(5,mm_strdup("references"),$2,$3,$4,$5);
4049 : }
4050 : ;
4051 :
4052 :
4053 : opt_unique_null_treatment:
4054 : NULLS_P DISTINCT
4055 : {
4056 0 : $$ = mm_strdup("nulls distinct");
4057 : }
4058 : | NULLS_P NOT DISTINCT
4059 : {
4060 0 : $$ = mm_strdup("nulls not distinct");
4061 : }
4062 : |
4063 : {
4064 0 : $$=EMPTY; }
4065 : ;
4066 :
4067 :
4068 : generated_when:
4069 : ALWAYS
4070 : {
4071 0 : $$ = mm_strdup("always");
4072 : }
4073 : | BY DEFAULT
4074 : {
4075 0 : $$ = mm_strdup("by default");
4076 : }
4077 : ;
4078 :
4079 :
4080 : ConstraintAttr:
4081 : DEFERRABLE
4082 : {
4083 0 : $$ = mm_strdup("deferrable");
4084 : }
4085 : | NOT DEFERRABLE
4086 : {
4087 0 : $$ = mm_strdup("not deferrable");
4088 : }
4089 : | INITIALLY DEFERRED
4090 : {
4091 0 : $$ = mm_strdup("initially deferred");
4092 : }
4093 : | INITIALLY IMMEDIATE
4094 : {
4095 0 : $$ = mm_strdup("initially immediate");
4096 : }
4097 : ;
4098 :
4099 :
4100 : TableLikeClause:
4101 : LIKE qualified_name TableLikeOptionList
4102 : {
4103 0 : $$ = cat_str(3,mm_strdup("like"),$2,$3);
4104 : }
4105 : ;
4106 :
4107 :
4108 : TableLikeOptionList:
4109 : TableLikeOptionList INCLUDING TableLikeOption
4110 : {
4111 0 : $$ = cat_str(3,$1,mm_strdup("including"),$3);
4112 : }
4113 : | TableLikeOptionList EXCLUDING TableLikeOption
4114 : {
4115 0 : $$ = cat_str(3,$1,mm_strdup("excluding"),$3);
4116 : }
4117 : |
4118 : {
4119 0 : $$=EMPTY; }
4120 : ;
4121 :
4122 :
4123 : TableLikeOption:
4124 : COMMENTS
4125 : {
4126 0 : $$ = mm_strdup("comments");
4127 : }
4128 : | COMPRESSION
4129 : {
4130 0 : $$ = mm_strdup("compression");
4131 : }
4132 : | CONSTRAINTS
4133 : {
4134 0 : $$ = mm_strdup("constraints");
4135 : }
4136 : | DEFAULTS
4137 : {
4138 0 : $$ = mm_strdup("defaults");
4139 : }
4140 : | IDENTITY_P
4141 : {
4142 0 : $$ = mm_strdup("identity");
4143 : }
4144 : | GENERATED
4145 : {
4146 0 : $$ = mm_strdup("generated");
4147 : }
4148 : | INDEXES
4149 : {
4150 0 : $$ = mm_strdup("indexes");
4151 : }
4152 : | STATISTICS
4153 : {
4154 0 : $$ = mm_strdup("statistics");
4155 : }
4156 : | STORAGE
4157 : {
4158 0 : $$ = mm_strdup("storage");
4159 : }
4160 : | ALL
4161 : {
4162 0 : $$ = mm_strdup("all");
4163 : }
4164 : ;
4165 :
4166 :
4167 : TableConstraint:
4168 : CONSTRAINT name ConstraintElem
4169 : {
4170 0 : $$ = cat_str(3,mm_strdup("constraint"),$2,$3);
4171 : }
4172 : | ConstraintElem
4173 : {
4174 4 : $$ = $1;
4175 : }
4176 : ;
4177 :
4178 :
4179 : ConstraintElem:
4180 : CHECK '(' a_expr ')' ConstraintAttributeSpec
4181 : {
4182 0 : $$ = cat_str(4,mm_strdup("check ("),$3,mm_strdup(")"),$5);
4183 : }
4184 : | NOT NULL_P ColId ConstraintAttributeSpec
4185 : {
4186 0 : $$ = cat_str(3,mm_strdup("not null"),$3,$4);
4187 : }
4188 : | UNIQUE opt_unique_null_treatment '(' columnList ')' opt_c_include opt_definition OptConsTableSpace ConstraintAttributeSpec
4189 : {
4190 0 : $$ = cat_str(9,mm_strdup("unique"),$2,mm_strdup("("),$4,mm_strdup(")"),$6,$7,$8,$9);
4191 : }
4192 : | UNIQUE ExistingIndex ConstraintAttributeSpec
4193 : {
4194 0 : $$ = cat_str(3,mm_strdup("unique"),$2,$3);
4195 : }
4196 : | PRIMARY KEY '(' columnList ')' opt_c_include opt_definition OptConsTableSpace ConstraintAttributeSpec
4197 : {
4198 4 : $$ = cat_str(7,mm_strdup("primary key ("),$4,mm_strdup(")"),$6,$7,$8,$9);
4199 : }
4200 : | PRIMARY KEY ExistingIndex ConstraintAttributeSpec
4201 : {
4202 0 : $$ = cat_str(3,mm_strdup("primary key"),$3,$4);
4203 : }
4204 : | EXCLUDE access_method_clause '(' ExclusionConstraintList ')' opt_c_include opt_definition OptConsTableSpace OptWhereClause ConstraintAttributeSpec
4205 : {
4206 0 : $$ = cat_str(10,mm_strdup("exclude"),$2,mm_strdup("("),$4,mm_strdup(")"),$6,$7,$8,$9,$10);
4207 : }
4208 : | FOREIGN KEY '(' columnList ')' REFERENCES qualified_name opt_column_list key_match key_actions ConstraintAttributeSpec
4209 : {
4210 0 : $$ = cat_str(8,mm_strdup("foreign key ("),$4,mm_strdup(") references"),$7,$8,$9,$10,$11);
4211 : }
4212 : ;
4213 :
4214 :
4215 : opt_no_inherit:
4216 : NO INHERIT
4217 : {
4218 0 : $$ = mm_strdup("no inherit");
4219 : }
4220 : |
4221 : {
4222 16 : $$=EMPTY; }
4223 : ;
4224 :
4225 :
4226 : opt_column_list:
4227 : '(' columnList ')'
4228 : {
4229 0 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
4230 : }
4231 : |
4232 : {
4233 6 : $$=EMPTY; }
4234 : ;
4235 :
4236 :
4237 : columnList:
4238 : columnElem
4239 : {
4240 4 : $$ = $1;
4241 : }
4242 : | columnList ',' columnElem
4243 : {
4244 4 : $$ = cat_str(3,$1,mm_strdup(","),$3);
4245 : }
4246 : ;
4247 :
4248 :
4249 : columnElem:
4250 : ColId
4251 : {
4252 8 : $$ = $1;
4253 : }
4254 : ;
4255 :
4256 :
4257 : opt_c_include:
4258 : INCLUDE '(' columnList ')'
4259 : {
4260 0 : $$ = cat_str(3,mm_strdup("include ("),$3,mm_strdup(")"));
4261 : }
4262 : |
4263 : {
4264 4 : $$=EMPTY; }
4265 : ;
4266 :
4267 :
4268 : key_match:
4269 : MATCH FULL
4270 : {
4271 0 : $$ = mm_strdup("match full");
4272 : }
4273 : | MATCH PARTIAL
4274 : {
4275 0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
4276 0 : $$ = mm_strdup("match partial");
4277 : }
4278 : | MATCH SIMPLE
4279 : {
4280 0 : $$ = mm_strdup("match simple");
4281 : }
4282 : |
4283 : {
4284 0 : $$=EMPTY; }
4285 : ;
4286 :
4287 :
4288 : ExclusionConstraintList:
4289 : ExclusionConstraintElem
4290 : {
4291 0 : $$ = $1;
4292 : }
4293 : | ExclusionConstraintList ',' ExclusionConstraintElem
4294 : {
4295 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
4296 : }
4297 : ;
4298 :
4299 :
4300 : ExclusionConstraintElem:
4301 : index_elem WITH any_operator
4302 : {
4303 0 : $$ = cat_str(3,$1,mm_strdup("with"),$3);
4304 : }
4305 : | index_elem WITH OPERATOR '(' any_operator ')'
4306 : {
4307 0 : $$ = cat_str(4,$1,mm_strdup("with operator ("),$5,mm_strdup(")"));
4308 : }
4309 : ;
4310 :
4311 :
4312 : OptWhereClause:
4313 : WHERE '(' a_expr ')'
4314 : {
4315 0 : $$ = cat_str(3,mm_strdup("where ("),$3,mm_strdup(")"));
4316 : }
4317 : |
4318 : {
4319 0 : $$=EMPTY; }
4320 : ;
4321 :
4322 :
4323 : key_actions:
4324 : key_update
4325 : {
4326 0 : $$ = $1;
4327 : }
4328 : | key_delete
4329 : {
4330 0 : $$ = $1;
4331 : }
4332 : | key_update key_delete
4333 : {
4334 0 : $$ = cat_str(2,$1,$2);
4335 : }
4336 : | key_delete key_update
4337 : {
4338 0 : $$ = cat_str(2,$1,$2);
4339 : }
4340 : |
4341 : {
4342 0 : $$=EMPTY; }
4343 : ;
4344 :
4345 :
4346 : key_update:
4347 : ON UPDATE key_action
4348 : {
4349 0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
4350 0 : $$ = cat_str(2,mm_strdup("on update"),$3);
4351 : }
4352 : ;
4353 :
4354 :
4355 : key_delete:
4356 : ON DELETE_P key_action
4357 : {
4358 0 : $$ = cat_str(2,mm_strdup("on delete"),$3);
4359 : }
4360 : ;
4361 :
4362 :
4363 : key_action:
4364 : NO ACTION
4365 : {
4366 0 : $$ = mm_strdup("no action");
4367 : }
4368 : | RESTRICT
4369 : {
4370 0 : $$ = mm_strdup("restrict");
4371 : }
4372 : | CASCADE
4373 : {
4374 0 : $$ = mm_strdup("cascade");
4375 : }
4376 : | SET NULL_P opt_column_list
4377 : {
4378 0 : $$ = cat_str(2,mm_strdup("set null"),$3);
4379 : }
4380 : | SET DEFAULT opt_column_list
4381 : {
4382 0 : $$ = cat_str(2,mm_strdup("set default"),$3);
4383 : }
4384 : ;
4385 :
4386 :
4387 : OptInherit:
4388 : INHERITS '(' qualified_name_list ')'
4389 : {
4390 0 : $$ = cat_str(3,mm_strdup("inherits ("),$3,mm_strdup(")"));
4391 : }
4392 : |
4393 : {
4394 100 : $$=EMPTY; }
4395 : ;
4396 :
4397 :
4398 : OptPartitionSpec:
4399 : PartitionSpec
4400 : {
4401 0 : $$ = $1;
4402 : }
4403 : |
4404 : {
4405 100 : $$=EMPTY; }
4406 : ;
4407 :
4408 :
4409 : PartitionSpec:
4410 : PARTITION BY ColId '(' part_params ')'
4411 : {
4412 0 : $$ = cat_str(5,mm_strdup("partition by"),$3,mm_strdup("("),$5,mm_strdup(")"));
4413 : }
4414 : ;
4415 :
4416 :
4417 : part_params:
4418 : part_elem
4419 : {
4420 0 : $$ = $1;
4421 : }
4422 : | part_params ',' part_elem
4423 : {
4424 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
4425 : }
4426 : ;
4427 :
4428 :
4429 : part_elem:
4430 : ColId opt_collate opt_qualified_name
4431 : {
4432 0 : $$ = cat_str(3,$1,$2,$3);
4433 : }
4434 : | func_expr_windowless opt_collate opt_qualified_name
4435 : {
4436 0 : $$ = cat_str(3,$1,$2,$3);
4437 : }
4438 : | '(' a_expr ')' opt_collate opt_qualified_name
4439 : {
4440 0 : $$ = cat_str(5,mm_strdup("("),$2,mm_strdup(")"),$4,$5);
4441 : }
4442 : ;
4443 :
4444 :
4445 : table_access_method_clause:
4446 : USING name
4447 : {
4448 0 : $$ = cat_str(2,mm_strdup("using"),$2);
4449 : }
4450 : |
4451 : {
4452 104 : $$=EMPTY; }
4453 : ;
4454 :
4455 :
4456 : OptWith:
4457 : WITH reloptions
4458 : {
4459 0 : $$ = cat_str(2,mm_strdup("with"),$2);
4460 : }
4461 : | WITHOUT OIDS
4462 : {
4463 0 : $$ = mm_strdup("without oids");
4464 : }
4465 : |
4466 : {
4467 104 : $$=EMPTY; }
4468 : ;
4469 :
4470 :
4471 : OnCommitOption:
4472 : ON COMMIT DROP
4473 : {
4474 0 : $$ = mm_strdup("on commit drop");
4475 : }
4476 : | ON COMMIT DELETE_P ROWS
4477 : {
4478 0 : $$ = mm_strdup("on commit delete rows");
4479 : }
4480 : | ON COMMIT PRESERVE ROWS
4481 : {
4482 0 : $$ = mm_strdup("on commit preserve rows");
4483 : }
4484 : |
4485 : {
4486 104 : $$=EMPTY; }
4487 : ;
4488 :
4489 :
4490 : OptTableSpace:
4491 : TABLESPACE name
4492 : {
4493 0 : $$ = cat_str(2,mm_strdup("tablespace"),$2);
4494 : }
4495 : |
4496 : {
4497 104 : $$=EMPTY; }
4498 : ;
4499 :
4500 :
4501 : OptConsTableSpace:
4502 : USING INDEX TABLESPACE name
4503 : {
4504 0 : $$ = cat_str(2,mm_strdup("using index tablespace"),$4);
4505 : }
4506 : |
4507 : {
4508 20 : $$=EMPTY; }
4509 : ;
4510 :
4511 :
4512 : ExistingIndex:
4513 : USING INDEX name
4514 : {
4515 0 : $$ = cat_str(2,mm_strdup("using index"),$3);
4516 : }
4517 : ;
4518 :
4519 :
4520 : CreateStatsStmt:
4521 : CREATE STATISTICS opt_qualified_name opt_name_list ON stats_params FROM from_list
4522 : {
4523 0 : $$ = cat_str(7,mm_strdup("create statistics"),$3,$4,mm_strdup("on"),$6,mm_strdup("from"),$8);
4524 : }
4525 : | CREATE STATISTICS IF_P NOT EXISTS any_name opt_name_list ON stats_params FROM from_list
4526 : {
4527 0 : $$ = cat_str(7,mm_strdup("create statistics if not exists"),$6,$7,mm_strdup("on"),$9,mm_strdup("from"),$11);
4528 : }
4529 : ;
4530 :
4531 :
4532 : stats_params:
4533 : stats_param
4534 : {
4535 0 : $$ = $1;
4536 : }
4537 : | stats_params ',' stats_param
4538 : {
4539 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
4540 : }
4541 : ;
4542 :
4543 :
4544 : stats_param:
4545 : ColId
4546 : {
4547 0 : $$ = $1;
4548 : }
4549 : | func_expr_windowless
4550 : {
4551 0 : $$ = $1;
4552 : }
4553 : | '(' a_expr ')'
4554 : {
4555 0 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
4556 : }
4557 : ;
4558 :
4559 :
4560 : AlterStatsStmt:
4561 : ALTER STATISTICS any_name SET STATISTICS SignedIconst
4562 : {
4563 0 : $$ = cat_str(4,mm_strdup("alter statistics"),$3,mm_strdup("set statistics"),$6);
4564 : }
4565 : | ALTER STATISTICS IF_P EXISTS any_name SET STATISTICS SignedIconst
4566 : {
4567 0 : $$ = cat_str(4,mm_strdup("alter statistics if exists"),$5,mm_strdup("set statistics"),$8);
4568 : }
4569 : ;
4570 :
4571 :
4572 : create_as_target:
4573 : qualified_name opt_column_list table_access_method_clause OptWith OnCommitOption OptTableSpace
4574 : {
4575 4 : $$ = cat_str(6,$1,$2,$3,$4,$5,$6);
4576 : }
4577 : ;
4578 :
4579 :
4580 : opt_with_data:
4581 : WITH DATA_P
4582 : {
4583 0 : $$ = mm_strdup("with data");
4584 : }
4585 : | WITH NO DATA_P
4586 : {
4587 2 : $$ = mm_strdup("with no data");
4588 : }
4589 : |
4590 : {
4591 2 : $$=EMPTY; }
4592 : ;
4593 :
4594 :
4595 : CreateMatViewStmt:
4596 : CREATE OptNoLog MATERIALIZED VIEW create_mv_target AS SelectStmt opt_with_data
4597 : {
4598 0 : $$ = cat_str(7,mm_strdup("create"),$2,mm_strdup("materialized view"),$5,mm_strdup("as"),$7,$8);
4599 : }
4600 : | CREATE OptNoLog MATERIALIZED VIEW IF_P NOT EXISTS create_mv_target AS SelectStmt opt_with_data
4601 : {
4602 0 : $$ = cat_str(7,mm_strdup("create"),$2,mm_strdup("materialized view if not exists"),$8,mm_strdup("as"),$10,$11);
4603 : }
4604 : ;
4605 :
4606 :
4607 : create_mv_target:
4608 : qualified_name opt_column_list table_access_method_clause opt_reloptions OptTableSpace
4609 : {
4610 0 : $$ = cat_str(5,$1,$2,$3,$4,$5);
4611 : }
4612 : ;
4613 :
4614 :
4615 : OptNoLog:
4616 : UNLOGGED
4617 : {
4618 0 : $$ = mm_strdup("unlogged");
4619 : }
4620 : |
4621 : {
4622 0 : $$=EMPTY; }
4623 : ;
4624 :
4625 :
4626 : RefreshMatViewStmt:
4627 : REFRESH MATERIALIZED VIEW opt_concurrently qualified_name opt_with_data
4628 : {
4629 0 : $$ = cat_str(4,mm_strdup("refresh materialized view"),$4,$5,$6);
4630 : }
4631 : ;
4632 :
4633 :
4634 : CreateSeqStmt:
4635 : CREATE OptTemp SEQUENCE qualified_name OptSeqOptList
4636 : {
4637 0 : $$ = cat_str(5,mm_strdup("create"),$2,mm_strdup("sequence"),$4,$5);
4638 : }
4639 : | CREATE OptTemp SEQUENCE IF_P NOT EXISTS qualified_name OptSeqOptList
4640 : {
4641 0 : $$ = cat_str(5,mm_strdup("create"),$2,mm_strdup("sequence if not exists"),$7,$8);
4642 : }
4643 : ;
4644 :
4645 :
4646 : AlterSeqStmt:
4647 : ALTER SEQUENCE qualified_name SeqOptList
4648 : {
4649 0 : $$ = cat_str(3,mm_strdup("alter sequence"),$3,$4);
4650 : }
4651 : | ALTER SEQUENCE IF_P EXISTS qualified_name SeqOptList
4652 : {
4653 0 : $$ = cat_str(3,mm_strdup("alter sequence if exists"),$5,$6);
4654 : }
4655 : ;
4656 :
4657 :
4658 : OptSeqOptList:
4659 : SeqOptList
4660 : {
4661 0 : $$ = $1;
4662 : }
4663 : |
4664 : {
4665 0 : $$=EMPTY; }
4666 : ;
4667 :
4668 :
4669 : OptParenthesizedSeqOptList:
4670 : '(' SeqOptList ')'
4671 : {
4672 0 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
4673 : }
4674 : |
4675 : {
4676 0 : $$=EMPTY; }
4677 : ;
4678 :
4679 :
4680 : SeqOptList:
4681 : SeqOptElem
4682 : {
4683 0 : $$ = $1;
4684 : }
4685 : | SeqOptList SeqOptElem
4686 : {
4687 0 : $$ = cat_str(2,$1,$2);
4688 : }
4689 : ;
4690 :
4691 :
4692 : SeqOptElem:
4693 : AS SimpleTypename
4694 : {
4695 0 : $$ = cat_str(2,mm_strdup("as"),$2);
4696 : }
4697 : | CACHE NumericOnly
4698 : {
4699 0 : $$ = cat_str(2,mm_strdup("cache"),$2);
4700 : }
4701 : | CYCLE
4702 : {
4703 0 : $$ = mm_strdup("cycle");
4704 : }
4705 : | NO CYCLE
4706 : {
4707 0 : $$ = mm_strdup("no cycle");
4708 : }
4709 : | INCREMENT opt_by NumericOnly
4710 : {
4711 0 : $$ = cat_str(3,mm_strdup("increment"),$2,$3);
4712 : }
4713 : | MAXVALUE NumericOnly
4714 : {
4715 0 : $$ = cat_str(2,mm_strdup("maxvalue"),$2);
4716 : }
4717 : | MINVALUE NumericOnly
4718 : {
4719 0 : $$ = cat_str(2,mm_strdup("minvalue"),$2);
4720 : }
4721 : | NO MAXVALUE
4722 : {
4723 0 : $$ = mm_strdup("no maxvalue");
4724 : }
4725 : | NO MINVALUE
4726 : {
4727 0 : $$ = mm_strdup("no minvalue");
4728 : }
4729 : | OWNED BY any_name
4730 : {
4731 0 : $$ = cat_str(2,mm_strdup("owned by"),$3);
4732 : }
4733 : | SEQUENCE NAME_P any_name
4734 : {
4735 0 : $$ = cat_str(2,mm_strdup("sequence name"),$3);
4736 : }
4737 : | START opt_with NumericOnly
4738 : {
4739 0 : $$ = cat_str(3,mm_strdup("start"),$2,$3);
4740 : }
4741 : | RESTART
4742 : {
4743 0 : $$ = mm_strdup("restart");
4744 : }
4745 : | RESTART opt_with NumericOnly
4746 : {
4747 0 : $$ = cat_str(3,mm_strdup("restart"),$2,$3);
4748 : }
4749 : ;
4750 :
4751 :
4752 : opt_by:
4753 : BY
4754 : {
4755 0 : $$ = mm_strdup("by");
4756 : }
4757 : |
4758 : {
4759 0 : $$=EMPTY; }
4760 : ;
4761 :
4762 :
4763 : NumericOnly:
4764 : ecpg_fconst
4765 : {
4766 0 : $$ = $1;
4767 : }
4768 : | '+' ecpg_fconst
4769 : {
4770 0 : $$ = cat_str(2,mm_strdup("+"),$2);
4771 : }
4772 : | '-' ecpg_fconst
4773 : {
4774 0 : $$ = cat_str(2,mm_strdup("-"),$2);
4775 : }
4776 : | SignedIconst
4777 : {
4778 6 : $$ = $1;
4779 : }
4780 : ;
4781 :
4782 :
4783 : NumericOnly_list:
4784 : NumericOnly
4785 : {
4786 0 : $$ = $1;
4787 : }
4788 : | NumericOnly_list ',' NumericOnly
4789 : {
4790 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
4791 : }
4792 : ;
4793 :
4794 :
4795 : CreatePLangStmt:
4796 : CREATE opt_or_replace opt_trusted opt_procedural LANGUAGE name
4797 : {
4798 0 : $$ = cat_str(6,mm_strdup("create"),$2,$3,$4,mm_strdup("language"),$6);
4799 : }
4800 : | CREATE opt_or_replace opt_trusted opt_procedural LANGUAGE name HANDLER handler_name opt_inline_handler opt_validator
4801 : {
4802 0 : $$ = cat_str(10,mm_strdup("create"),$2,$3,$4,mm_strdup("language"),$6,mm_strdup("handler"),$8,$9,$10);
4803 : }
4804 : ;
4805 :
4806 :
4807 : opt_trusted:
4808 : TRUSTED
4809 : {
4810 0 : $$ = mm_strdup("trusted");
4811 : }
4812 : |
4813 : {
4814 0 : $$=EMPTY; }
4815 : ;
4816 :
4817 :
4818 : handler_name:
4819 : name
4820 : {
4821 0 : $$ = $1;
4822 : }
4823 : | name attrs
4824 : {
4825 0 : $$ = cat_str(2,$1,$2);
4826 : }
4827 : ;
4828 :
4829 :
4830 : opt_inline_handler:
4831 : INLINE_P handler_name
4832 : {
4833 0 : $$ = cat_str(2,mm_strdup("inline"),$2);
4834 : }
4835 : |
4836 : {
4837 0 : $$=EMPTY; }
4838 : ;
4839 :
4840 :
4841 : validator_clause:
4842 : VALIDATOR handler_name
4843 : {
4844 0 : $$ = cat_str(2,mm_strdup("validator"),$2);
4845 : }
4846 : | NO VALIDATOR
4847 : {
4848 0 : $$ = mm_strdup("no validator");
4849 : }
4850 : ;
4851 :
4852 :
4853 : opt_validator:
4854 : validator_clause
4855 : {
4856 0 : $$ = $1;
4857 : }
4858 : |
4859 : {
4860 0 : $$=EMPTY; }
4861 : ;
4862 :
4863 :
4864 : opt_procedural:
4865 : PROCEDURAL
4866 : {
4867 0 : $$ = mm_strdup("procedural");
4868 : }
4869 : |
4870 : {
4871 0 : $$=EMPTY; }
4872 : ;
4873 :
4874 :
4875 : CreateTableSpaceStmt:
4876 : CREATE TABLESPACE name OptTableSpaceOwner LOCATION ecpg_sconst opt_reloptions
4877 : {
4878 0 : $$ = cat_str(6,mm_strdup("create tablespace"),$3,$4,mm_strdup("location"),$6,$7);
4879 : }
4880 : ;
4881 :
4882 :
4883 : OptTableSpaceOwner:
4884 : OWNER RoleSpec
4885 : {
4886 0 : $$ = cat_str(2,mm_strdup("owner"),$2);
4887 : }
4888 : |
4889 : {
4890 0 : $$=EMPTY; }
4891 : ;
4892 :
4893 :
4894 : DropTableSpaceStmt:
4895 : DROP TABLESPACE name
4896 : {
4897 0 : $$ = cat_str(2,mm_strdup("drop tablespace"),$3);
4898 : }
4899 : | DROP TABLESPACE IF_P EXISTS name
4900 : {
4901 0 : $$ = cat_str(2,mm_strdup("drop tablespace if exists"),$5);
4902 : }
4903 : ;
4904 :
4905 :
4906 : CreateExtensionStmt:
4907 : CREATE EXTENSION name opt_with create_extension_opt_list
4908 : {
4909 0 : $$ = cat_str(4,mm_strdup("create extension"),$3,$4,$5);
4910 : }
4911 : | CREATE EXTENSION IF_P NOT EXISTS name opt_with create_extension_opt_list
4912 : {
4913 0 : $$ = cat_str(4,mm_strdup("create extension if not exists"),$6,$7,$8);
4914 : }
4915 : ;
4916 :
4917 :
4918 : create_extension_opt_list:
4919 : create_extension_opt_list create_extension_opt_item
4920 : {
4921 0 : $$ = cat_str(2,$1,$2);
4922 : }
4923 : |
4924 : {
4925 0 : $$=EMPTY; }
4926 : ;
4927 :
4928 :
4929 : create_extension_opt_item:
4930 : SCHEMA name
4931 : {
4932 0 : $$ = cat_str(2,mm_strdup("schema"),$2);
4933 : }
4934 : | VERSION_P NonReservedWord_or_Sconst
4935 : {
4936 0 : $$ = cat_str(2,mm_strdup("version"),$2);
4937 : }
4938 : | FROM NonReservedWord_or_Sconst
4939 : {
4940 0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
4941 0 : $$ = cat_str(2,mm_strdup("from"),$2);
4942 : }
4943 : | CASCADE
4944 : {
4945 0 : $$ = mm_strdup("cascade");
4946 : }
4947 : ;
4948 :
4949 :
4950 : AlterExtensionStmt:
4951 : ALTER EXTENSION name UPDATE alter_extension_opt_list
4952 : {
4953 0 : $$ = cat_str(4,mm_strdup("alter extension"),$3,mm_strdup("update"),$5);
4954 : }
4955 : ;
4956 :
4957 :
4958 : alter_extension_opt_list:
4959 : alter_extension_opt_list alter_extension_opt_item
4960 : {
4961 0 : $$ = cat_str(2,$1,$2);
4962 : }
4963 : |
4964 : {
4965 0 : $$=EMPTY; }
4966 : ;
4967 :
4968 :
4969 : alter_extension_opt_item:
4970 : TO NonReservedWord_or_Sconst
4971 : {
4972 0 : $$ = cat_str(2,mm_strdup("to"),$2);
4973 : }
4974 : ;
4975 :
4976 :
4977 : AlterExtensionContentsStmt:
4978 : ALTER EXTENSION name add_drop object_type_name name
4979 : {
4980 0 : $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,$5,$6);
4981 : }
4982 : | ALTER EXTENSION name add_drop object_type_any_name any_name
4983 : {
4984 0 : $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,$5,$6);
4985 : }
4986 : | ALTER EXTENSION name add_drop AGGREGATE aggregate_with_argtypes
4987 : {
4988 0 : $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,mm_strdup("aggregate"),$6);
4989 : }
4990 : | ALTER EXTENSION name add_drop CAST '(' Typename AS Typename ')'
4991 : {
4992 0 : $$ = cat_str(8,mm_strdup("alter extension"),$3,$4,mm_strdup("cast ("),$7,mm_strdup("as"),$9,mm_strdup(")"));
4993 : }
4994 : | ALTER EXTENSION name add_drop DOMAIN_P Typename
4995 : {
4996 0 : $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,mm_strdup("domain"),$6);
4997 : }
4998 : | ALTER EXTENSION name add_drop FUNCTION function_with_argtypes
4999 : {
5000 0 : $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,mm_strdup("function"),$6);
5001 : }
5002 : | ALTER EXTENSION name add_drop OPERATOR operator_with_argtypes
5003 : {
5004 0 : $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,mm_strdup("operator"),$6);
5005 : }
5006 : | ALTER EXTENSION name add_drop OPERATOR CLASS any_name USING name
5007 : {
5008 0 : $$ = cat_str(7,mm_strdup("alter extension"),$3,$4,mm_strdup("operator class"),$7,mm_strdup("using"),$9);
5009 : }
5010 : | ALTER EXTENSION name add_drop OPERATOR FAMILY any_name USING name
5011 : {
5012 0 : $$ = cat_str(7,mm_strdup("alter extension"),$3,$4,mm_strdup("operator family"),$7,mm_strdup("using"),$9);
5013 : }
5014 : | ALTER EXTENSION name add_drop PROCEDURE function_with_argtypes
5015 : {
5016 0 : $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,mm_strdup("procedure"),$6);
5017 : }
5018 : | ALTER EXTENSION name add_drop ROUTINE function_with_argtypes
5019 : {
5020 0 : $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,mm_strdup("routine"),$6);
5021 : }
5022 : | ALTER EXTENSION name add_drop TRANSFORM FOR Typename LANGUAGE name
5023 : {
5024 0 : $$ = cat_str(7,mm_strdup("alter extension"),$3,$4,mm_strdup("transform for"),$7,mm_strdup("language"),$9);
5025 : }
5026 : | ALTER EXTENSION name add_drop TYPE_P Typename
5027 : {
5028 0 : $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,mm_strdup("type"),$6);
5029 : }
5030 : ;
5031 :
5032 :
5033 : CreateFdwStmt:
5034 : CREATE FOREIGN DATA_P WRAPPER name opt_fdw_options create_generic_options
5035 : {
5036 0 : $$ = cat_str(4,mm_strdup("create foreign data wrapper"),$5,$6,$7);
5037 : }
5038 : ;
5039 :
5040 :
5041 : fdw_option:
5042 : HANDLER handler_name
5043 : {
5044 0 : $$ = cat_str(2,mm_strdup("handler"),$2);
5045 : }
5046 : | NO HANDLER
5047 : {
5048 0 : $$ = mm_strdup("no handler");
5049 : }
5050 : | VALIDATOR handler_name
5051 : {
5052 0 : $$ = cat_str(2,mm_strdup("validator"),$2);
5053 : }
5054 : | NO VALIDATOR
5055 : {
5056 0 : $$ = mm_strdup("no validator");
5057 : }
5058 : ;
5059 :
5060 :
5061 : fdw_options:
5062 : fdw_option
5063 : {
5064 0 : $$ = $1;
5065 : }
5066 : | fdw_options fdw_option
5067 : {
5068 0 : $$ = cat_str(2,$1,$2);
5069 : }
5070 : ;
5071 :
5072 :
5073 : opt_fdw_options:
5074 : fdw_options
5075 : {
5076 0 : $$ = $1;
5077 : }
5078 : |
5079 : {
5080 0 : $$=EMPTY; }
5081 : ;
5082 :
5083 :
5084 : AlterFdwStmt:
5085 : ALTER FOREIGN DATA_P WRAPPER name opt_fdw_options alter_generic_options
5086 : {
5087 0 : $$ = cat_str(4,mm_strdup("alter foreign data wrapper"),$5,$6,$7);
5088 : }
5089 : | ALTER FOREIGN DATA_P WRAPPER name fdw_options
5090 : {
5091 0 : $$ = cat_str(3,mm_strdup("alter foreign data wrapper"),$5,$6);
5092 : }
5093 : ;
5094 :
5095 :
5096 : create_generic_options:
5097 : OPTIONS '(' generic_option_list ')'
5098 : {
5099 0 : $$ = cat_str(3,mm_strdup("options ("),$3,mm_strdup(")"));
5100 : }
5101 : |
5102 : {
5103 308 : $$=EMPTY; }
5104 : ;
5105 :
5106 :
5107 : generic_option_list:
5108 : generic_option_elem
5109 : {
5110 0 : $$ = $1;
5111 : }
5112 : | generic_option_list ',' generic_option_elem
5113 : {
5114 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
5115 : }
5116 : ;
5117 :
5118 :
5119 : alter_generic_options:
5120 : OPTIONS '(' alter_generic_option_list ')'
5121 : {
5122 0 : $$ = cat_str(3,mm_strdup("options ("),$3,mm_strdup(")"));
5123 : }
5124 : ;
5125 :
5126 :
5127 : alter_generic_option_list:
5128 : alter_generic_option_elem
5129 : {
5130 0 : $$ = $1;
5131 : }
5132 : | alter_generic_option_list ',' alter_generic_option_elem
5133 : {
5134 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
5135 : }
5136 : ;
5137 :
5138 :
5139 : alter_generic_option_elem:
5140 : generic_option_elem
5141 : {
5142 0 : $$ = $1;
5143 : }
5144 : | SET generic_option_elem
5145 : {
5146 0 : $$ = cat_str(2,mm_strdup("set"),$2);
5147 : }
5148 : | ADD_P generic_option_elem
5149 : {
5150 0 : $$ = cat_str(2,mm_strdup("add"),$2);
5151 : }
5152 : | DROP generic_option_name
5153 : {
5154 0 : $$ = cat_str(2,mm_strdup("drop"),$2);
5155 : }
5156 : ;
5157 :
5158 :
5159 : generic_option_elem:
5160 : generic_option_name generic_option_arg
5161 : {
5162 0 : $$ = cat_str(2,$1,$2);
5163 : }
5164 : ;
5165 :
5166 :
5167 : generic_option_name:
5168 : ColLabel
5169 : {
5170 0 : $$ = $1;
5171 : }
5172 : ;
5173 :
5174 :
5175 : generic_option_arg:
5176 : ecpg_sconst
5177 : {
5178 0 : $$ = $1;
5179 : }
5180 : ;
5181 :
5182 :
5183 : CreateForeignServerStmt:
5184 : CREATE SERVER name opt_type opt_foreign_server_version FOREIGN DATA_P WRAPPER name create_generic_options
5185 : {
5186 0 : $$ = cat_str(7,mm_strdup("create server"),$3,$4,$5,mm_strdup("foreign data wrapper"),$9,$10);
5187 : }
5188 : | CREATE SERVER IF_P NOT EXISTS name opt_type opt_foreign_server_version FOREIGN DATA_P WRAPPER name create_generic_options
5189 : {
5190 0 : $$ = cat_str(7,mm_strdup("create server if not exists"),$6,$7,$8,mm_strdup("foreign data wrapper"),$12,$13);
5191 : }
5192 : ;
5193 :
5194 :
5195 : opt_type:
5196 : TYPE_P ecpg_sconst
5197 : {
5198 0 : $$ = cat_str(2,mm_strdup("type"),$2);
5199 : }
5200 : |
5201 : {
5202 0 : $$=EMPTY; }
5203 : ;
5204 :
5205 :
5206 : foreign_server_version:
5207 : VERSION_P ecpg_sconst
5208 : {
5209 0 : $$ = cat_str(2,mm_strdup("version"),$2);
5210 : }
5211 : | VERSION_P NULL_P
5212 : {
5213 0 : $$ = mm_strdup("version null");
5214 : }
5215 : ;
5216 :
5217 :
5218 : opt_foreign_server_version:
5219 : foreign_server_version
5220 : {
5221 0 : $$ = $1;
5222 : }
5223 : |
5224 : {
5225 0 : $$=EMPTY; }
5226 : ;
5227 :
5228 :
5229 : AlterForeignServerStmt:
5230 : ALTER SERVER name foreign_server_version alter_generic_options
5231 : {
5232 0 : $$ = cat_str(4,mm_strdup("alter server"),$3,$4,$5);
5233 : }
5234 : | ALTER SERVER name foreign_server_version
5235 : {
5236 0 : $$ = cat_str(3,mm_strdup("alter server"),$3,$4);
5237 : }
5238 : | ALTER SERVER name alter_generic_options
5239 : {
5240 0 : $$ = cat_str(3,mm_strdup("alter server"),$3,$4);
5241 : }
5242 : ;
5243 :
5244 :
5245 : CreateForeignTableStmt:
5246 : CREATE FOREIGN TABLE qualified_name '(' OptTableElementList ')' OptInherit SERVER name create_generic_options
5247 : {
5248 0 : $$ = cat_str(9,mm_strdup("create foreign table"),$4,mm_strdup("("),$6,mm_strdup(")"),$8,mm_strdup("server"),$10,$11);
5249 : }
5250 : | CREATE FOREIGN TABLE IF_P NOT EXISTS qualified_name '(' OptTableElementList ')' OptInherit SERVER name create_generic_options
5251 : {
5252 0 : $$ = cat_str(9,mm_strdup("create foreign table if not exists"),$7,mm_strdup("("),$9,mm_strdup(")"),$11,mm_strdup("server"),$13,$14);
5253 : }
5254 : | CREATE FOREIGN TABLE qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec SERVER name create_generic_options
5255 : {
5256 0 : $$ = cat_str(9,mm_strdup("create foreign table"),$4,mm_strdup("partition of"),$7,$8,$9,mm_strdup("server"),$11,$12);
5257 : }
5258 : | CREATE FOREIGN TABLE IF_P NOT EXISTS qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec SERVER name create_generic_options
5259 : {
5260 0 : $$ = cat_str(9,mm_strdup("create foreign table if not exists"),$7,mm_strdup("partition of"),$10,$11,$12,mm_strdup("server"),$14,$15);
5261 : }
5262 : ;
5263 :
5264 :
5265 : ImportForeignSchemaStmt:
5266 : IMPORT_P FOREIGN SCHEMA name import_qualification FROM SERVER name INTO name create_generic_options
5267 : {
5268 0 : $$ = cat_str(8,mm_strdup("import foreign schema"),$4,$5,mm_strdup("from server"),$8,mm_strdup("into"),$10,$11);
5269 : }
5270 : ;
5271 :
5272 :
5273 : import_qualification_type:
5274 : LIMIT TO
5275 : {
5276 0 : $$ = mm_strdup("limit to");
5277 : }
5278 : | EXCEPT
5279 : {
5280 0 : $$ = mm_strdup("except");
5281 : }
5282 : ;
5283 :
5284 :
5285 : import_qualification:
5286 : import_qualification_type '(' relation_expr_list ')'
5287 : {
5288 0 : $$ = cat_str(4,$1,mm_strdup("("),$3,mm_strdup(")"));
5289 : }
5290 : |
5291 : {
5292 0 : $$=EMPTY; }
5293 : ;
5294 :
5295 :
5296 : CreateUserMappingStmt:
5297 : CREATE USER MAPPING FOR auth_ident SERVER name create_generic_options
5298 : {
5299 0 : $$ = cat_str(5,mm_strdup("create user mapping for"),$5,mm_strdup("server"),$7,$8);
5300 : }
5301 : | CREATE USER MAPPING IF_P NOT EXISTS FOR auth_ident SERVER name create_generic_options
5302 : {
5303 0 : $$ = cat_str(5,mm_strdup("create user mapping if not exists for"),$8,mm_strdup("server"),$10,$11);
5304 : }
5305 : ;
5306 :
5307 :
5308 : auth_ident:
5309 : RoleSpec
5310 : {
5311 0 : $$ = $1;
5312 : }
5313 : | USER
5314 : {
5315 0 : $$ = mm_strdup("user");
5316 : }
5317 : ;
5318 :
5319 :
5320 : DropUserMappingStmt:
5321 : DROP USER MAPPING FOR auth_ident SERVER name
5322 : {
5323 0 : $$ = cat_str(4,mm_strdup("drop user mapping for"),$5,mm_strdup("server"),$7);
5324 : }
5325 : | DROP USER MAPPING IF_P EXISTS FOR auth_ident SERVER name
5326 : {
5327 0 : $$ = cat_str(4,mm_strdup("drop user mapping if exists for"),$7,mm_strdup("server"),$9);
5328 : }
5329 : ;
5330 :
5331 :
5332 : AlterUserMappingStmt:
5333 : ALTER USER MAPPING FOR auth_ident SERVER name alter_generic_options
5334 : {
5335 0 : $$ = cat_str(5,mm_strdup("alter user mapping for"),$5,mm_strdup("server"),$7,$8);
5336 : }
5337 : ;
5338 :
5339 :
5340 : CreatePolicyStmt:
5341 : CREATE POLICY name ON qualified_name RowSecurityDefaultPermissive RowSecurityDefaultForCmd RowSecurityDefaultToRole RowSecurityOptionalExpr RowSecurityOptionalWithCheck
5342 : {
5343 0 : $$ = cat_str(9,mm_strdup("create policy"),$3,mm_strdup("on"),$5,$6,$7,$8,$9,$10);
5344 : }
5345 : ;
5346 :
5347 :
5348 : AlterPolicyStmt:
5349 : ALTER POLICY name ON qualified_name RowSecurityOptionalToRole RowSecurityOptionalExpr RowSecurityOptionalWithCheck
5350 : {
5351 0 : $$ = cat_str(7,mm_strdup("alter policy"),$3,mm_strdup("on"),$5,$6,$7,$8);
5352 : }
5353 : ;
5354 :
5355 :
5356 : RowSecurityOptionalExpr:
5357 : USING '(' a_expr ')'
5358 : {
5359 0 : $$ = cat_str(3,mm_strdup("using ("),$3,mm_strdup(")"));
5360 : }
5361 : |
5362 : {
5363 0 : $$=EMPTY; }
5364 : ;
5365 :
5366 :
5367 : RowSecurityOptionalWithCheck:
5368 : WITH CHECK '(' a_expr ')'
5369 : {
5370 0 : $$ = cat_str(3,mm_strdup("with check ("),$4,mm_strdup(")"));
5371 : }
5372 : |
5373 : {
5374 0 : $$=EMPTY; }
5375 : ;
5376 :
5377 :
5378 : RowSecurityDefaultToRole:
5379 : TO role_list
5380 : {
5381 0 : $$ = cat_str(2,mm_strdup("to"),$2);
5382 : }
5383 : |
5384 : {
5385 0 : $$=EMPTY; }
5386 : ;
5387 :
5388 :
5389 : RowSecurityOptionalToRole:
5390 : TO role_list
5391 : {
5392 0 : $$ = cat_str(2,mm_strdup("to"),$2);
5393 : }
5394 : |
5395 : {
5396 0 : $$=EMPTY; }
5397 : ;
5398 :
5399 :
5400 : RowSecurityDefaultPermissive:
5401 : AS ecpg_ident
5402 : {
5403 0 : $$ = cat_str(2,mm_strdup("as"),$2);
5404 : }
5405 : |
5406 : {
5407 0 : $$=EMPTY; }
5408 : ;
5409 :
5410 :
5411 : RowSecurityDefaultForCmd:
5412 : FOR row_security_cmd
5413 : {
5414 0 : $$ = cat_str(2,mm_strdup("for"),$2);
5415 : }
5416 : |
5417 : {
5418 0 : $$=EMPTY; }
5419 : ;
5420 :
5421 :
5422 : row_security_cmd:
5423 : ALL
5424 : {
5425 0 : $$ = mm_strdup("all");
5426 : }
5427 : | SELECT
5428 : {
5429 0 : $$ = mm_strdup("select");
5430 : }
5431 : | INSERT
5432 : {
5433 0 : $$ = mm_strdup("insert");
5434 : }
5435 : | UPDATE
5436 : {
5437 0 : $$ = mm_strdup("update");
5438 : }
5439 : | DELETE_P
5440 : {
5441 0 : $$ = mm_strdup("delete");
5442 : }
5443 : ;
5444 :
5445 :
5446 : CreateAmStmt:
5447 : CREATE ACCESS METHOD name TYPE_P am_type HANDLER handler_name
5448 : {
5449 0 : $$ = cat_str(6,mm_strdup("create access method"),$4,mm_strdup("type"),$6,mm_strdup("handler"),$8);
5450 : }
5451 : ;
5452 :
5453 :
5454 : am_type:
5455 : INDEX
5456 : {
5457 0 : $$ = mm_strdup("index");
5458 : }
5459 : | TABLE
5460 : {
5461 0 : $$ = mm_strdup("table");
5462 : }
5463 : ;
5464 :
5465 :
5466 : CreateTrigStmt:
5467 : CREATE opt_or_replace TRIGGER name TriggerActionTime TriggerEvents ON qualified_name TriggerReferencing TriggerForSpec TriggerWhen EXECUTE FUNCTION_or_PROCEDURE func_name '(' TriggerFuncArgs ')'
5468 : {
5469 2 : $$ = cat_str(17,mm_strdup("create"),$2,mm_strdup("trigger"),$4,$5,$6,mm_strdup("on"),$8,$9,$10,$11,mm_strdup("execute"),$13,$14,mm_strdup("("),$16,mm_strdup(")"));
5470 : }
5471 : | CREATE opt_or_replace CONSTRAINT TRIGGER name AFTER TriggerEvents ON qualified_name OptConstrFromTable ConstraintAttributeSpec FOR EACH ROW TriggerWhen EXECUTE FUNCTION_or_PROCEDURE func_name '(' TriggerFuncArgs ')'
5472 : {
5473 0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
5474 0 : $$ = cat_str(18,mm_strdup("create"),$2,mm_strdup("constraint trigger"),$5,mm_strdup("after"),$7,mm_strdup("on"),$9,$10,$11,mm_strdup("for each row"),$15,mm_strdup("execute"),$17,$18,mm_strdup("("),$20,mm_strdup(")"));
5475 : }
5476 : ;
5477 :
5478 :
5479 : TriggerActionTime:
5480 : BEFORE
5481 : {
5482 2 : $$ = mm_strdup("before");
5483 : }
5484 : | AFTER
5485 : {
5486 0 : $$ = mm_strdup("after");
5487 : }
5488 : | INSTEAD OF
5489 : {
5490 0 : $$ = mm_strdup("instead of");
5491 : }
5492 : ;
5493 :
5494 :
5495 : TriggerEvents:
5496 : TriggerOneEvent
5497 : {
5498 2 : $$ = $1;
5499 : }
5500 : | TriggerEvents OR TriggerOneEvent
5501 : {
5502 0 : $$ = cat_str(3,$1,mm_strdup("or"),$3);
5503 : }
5504 : ;
5505 :
5506 :
5507 : TriggerOneEvent:
5508 : INSERT
5509 : {
5510 2 : $$ = mm_strdup("insert");
5511 : }
5512 : | DELETE_P
5513 : {
5514 0 : $$ = mm_strdup("delete");
5515 : }
5516 : | UPDATE
5517 : {
5518 0 : $$ = mm_strdup("update");
5519 : }
5520 : | UPDATE OF columnList
5521 : {
5522 0 : $$ = cat_str(2,mm_strdup("update of"),$3);
5523 : }
5524 : | TRUNCATE
5525 : {
5526 0 : $$ = mm_strdup("truncate");
5527 : }
5528 : ;
5529 :
5530 :
5531 : TriggerReferencing:
5532 : REFERENCING TriggerTransitions
5533 : {
5534 0 : $$ = cat_str(2,mm_strdup("referencing"),$2);
5535 : }
5536 : |
5537 : {
5538 2 : $$=EMPTY; }
5539 : ;
5540 :
5541 :
5542 : TriggerTransitions:
5543 : TriggerTransition
5544 : {
5545 0 : $$ = $1;
5546 : }
5547 : | TriggerTransitions TriggerTransition
5548 : {
5549 0 : $$ = cat_str(2,$1,$2);
5550 : }
5551 : ;
5552 :
5553 :
5554 : TriggerTransition:
5555 : TransitionOldOrNew TransitionRowOrTable opt_as TransitionRelName
5556 : {
5557 0 : $$ = cat_str(4,$1,$2,$3,$4);
5558 : }
5559 : ;
5560 :
5561 :
5562 : TransitionOldOrNew:
5563 : NEW
5564 : {
5565 0 : $$ = mm_strdup("new");
5566 : }
5567 : | OLD
5568 : {
5569 0 : $$ = mm_strdup("old");
5570 : }
5571 : ;
5572 :
5573 :
5574 : TransitionRowOrTable:
5575 : TABLE
5576 : {
5577 0 : $$ = mm_strdup("table");
5578 : }
5579 : | ROW
5580 : {
5581 0 : $$ = mm_strdup("row");
5582 : }
5583 : ;
5584 :
5585 :
5586 : TransitionRelName:
5587 : ColId
5588 : {
5589 0 : $$ = $1;
5590 : }
5591 : ;
5592 :
5593 :
5594 : TriggerForSpec:
5595 : FOR TriggerForOptEach TriggerForType
5596 : {
5597 2 : $$ = cat_str(3,mm_strdup("for"),$2,$3);
5598 : }
5599 : |
5600 : {
5601 0 : $$=EMPTY; }
5602 : ;
5603 :
5604 :
5605 : TriggerForOptEach:
5606 : EACH
5607 : {
5608 2 : $$ = mm_strdup("each");
5609 : }
5610 : |
5611 : {
5612 0 : $$=EMPTY; }
5613 : ;
5614 :
5615 :
5616 : TriggerForType:
5617 : ROW
5618 : {
5619 2 : $$ = mm_strdup("row");
5620 : }
5621 : | STATEMENT
5622 : {
5623 0 : $$ = mm_strdup("statement");
5624 : }
5625 : ;
5626 :
5627 :
5628 : TriggerWhen:
5629 : WHEN '(' a_expr ')'
5630 : {
5631 0 : $$ = cat_str(3,mm_strdup("when ("),$3,mm_strdup(")"));
5632 : }
5633 : |
5634 : {
5635 2 : $$=EMPTY; }
5636 : ;
5637 :
5638 :
5639 : FUNCTION_or_PROCEDURE:
5640 : FUNCTION
5641 : {
5642 0 : $$ = mm_strdup("function");
5643 : }
5644 : | PROCEDURE
5645 : {
5646 2 : $$ = mm_strdup("procedure");
5647 : }
5648 : ;
5649 :
5650 :
5651 : TriggerFuncArgs:
5652 : TriggerFuncArg
5653 : {
5654 0 : $$ = $1;
5655 : }
5656 : | TriggerFuncArgs ',' TriggerFuncArg
5657 : {
5658 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
5659 : }
5660 : |
5661 : {
5662 2 : $$=EMPTY; }
5663 : ;
5664 :
5665 :
5666 : TriggerFuncArg:
5667 : Iconst
5668 : {
5669 0 : $$ = $1;
5670 : }
5671 : | ecpg_fconst
5672 : {
5673 0 : $$ = $1;
5674 : }
5675 : | ecpg_sconst
5676 : {
5677 0 : $$ = $1;
5678 : }
5679 : | ColLabel
5680 : {
5681 0 : $$ = $1;
5682 : }
5683 : ;
5684 :
5685 :
5686 : OptConstrFromTable:
5687 : FROM qualified_name
5688 : {
5689 0 : $$ = cat_str(2,mm_strdup("from"),$2);
5690 : }
5691 : |
5692 : {
5693 0 : $$=EMPTY; }
5694 : ;
5695 :
5696 :
5697 : ConstraintAttributeSpec:
5698 :
5699 : {
5700 4 : $$=EMPTY; }
5701 : | ConstraintAttributeSpec ConstraintAttributeElem
5702 : {
5703 0 : $$ = cat_str(2,$1,$2);
5704 : }
5705 : ;
5706 :
5707 :
5708 : ConstraintAttributeElem:
5709 : NOT DEFERRABLE
5710 : {
5711 0 : $$ = mm_strdup("not deferrable");
5712 : }
5713 : | DEFERRABLE
5714 : {
5715 0 : $$ = mm_strdup("deferrable");
5716 : }
5717 : | INITIALLY IMMEDIATE
5718 : {
5719 0 : $$ = mm_strdup("initially immediate");
5720 : }
5721 : | INITIALLY DEFERRED
5722 : {
5723 0 : $$ = mm_strdup("initially deferred");
5724 : }
5725 : | NOT VALID
5726 : {
5727 0 : $$ = mm_strdup("not valid");
5728 : }
5729 : | NO INHERIT
5730 : {
5731 0 : $$ = mm_strdup("no inherit");
5732 : }
5733 : ;
5734 :
5735 :
5736 : CreateEventTrigStmt:
5737 : CREATE EVENT TRIGGER name ON ColLabel EXECUTE FUNCTION_or_PROCEDURE func_name '(' ')'
5738 : {
5739 0 : $$ = cat_str(8,mm_strdup("create event trigger"),$4,mm_strdup("on"),$6,mm_strdup("execute"),$8,$9,mm_strdup("( )"));
5740 : }
5741 : | CREATE EVENT TRIGGER name ON ColLabel WHEN event_trigger_when_list EXECUTE FUNCTION_or_PROCEDURE func_name '(' ')'
5742 : {
5743 0 : $$ = cat_str(10,mm_strdup("create event trigger"),$4,mm_strdup("on"),$6,mm_strdup("when"),$8,mm_strdup("execute"),$10,$11,mm_strdup("( )"));
5744 : }
5745 : ;
5746 :
5747 :
5748 : event_trigger_when_list:
5749 : event_trigger_when_item
5750 : {
5751 0 : $$ = $1;
5752 : }
5753 : | event_trigger_when_list AND event_trigger_when_item
5754 : {
5755 0 : $$ = cat_str(3,$1,mm_strdup("and"),$3);
5756 : }
5757 : ;
5758 :
5759 :
5760 : event_trigger_when_item:
5761 : ColId IN_P '(' event_trigger_value_list ')'
5762 : {
5763 0 : $$ = cat_str(4,$1,mm_strdup("in ("),$4,mm_strdup(")"));
5764 : }
5765 : ;
5766 :
5767 :
5768 : event_trigger_value_list:
5769 : SCONST
5770 : {
5771 0 : $$ = mm_strdup("sconst");
5772 : }
5773 : | event_trigger_value_list ',' SCONST
5774 : {
5775 0 : $$ = cat_str(2,$1,mm_strdup(", sconst"));
5776 : }
5777 : ;
5778 :
5779 :
5780 : AlterEventTrigStmt:
5781 : ALTER EVENT TRIGGER name enable_trigger
5782 : {
5783 0 : $$ = cat_str(3,mm_strdup("alter event trigger"),$4,$5);
5784 : }
5785 : ;
5786 :
5787 :
5788 : enable_trigger:
5789 : ENABLE_P
5790 : {
5791 0 : $$ = mm_strdup("enable");
5792 : }
5793 : | ENABLE_P REPLICA
5794 : {
5795 0 : $$ = mm_strdup("enable replica");
5796 : }
5797 : | ENABLE_P ALWAYS
5798 : {
5799 0 : $$ = mm_strdup("enable always");
5800 : }
5801 : | DISABLE_P
5802 : {
5803 0 : $$ = mm_strdup("disable");
5804 : }
5805 : ;
5806 :
5807 :
5808 : CreateAssertionStmt:
5809 : CREATE ASSERTION any_name CHECK '(' a_expr ')' ConstraintAttributeSpec
5810 : {
5811 0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
5812 0 : $$ = cat_str(6,mm_strdup("create assertion"),$3,mm_strdup("check ("),$6,mm_strdup(")"),$8);
5813 : }
5814 : ;
5815 :
5816 :
5817 : DefineStmt:
5818 : CREATE opt_or_replace AGGREGATE func_name aggr_args definition
5819 : {
5820 0 : $$ = cat_str(6,mm_strdup("create"),$2,mm_strdup("aggregate"),$4,$5,$6);
5821 : }
5822 : | CREATE opt_or_replace AGGREGATE func_name old_aggr_definition
5823 : {
5824 0 : $$ = cat_str(5,mm_strdup("create"),$2,mm_strdup("aggregate"),$4,$5);
5825 : }
5826 : | CREATE OPERATOR any_operator definition
5827 : {
5828 0 : $$ = cat_str(3,mm_strdup("create operator"),$3,$4);
5829 : }
5830 : | CREATE TYPE_P any_name definition
5831 : {
5832 0 : $$ = cat_str(3,mm_strdup("create type"),$3,$4);
5833 : }
5834 : | CREATE TYPE_P any_name
5835 : {
5836 0 : $$ = cat_str(2,mm_strdup("create type"),$3);
5837 : }
5838 : | CREATE TYPE_P any_name AS '(' OptTableFuncElementList ')'
5839 : {
5840 0 : $$ = cat_str(5,mm_strdup("create type"),$3,mm_strdup("as ("),$6,mm_strdup(")"));
5841 : }
5842 : | CREATE TYPE_P any_name AS ENUM_P '(' opt_enum_val_list ')'
5843 : {
5844 0 : $$ = cat_str(5,mm_strdup("create type"),$3,mm_strdup("as enum ("),$7,mm_strdup(")"));
5845 : }
5846 : | CREATE TYPE_P any_name AS RANGE definition
5847 : {
5848 0 : $$ = cat_str(4,mm_strdup("create type"),$3,mm_strdup("as range"),$6);
5849 : }
5850 : | CREATE TEXT_P SEARCH PARSER any_name definition
5851 : {
5852 0 : $$ = cat_str(3,mm_strdup("create text search parser"),$5,$6);
5853 : }
5854 : | CREATE TEXT_P SEARCH DICTIONARY any_name definition
5855 : {
5856 0 : $$ = cat_str(3,mm_strdup("create text search dictionary"),$5,$6);
5857 : }
5858 : | CREATE TEXT_P SEARCH TEMPLATE any_name definition
5859 : {
5860 0 : $$ = cat_str(3,mm_strdup("create text search template"),$5,$6);
5861 : }
5862 : | CREATE TEXT_P SEARCH CONFIGURATION any_name definition
5863 : {
5864 0 : $$ = cat_str(3,mm_strdup("create text search configuration"),$5,$6);
5865 : }
5866 : | CREATE COLLATION any_name definition
5867 : {
5868 0 : $$ = cat_str(3,mm_strdup("create collation"),$3,$4);
5869 : }
5870 : | CREATE COLLATION IF_P NOT EXISTS any_name definition
5871 : {
5872 0 : $$ = cat_str(3,mm_strdup("create collation if not exists"),$6,$7);
5873 : }
5874 : | CREATE COLLATION any_name FROM any_name
5875 : {
5876 0 : $$ = cat_str(4,mm_strdup("create collation"),$3,mm_strdup("from"),$5);
5877 : }
5878 : | CREATE COLLATION IF_P NOT EXISTS any_name FROM any_name
5879 : {
5880 0 : $$ = cat_str(4,mm_strdup("create collation if not exists"),$6,mm_strdup("from"),$8);
5881 : }
5882 : ;
5883 :
5884 :
5885 : definition:
5886 : '(' def_list ')'
5887 : {
5888 0 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
5889 : }
5890 : ;
5891 :
5892 :
5893 : def_list:
5894 : def_elem
5895 : {
5896 0 : $$ = $1;
5897 : }
5898 : | def_list ',' def_elem
5899 : {
5900 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
5901 : }
5902 : ;
5903 :
5904 :
5905 : def_elem:
5906 : ColLabel '=' def_arg
5907 : {
5908 0 : $$ = cat_str(3,$1,mm_strdup("="),$3);
5909 : }
5910 : | ColLabel
5911 : {
5912 0 : $$ = $1;
5913 : }
5914 : ;
5915 :
5916 :
5917 : def_arg:
5918 : func_type
5919 : {
5920 0 : $$ = $1;
5921 : }
5922 : | reserved_keyword
5923 : {
5924 0 : $$ = $1;
5925 : }
5926 : | qual_all_Op
5927 : {
5928 0 : $$ = $1;
5929 : }
5930 : | NumericOnly
5931 : {
5932 0 : $$ = $1;
5933 : }
5934 : | ecpg_sconst
5935 : {
5936 0 : $$ = $1;
5937 : }
5938 : | NONE
5939 : {
5940 0 : $$ = mm_strdup("none");
5941 : }
5942 : ;
5943 :
5944 :
5945 : old_aggr_definition:
5946 : '(' old_aggr_list ')'
5947 : {
5948 0 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
5949 : }
5950 : ;
5951 :
5952 :
5953 : old_aggr_list:
5954 : old_aggr_elem
5955 : {
5956 0 : $$ = $1;
5957 : }
5958 : | old_aggr_list ',' old_aggr_elem
5959 : {
5960 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
5961 : }
5962 : ;
5963 :
5964 :
5965 : old_aggr_elem:
5966 : ecpg_ident '=' def_arg
5967 : {
5968 0 : $$ = cat_str(3,$1,mm_strdup("="),$3);
5969 : }
5970 : ;
5971 :
5972 :
5973 : opt_enum_val_list:
5974 : enum_val_list
5975 : {
5976 0 : $$ = $1;
5977 : }
5978 : |
5979 : {
5980 0 : $$=EMPTY; }
5981 : ;
5982 :
5983 :
5984 : enum_val_list:
5985 : ecpg_sconst
5986 : {
5987 0 : $$ = $1;
5988 : }
5989 : | enum_val_list ',' ecpg_sconst
5990 : {
5991 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
5992 : }
5993 : ;
5994 :
5995 :
5996 : AlterEnumStmt:
5997 : ALTER TYPE_P any_name ADD_P VALUE_P opt_if_not_exists ecpg_sconst
5998 : {
5999 0 : $$ = cat_str(5,mm_strdup("alter type"),$3,mm_strdup("add value"),$6,$7);
6000 : }
6001 : | ALTER TYPE_P any_name ADD_P VALUE_P opt_if_not_exists ecpg_sconst BEFORE ecpg_sconst
6002 : {
6003 0 : $$ = cat_str(7,mm_strdup("alter type"),$3,mm_strdup("add value"),$6,$7,mm_strdup("before"),$9);
6004 : }
6005 : | ALTER TYPE_P any_name ADD_P VALUE_P opt_if_not_exists ecpg_sconst AFTER ecpg_sconst
6006 : {
6007 0 : $$ = cat_str(7,mm_strdup("alter type"),$3,mm_strdup("add value"),$6,$7,mm_strdup("after"),$9);
6008 : }
6009 : | ALTER TYPE_P any_name RENAME VALUE_P ecpg_sconst TO ecpg_sconst
6010 : {
6011 0 : $$ = cat_str(6,mm_strdup("alter type"),$3,mm_strdup("rename value"),$6,mm_strdup("to"),$8);
6012 : }
6013 : | ALTER TYPE_P any_name DROP VALUE_P ecpg_sconst
6014 : {
6015 0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
6016 0 : $$ = cat_str(4,mm_strdup("alter type"),$3,mm_strdup("drop value"),$6);
6017 : }
6018 : ;
6019 :
6020 :
6021 : opt_if_not_exists:
6022 : IF_P NOT EXISTS
6023 : {
6024 0 : $$ = mm_strdup("if not exists");
6025 : }
6026 : |
6027 : {
6028 0 : $$=EMPTY; }
6029 : ;
6030 :
6031 :
6032 : CreateOpClassStmt:
6033 : CREATE OPERATOR CLASS any_name opt_default FOR TYPE_P Typename USING name opt_opfamily AS opclass_item_list
6034 : {
6035 0 : $$ = cat_str(10,mm_strdup("create operator class"),$4,$5,mm_strdup("for type"),$8,mm_strdup("using"),$10,$11,mm_strdup("as"),$13);
6036 : }
6037 : ;
6038 :
6039 :
6040 : opclass_item_list:
6041 : opclass_item
6042 : {
6043 0 : $$ = $1;
6044 : }
6045 : | opclass_item_list ',' opclass_item
6046 : {
6047 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
6048 : }
6049 : ;
6050 :
6051 :
6052 : opclass_item:
6053 : OPERATOR Iconst any_operator opclass_purpose opt_recheck
6054 : {
6055 0 : $$ = cat_str(5,mm_strdup("operator"),$2,$3,$4,$5);
6056 : }
6057 : | OPERATOR Iconst operator_with_argtypes opclass_purpose opt_recheck
6058 : {
6059 0 : $$ = cat_str(5,mm_strdup("operator"),$2,$3,$4,$5);
6060 : }
6061 : | FUNCTION Iconst function_with_argtypes
6062 : {
6063 0 : $$ = cat_str(3,mm_strdup("function"),$2,$3);
6064 : }
6065 : | FUNCTION Iconst '(' type_list ')' function_with_argtypes
6066 : {
6067 0 : $$ = cat_str(6,mm_strdup("function"),$2,mm_strdup("("),$4,mm_strdup(")"),$6);
6068 : }
6069 : | STORAGE Typename
6070 : {
6071 0 : $$ = cat_str(2,mm_strdup("storage"),$2);
6072 : }
6073 : ;
6074 :
6075 :
6076 : opt_default:
6077 : DEFAULT
6078 : {
6079 0 : $$ = mm_strdup("default");
6080 : }
6081 : |
6082 : {
6083 0 : $$=EMPTY; }
6084 : ;
6085 :
6086 :
6087 : opt_opfamily:
6088 : FAMILY any_name
6089 : {
6090 0 : $$ = cat_str(2,mm_strdup("family"),$2);
6091 : }
6092 : |
6093 : {
6094 0 : $$=EMPTY; }
6095 : ;
6096 :
6097 :
6098 : opclass_purpose:
6099 : FOR SEARCH
6100 : {
6101 0 : $$ = mm_strdup("for search");
6102 : }
6103 : | FOR ORDER BY any_name
6104 : {
6105 0 : $$ = cat_str(2,mm_strdup("for order by"),$4);
6106 : }
6107 : |
6108 : {
6109 0 : $$=EMPTY; }
6110 : ;
6111 :
6112 :
6113 : opt_recheck:
6114 : RECHECK
6115 : {
6116 0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
6117 0 : $$ = mm_strdup("recheck");
6118 : }
6119 : |
6120 : {
6121 0 : $$=EMPTY; }
6122 : ;
6123 :
6124 :
6125 : CreateOpFamilyStmt:
6126 : CREATE OPERATOR FAMILY any_name USING name
6127 : {
6128 0 : $$ = cat_str(4,mm_strdup("create operator family"),$4,mm_strdup("using"),$6);
6129 : }
6130 : ;
6131 :
6132 :
6133 : AlterOpFamilyStmt:
6134 : ALTER OPERATOR FAMILY any_name USING name ADD_P opclass_item_list
6135 : {
6136 0 : $$ = cat_str(6,mm_strdup("alter operator family"),$4,mm_strdup("using"),$6,mm_strdup("add"),$8);
6137 : }
6138 : | ALTER OPERATOR FAMILY any_name USING name DROP opclass_drop_list
6139 : {
6140 0 : $$ = cat_str(6,mm_strdup("alter operator family"),$4,mm_strdup("using"),$6,mm_strdup("drop"),$8);
6141 : }
6142 : ;
6143 :
6144 :
6145 : opclass_drop_list:
6146 : opclass_drop
6147 : {
6148 0 : $$ = $1;
6149 : }
6150 : | opclass_drop_list ',' opclass_drop
6151 : {
6152 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
6153 : }
6154 : ;
6155 :
6156 :
6157 : opclass_drop:
6158 : OPERATOR Iconst '(' type_list ')'
6159 : {
6160 0 : $$ = cat_str(5,mm_strdup("operator"),$2,mm_strdup("("),$4,mm_strdup(")"));
6161 : }
6162 : | FUNCTION Iconst '(' type_list ')'
6163 : {
6164 0 : $$ = cat_str(5,mm_strdup("function"),$2,mm_strdup("("),$4,mm_strdup(")"));
6165 : }
6166 : ;
6167 :
6168 :
6169 : DropOpClassStmt:
6170 : DROP OPERATOR CLASS any_name USING name opt_drop_behavior
6171 : {
6172 0 : $$ = cat_str(5,mm_strdup("drop operator class"),$4,mm_strdup("using"),$6,$7);
6173 : }
6174 : | DROP OPERATOR CLASS IF_P EXISTS any_name USING name opt_drop_behavior
6175 : {
6176 0 : $$ = cat_str(5,mm_strdup("drop operator class if exists"),$6,mm_strdup("using"),$8,$9);
6177 : }
6178 : ;
6179 :
6180 :
6181 : DropOpFamilyStmt:
6182 : DROP OPERATOR FAMILY any_name USING name opt_drop_behavior
6183 : {
6184 0 : $$ = cat_str(5,mm_strdup("drop operator family"),$4,mm_strdup("using"),$6,$7);
6185 : }
6186 : | DROP OPERATOR FAMILY IF_P EXISTS any_name USING name opt_drop_behavior
6187 : {
6188 0 : $$ = cat_str(5,mm_strdup("drop operator family if exists"),$6,mm_strdup("using"),$8,$9);
6189 : }
6190 : ;
6191 :
6192 :
6193 : DropOwnedStmt:
6194 : DROP OWNED BY role_list opt_drop_behavior
6195 : {
6196 0 : $$ = cat_str(3,mm_strdup("drop owned by"),$4,$5);
6197 : }
6198 : ;
6199 :
6200 :
6201 : ReassignOwnedStmt:
6202 : REASSIGN OWNED BY role_list TO RoleSpec
6203 : {
6204 0 : $$ = cat_str(4,mm_strdup("reassign owned by"),$4,mm_strdup("to"),$6);
6205 : }
6206 : ;
6207 :
6208 :
6209 : DropStmt:
6210 : DROP object_type_any_name IF_P EXISTS any_name_list opt_drop_behavior
6211 : {
6212 6 : $$ = cat_str(5,mm_strdup("drop"),$2,mm_strdup("if exists"),$5,$6);
6213 : }
6214 : | DROP object_type_any_name any_name_list opt_drop_behavior
6215 : {
6216 68 : $$ = cat_str(4,mm_strdup("drop"),$2,$3,$4);
6217 : }
6218 : | DROP drop_type_name IF_P EXISTS name_list opt_drop_behavior
6219 : {
6220 0 : $$ = cat_str(5,mm_strdup("drop"),$2,mm_strdup("if exists"),$5,$6);
6221 : }
6222 : | DROP drop_type_name name_list opt_drop_behavior
6223 : {
6224 0 : $$ = cat_str(4,mm_strdup("drop"),$2,$3,$4);
6225 : }
6226 : | DROP object_type_name_on_any_name name ON any_name opt_drop_behavior
6227 : {
6228 2 : $$ = cat_str(6,mm_strdup("drop"),$2,$3,mm_strdup("on"),$5,$6);
6229 : }
6230 : | DROP object_type_name_on_any_name IF_P EXISTS name ON any_name opt_drop_behavior
6231 : {
6232 0 : $$ = cat_str(7,mm_strdup("drop"),$2,mm_strdup("if exists"),$5,mm_strdup("on"),$7,$8);
6233 : }
6234 : | DROP TYPE_P type_name_list opt_drop_behavior
6235 : {
6236 0 : $$ = cat_str(3,mm_strdup("drop type"),$3,$4);
6237 : }
6238 : | DROP TYPE_P IF_P EXISTS type_name_list opt_drop_behavior
6239 : {
6240 0 : $$ = cat_str(3,mm_strdup("drop type if exists"),$5,$6);
6241 : }
6242 : | DROP DOMAIN_P type_name_list opt_drop_behavior
6243 : {
6244 0 : $$ = cat_str(3,mm_strdup("drop domain"),$3,$4);
6245 : }
6246 : | DROP DOMAIN_P IF_P EXISTS type_name_list opt_drop_behavior
6247 : {
6248 0 : $$ = cat_str(3,mm_strdup("drop domain if exists"),$5,$6);
6249 : }
6250 : | DROP INDEX CONCURRENTLY any_name_list opt_drop_behavior
6251 : {
6252 0 : $$ = cat_str(3,mm_strdup("drop index concurrently"),$4,$5);
6253 : }
6254 : | DROP INDEX CONCURRENTLY IF_P EXISTS any_name_list opt_drop_behavior
6255 : {
6256 0 : $$ = cat_str(3,mm_strdup("drop index concurrently if exists"),$6,$7);
6257 : }
6258 : ;
6259 :
6260 :
6261 : object_type_any_name:
6262 : TABLE
6263 : {
6264 74 : $$ = mm_strdup("table");
6265 : }
6266 : | SEQUENCE
6267 : {
6268 0 : $$ = mm_strdup("sequence");
6269 : }
6270 : | VIEW
6271 : {
6272 0 : $$ = mm_strdup("view");
6273 : }
6274 : | MATERIALIZED VIEW
6275 : {
6276 0 : $$ = mm_strdup("materialized view");
6277 : }
6278 : | INDEX
6279 : {
6280 0 : $$ = mm_strdup("index");
6281 : }
6282 : | FOREIGN TABLE
6283 : {
6284 0 : $$ = mm_strdup("foreign table");
6285 : }
6286 : | COLLATION
6287 : {
6288 0 : $$ = mm_strdup("collation");
6289 : }
6290 : | CONVERSION_P
6291 : {
6292 0 : $$ = mm_strdup("conversion");
6293 : }
6294 : | STATISTICS
6295 : {
6296 0 : $$ = mm_strdup("statistics");
6297 : }
6298 : | TEXT_P SEARCH PARSER
6299 : {
6300 0 : $$ = mm_strdup("text search parser");
6301 : }
6302 : | TEXT_P SEARCH DICTIONARY
6303 : {
6304 0 : $$ = mm_strdup("text search dictionary");
6305 : }
6306 : | TEXT_P SEARCH TEMPLATE
6307 : {
6308 0 : $$ = mm_strdup("text search template");
6309 : }
6310 : | TEXT_P SEARCH CONFIGURATION
6311 : {
6312 0 : $$ = mm_strdup("text search configuration");
6313 : }
6314 : ;
6315 :
6316 :
6317 : object_type_name:
6318 : drop_type_name
6319 : {
6320 0 : $$ = $1;
6321 : }
6322 : | DATABASE
6323 : {
6324 0 : $$ = mm_strdup("database");
6325 : }
6326 : | ROLE
6327 : {
6328 0 : $$ = mm_strdup("role");
6329 : }
6330 : | SUBSCRIPTION
6331 : {
6332 0 : $$ = mm_strdup("subscription");
6333 : }
6334 : | TABLESPACE
6335 : {
6336 0 : $$ = mm_strdup("tablespace");
6337 : }
6338 : ;
6339 :
6340 :
6341 : drop_type_name:
6342 : ACCESS METHOD
6343 : {
6344 0 : $$ = mm_strdup("access method");
6345 : }
6346 : | EVENT TRIGGER
6347 : {
6348 0 : $$ = mm_strdup("event trigger");
6349 : }
6350 : | EXTENSION
6351 : {
6352 0 : $$ = mm_strdup("extension");
6353 : }
6354 : | FOREIGN DATA_P WRAPPER
6355 : {
6356 0 : $$ = mm_strdup("foreign data wrapper");
6357 : }
6358 : | opt_procedural LANGUAGE
6359 : {
6360 0 : $$ = cat_str(2,$1,mm_strdup("language"));
6361 : }
6362 : | PUBLICATION
6363 : {
6364 0 : $$ = mm_strdup("publication");
6365 : }
6366 : | SCHEMA
6367 : {
6368 0 : $$ = mm_strdup("schema");
6369 : }
6370 : | SERVER
6371 : {
6372 0 : $$ = mm_strdup("server");
6373 : }
6374 : ;
6375 :
6376 :
6377 : object_type_name_on_any_name:
6378 : POLICY
6379 : {
6380 0 : $$ = mm_strdup("policy");
6381 : }
6382 : | RULE
6383 : {
6384 0 : $$ = mm_strdup("rule");
6385 : }
6386 : | TRIGGER
6387 : {
6388 2 : $$ = mm_strdup("trigger");
6389 : }
6390 : ;
6391 :
6392 :
6393 : any_name_list:
6394 : any_name
6395 : {
6396 74 : $$ = $1;
6397 : }
6398 : | any_name_list ',' any_name
6399 : {
6400 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
6401 : }
6402 : ;
6403 :
6404 :
6405 : any_name:
6406 : ColId
6407 : {
6408 78 : $$ = $1;
6409 : }
6410 : | ColId attrs
6411 : {
6412 0 : $$ = cat_str(2,$1,$2);
6413 : }
6414 : ;
6415 :
6416 :
6417 : attrs:
6418 : '.' attr_name
6419 : {
6420 0 : $$ = cat_str(2,mm_strdup("."),$2);
6421 : }
6422 : | attrs '.' attr_name
6423 : {
6424 0 : $$ = cat_str(3,$1,mm_strdup("."),$3);
6425 : }
6426 : ;
6427 :
6428 :
6429 : type_name_list:
6430 : Typename
6431 : {
6432 0 : $$ = $1;
6433 : }
6434 : | type_name_list ',' Typename
6435 : {
6436 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
6437 : }
6438 : ;
6439 :
6440 :
6441 : TruncateStmt:
6442 : TRUNCATE opt_table relation_expr_list opt_restart_seqs opt_drop_behavior
6443 : {
6444 44 : $$ = cat_str(5,mm_strdup("truncate"),$2,$3,$4,$5);
6445 : }
6446 : ;
6447 :
6448 :
6449 : opt_restart_seqs:
6450 : CONTINUE_P IDENTITY_P
6451 : {
6452 0 : $$ = mm_strdup("continue identity");
6453 : }
6454 : | RESTART IDENTITY_P
6455 : {
6456 0 : $$ = mm_strdup("restart identity");
6457 : }
6458 : |
6459 : {
6460 44 : $$=EMPTY; }
6461 : ;
6462 :
6463 :
6464 : CommentStmt:
6465 : COMMENT ON object_type_any_name any_name IS comment_text
6466 : {
6467 0 : $$ = cat_str(5,mm_strdup("comment on"),$3,$4,mm_strdup("is"),$6);
6468 : }
6469 : | COMMENT ON COLUMN any_name IS comment_text
6470 : {
6471 0 : $$ = cat_str(4,mm_strdup("comment on column"),$4,mm_strdup("is"),$6);
6472 : }
6473 : | COMMENT ON object_type_name name IS comment_text
6474 : {
6475 0 : $$ = cat_str(5,mm_strdup("comment on"),$3,$4,mm_strdup("is"),$6);
6476 : }
6477 : | COMMENT ON TYPE_P Typename IS comment_text
6478 : {
6479 0 : $$ = cat_str(4,mm_strdup("comment on type"),$4,mm_strdup("is"),$6);
6480 : }
6481 : | COMMENT ON DOMAIN_P Typename IS comment_text
6482 : {
6483 0 : $$ = cat_str(4,mm_strdup("comment on domain"),$4,mm_strdup("is"),$6);
6484 : }
6485 : | COMMENT ON AGGREGATE aggregate_with_argtypes IS comment_text
6486 : {
6487 0 : $$ = cat_str(4,mm_strdup("comment on aggregate"),$4,mm_strdup("is"),$6);
6488 : }
6489 : | COMMENT ON FUNCTION function_with_argtypes IS comment_text
6490 : {
6491 0 : $$ = cat_str(4,mm_strdup("comment on function"),$4,mm_strdup("is"),$6);
6492 : }
6493 : | COMMENT ON OPERATOR operator_with_argtypes IS comment_text
6494 : {
6495 0 : $$ = cat_str(4,mm_strdup("comment on operator"),$4,mm_strdup("is"),$6);
6496 : }
6497 : | COMMENT ON CONSTRAINT name ON any_name IS comment_text
6498 : {
6499 0 : $$ = cat_str(6,mm_strdup("comment on constraint"),$4,mm_strdup("on"),$6,mm_strdup("is"),$8);
6500 : }
6501 : | COMMENT ON CONSTRAINT name ON DOMAIN_P any_name IS comment_text
6502 : {
6503 0 : $$ = cat_str(6,mm_strdup("comment on constraint"),$4,mm_strdup("on domain"),$7,mm_strdup("is"),$9);
6504 : }
6505 : | COMMENT ON object_type_name_on_any_name name ON any_name IS comment_text
6506 : {
6507 0 : $$ = cat_str(7,mm_strdup("comment on"),$3,$4,mm_strdup("on"),$6,mm_strdup("is"),$8);
6508 : }
6509 : | COMMENT ON PROCEDURE function_with_argtypes IS comment_text
6510 : {
6511 0 : $$ = cat_str(4,mm_strdup("comment on procedure"),$4,mm_strdup("is"),$6);
6512 : }
6513 : | COMMENT ON ROUTINE function_with_argtypes IS comment_text
6514 : {
6515 0 : $$ = cat_str(4,mm_strdup("comment on routine"),$4,mm_strdup("is"),$6);
6516 : }
6517 : | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text
6518 : {
6519 0 : $$ = cat_str(6,mm_strdup("comment on transform for"),$5,mm_strdup("language"),$7,mm_strdup("is"),$9);
6520 : }
6521 : | COMMENT ON OPERATOR CLASS any_name USING name IS comment_text
6522 : {
6523 0 : $$ = cat_str(6,mm_strdup("comment on operator class"),$5,mm_strdup("using"),$7,mm_strdup("is"),$9);
6524 : }
6525 : | COMMENT ON OPERATOR FAMILY any_name USING name IS comment_text
6526 : {
6527 0 : $$ = cat_str(6,mm_strdup("comment on operator family"),$5,mm_strdup("using"),$7,mm_strdup("is"),$9);
6528 : }
6529 : | COMMENT ON LARGE_P OBJECT_P NumericOnly IS comment_text
6530 : {
6531 0 : $$ = cat_str(4,mm_strdup("comment on large object"),$5,mm_strdup("is"),$7);
6532 : }
6533 : | COMMENT ON CAST '(' Typename AS Typename ')' IS comment_text
6534 : {
6535 0 : $$ = cat_str(6,mm_strdup("comment on cast ("),$5,mm_strdup("as"),$7,mm_strdup(") is"),$10);
6536 : }
6537 : ;
6538 :
6539 :
6540 : comment_text:
6541 : ecpg_sconst
6542 : {
6543 0 : $$ = $1;
6544 : }
6545 : | NULL_P
6546 : {
6547 0 : $$ = mm_strdup("null");
6548 : }
6549 : ;
6550 :
6551 :
6552 : SecLabelStmt:
6553 : SECURITY LABEL opt_provider ON object_type_any_name any_name IS security_label
6554 : {
6555 0 : $$ = cat_str(7,mm_strdup("security label"),$3,mm_strdup("on"),$5,$6,mm_strdup("is"),$8);
6556 : }
6557 : | SECURITY LABEL opt_provider ON COLUMN any_name IS security_label
6558 : {
6559 0 : $$ = cat_str(6,mm_strdup("security label"),$3,mm_strdup("on column"),$6,mm_strdup("is"),$8);
6560 : }
6561 : | SECURITY LABEL opt_provider ON object_type_name name IS security_label
6562 : {
6563 0 : $$ = cat_str(7,mm_strdup("security label"),$3,mm_strdup("on"),$5,$6,mm_strdup("is"),$8);
6564 : }
6565 : | SECURITY LABEL opt_provider ON TYPE_P Typename IS security_label
6566 : {
6567 0 : $$ = cat_str(6,mm_strdup("security label"),$3,mm_strdup("on type"),$6,mm_strdup("is"),$8);
6568 : }
6569 : | SECURITY LABEL opt_provider ON DOMAIN_P Typename IS security_label
6570 : {
6571 0 : $$ = cat_str(6,mm_strdup("security label"),$3,mm_strdup("on domain"),$6,mm_strdup("is"),$8);
6572 : }
6573 : | SECURITY LABEL opt_provider ON AGGREGATE aggregate_with_argtypes IS security_label
6574 : {
6575 0 : $$ = cat_str(6,mm_strdup("security label"),$3,mm_strdup("on aggregate"),$6,mm_strdup("is"),$8);
6576 : }
6577 : | SECURITY LABEL opt_provider ON FUNCTION function_with_argtypes IS security_label
6578 : {
6579 0 : $$ = cat_str(6,mm_strdup("security label"),$3,mm_strdup("on function"),$6,mm_strdup("is"),$8);
6580 : }
6581 : | SECURITY LABEL opt_provider ON LARGE_P OBJECT_P NumericOnly IS security_label
6582 : {
6583 0 : $$ = cat_str(6,mm_strdup("security label"),$3,mm_strdup("on large object"),$7,mm_strdup("is"),$9);
6584 : }
6585 : | SECURITY LABEL opt_provider ON PROCEDURE function_with_argtypes IS security_label
6586 : {
6587 0 : $$ = cat_str(6,mm_strdup("security label"),$3,mm_strdup("on procedure"),$6,mm_strdup("is"),$8);
6588 : }
6589 : | SECURITY LABEL opt_provider ON ROUTINE function_with_argtypes IS security_label
6590 : {
6591 0 : $$ = cat_str(6,mm_strdup("security label"),$3,mm_strdup("on routine"),$6,mm_strdup("is"),$8);
6592 : }
6593 : ;
6594 :
6595 :
6596 : opt_provider:
6597 : FOR NonReservedWord_or_Sconst
6598 : {
6599 0 : $$ = cat_str(2,mm_strdup("for"),$2);
6600 : }
6601 : |
6602 : {
6603 0 : $$=EMPTY; }
6604 : ;
6605 :
6606 :
6607 : security_label:
6608 : ecpg_sconst
6609 : {
6610 0 : $$ = $1;
6611 : }
6612 : | NULL_P
6613 : {
6614 0 : $$ = mm_strdup("null");
6615 : }
6616 : ;
6617 :
6618 :
6619 : FetchStmt:
6620 : FETCH fetch_args
6621 : {
6622 14 : $$ = cat_str(2,mm_strdup("fetch"),$2);
6623 : }
6624 : | MOVE fetch_args
6625 : {
6626 10 : $$ = cat_str(2,mm_strdup("move"),$2);
6627 : }
6628 : | FETCH fetch_args ecpg_fetch_into
6629 : {
6630 96 : $$ = cat2_str(mm_strdup("fetch"), $2);
6631 : }
6632 : | FETCH FORWARD cursor_name opt_ecpg_fetch_into
6633 : {
6634 4 : char *cursor_marker = $3[0] == ':' ? mm_strdup("$0") : $3;
6635 4 : struct cursor *ptr = add_additional_variables($3, false);
6636 4 : if (ptr -> connection)
6637 2 : connection = mm_strdup(ptr -> connection);
6638 :
6639 4 : $$ = cat_str(2, mm_strdup("fetch forward"), cursor_marker);
6640 : }
6641 : | FETCH FORWARD from_in cursor_name opt_ecpg_fetch_into
6642 : {
6643 2 : char *cursor_marker = $4[0] == ':' ? mm_strdup("$0") : $4;
6644 2 : struct cursor *ptr = add_additional_variables($4, false);
6645 2 : if (ptr -> connection)
6646 2 : connection = mm_strdup(ptr -> connection);
6647 :
6648 2 : $$ = cat_str(2, mm_strdup("fetch forward from"), cursor_marker);
6649 : }
6650 : | FETCH BACKWARD cursor_name opt_ecpg_fetch_into
6651 : {
6652 0 : char *cursor_marker = $3[0] == ':' ? mm_strdup("$0") : $3;
6653 0 : struct cursor *ptr = add_additional_variables($3, false);
6654 0 : if (ptr -> connection)
6655 0 : connection = mm_strdup(ptr -> connection);
6656 :
6657 0 : $$ = cat_str(2, mm_strdup("fetch backward"), cursor_marker);
6658 : }
6659 : | FETCH BACKWARD from_in cursor_name opt_ecpg_fetch_into
6660 : {
6661 0 : char *cursor_marker = $4[0] == ':' ? mm_strdup("$0") : $4;
6662 0 : struct cursor *ptr = add_additional_variables($4, false);
6663 0 : if (ptr -> connection)
6664 0 : connection = mm_strdup(ptr -> connection);
6665 :
6666 0 : $$ = cat_str(2, mm_strdup("fetch backward from"), cursor_marker);
6667 : }
6668 : | MOVE FORWARD cursor_name
6669 : {
6670 0 : char *cursor_marker = $3[0] == ':' ? mm_strdup("$0") : $3;
6671 0 : struct cursor *ptr = add_additional_variables($3, false);
6672 0 : if (ptr -> connection)
6673 0 : connection = mm_strdup(ptr -> connection);
6674 :
6675 0 : $$ = cat_str(2, mm_strdup("move forward"), cursor_marker);
6676 : }
6677 : | MOVE FORWARD from_in cursor_name
6678 : {
6679 0 : char *cursor_marker = $4[0] == ':' ? mm_strdup("$0") : $4;
6680 0 : struct cursor *ptr = add_additional_variables($4, false);
6681 0 : if (ptr -> connection)
6682 0 : connection = mm_strdup(ptr -> connection);
6683 :
6684 0 : $$ = cat_str(2, mm_strdup("move forward from"), cursor_marker);
6685 : }
6686 : | MOVE BACKWARD cursor_name
6687 : {
6688 0 : char *cursor_marker = $3[0] == ':' ? mm_strdup("$0") : $3;
6689 0 : struct cursor *ptr = add_additional_variables($3, false);
6690 0 : if (ptr -> connection)
6691 0 : connection = mm_strdup(ptr -> connection);
6692 :
6693 0 : $$ = cat_str(2, mm_strdup("move backward"), cursor_marker);
6694 : }
6695 : | MOVE BACKWARD from_in cursor_name
6696 : {
6697 0 : char *cursor_marker = $4[0] == ':' ? mm_strdup("$0") : $4;
6698 0 : struct cursor *ptr = add_additional_variables($4, false);
6699 0 : if (ptr -> connection)
6700 0 : connection = mm_strdup(ptr -> connection);
6701 :
6702 0 : $$ = cat_str(2, mm_strdup("move backward from"), cursor_marker);
6703 : }
6704 : ;
6705 :
6706 :
6707 : fetch_args:
6708 : cursor_name
6709 : {
6710 32 : struct cursor *ptr = add_additional_variables($1, false);
6711 32 : if (ptr -> connection)
6712 12 : connection = mm_strdup(ptr -> connection);
6713 :
6714 32 : if ($1[0] == ':')
6715 : {
6716 6 : free($1);
6717 6 : $1 = mm_strdup("$0");
6718 : }
6719 :
6720 32 : $$ = $1;
6721 : }
6722 : | from_in cursor_name
6723 : {
6724 22 : struct cursor *ptr = add_additional_variables($2, false);
6725 22 : if (ptr -> connection)
6726 6 : connection = mm_strdup(ptr -> connection);
6727 :
6728 22 : if ($2[0] == ':')
6729 : {
6730 6 : free($2);
6731 6 : $2 = mm_strdup("$0");
6732 : }
6733 :
6734 22 : $$ = cat_str(2,$1,$2);
6735 : }
6736 : | NEXT opt_from_in cursor_name
6737 : {
6738 6 : struct cursor *ptr = add_additional_variables($3, false);
6739 6 : if (ptr -> connection)
6740 0 : connection = mm_strdup(ptr -> connection);
6741 :
6742 6 : if ($3[0] == ':')
6743 : {
6744 0 : free($3);
6745 0 : $3 = mm_strdup("$0");
6746 : }
6747 :
6748 6 : $$ = cat_str(3,mm_strdup("next"),$2,$3);
6749 : }
6750 : | PRIOR opt_from_in cursor_name
6751 : {
6752 0 : struct cursor *ptr = add_additional_variables($3, false);
6753 0 : if (ptr -> connection)
6754 0 : connection = mm_strdup(ptr -> connection);
6755 :
6756 0 : if ($3[0] == ':')
6757 : {
6758 0 : free($3);
6759 0 : $3 = mm_strdup("$0");
6760 : }
6761 :
6762 0 : $$ = cat_str(3,mm_strdup("prior"),$2,$3);
6763 : }
6764 : | FIRST_P opt_from_in cursor_name
6765 : {
6766 0 : struct cursor *ptr = add_additional_variables($3, false);
6767 0 : if (ptr -> connection)
6768 0 : connection = mm_strdup(ptr -> connection);
6769 :
6770 0 : if ($3[0] == ':')
6771 : {
6772 0 : free($3);
6773 0 : $3 = mm_strdup("$0");
6774 : }
6775 :
6776 0 : $$ = cat_str(3,mm_strdup("first"),$2,$3);
6777 : }
6778 : | LAST_P opt_from_in cursor_name
6779 : {
6780 0 : struct cursor *ptr = add_additional_variables($3, false);
6781 0 : if (ptr -> connection)
6782 0 : connection = mm_strdup(ptr -> connection);
6783 :
6784 0 : if ($3[0] == ':')
6785 : {
6786 0 : free($3);
6787 0 : $3 = mm_strdup("$0");
6788 : }
6789 :
6790 0 : $$ = cat_str(3,mm_strdup("last"),$2,$3);
6791 : }
6792 : | ABSOLUTE_P SignedIconst opt_from_in cursor_name
6793 : {
6794 8 : struct cursor *ptr = add_additional_variables($4, false);
6795 8 : if (ptr -> connection)
6796 8 : connection = mm_strdup(ptr -> connection);
6797 :
6798 8 : if ($4[0] == ':')
6799 : {
6800 8 : free($4);
6801 8 : $4 = mm_strdup("$0");
6802 : }
6803 8 : if ($2[0] == '$')
6804 : {
6805 0 : free($2);
6806 0 : $2 = mm_strdup("$0");
6807 : }
6808 :
6809 8 : $$ = cat_str(4,mm_strdup("absolute"),$2,$3,$4);
6810 : }
6811 : | RELATIVE_P SignedIconst opt_from_in cursor_name
6812 : {
6813 0 : struct cursor *ptr = add_additional_variables($4, false);
6814 0 : if (ptr -> connection)
6815 0 : connection = mm_strdup(ptr -> connection);
6816 :
6817 0 : if ($4[0] == ':')
6818 : {
6819 0 : free($4);
6820 0 : $4 = mm_strdup("$0");
6821 : }
6822 0 : if ($2[0] == '$')
6823 : {
6824 0 : free($2);
6825 0 : $2 = mm_strdup("$0");
6826 : }
6827 :
6828 0 : $$ = cat_str(4,mm_strdup("relative"),$2,$3,$4);
6829 : }
6830 : | SignedIconst opt_from_in cursor_name
6831 : {
6832 48 : struct cursor *ptr = add_additional_variables($3, false);
6833 48 : if (ptr -> connection)
6834 32 : connection = mm_strdup(ptr -> connection);
6835 :
6836 48 : if ($3[0] == ':')
6837 : {
6838 32 : free($3);
6839 32 : $3 = mm_strdup("$0");
6840 : }
6841 48 : if ($1[0] == '$')
6842 : {
6843 18 : free($1);
6844 18 : $1 = mm_strdup("$0");
6845 : }
6846 :
6847 48 : $$ = cat_str(3,$1,$2,$3);
6848 : }
6849 : | ALL opt_from_in cursor_name
6850 : {
6851 2 : struct cursor *ptr = add_additional_variables($3, false);
6852 2 : if (ptr -> connection)
6853 0 : connection = mm_strdup(ptr -> connection);
6854 :
6855 2 : if ($3[0] == ':')
6856 : {
6857 0 : free($3);
6858 0 : $3 = mm_strdup("$0");
6859 : }
6860 :
6861 2 : $$ = cat_str(3,mm_strdup("all"),$2,$3);
6862 : }
6863 : | FORWARD SignedIconst opt_from_in cursor_name
6864 : {
6865 0 : struct cursor *ptr = add_additional_variables($4, false);
6866 0 : if (ptr -> connection)
6867 0 : connection = mm_strdup(ptr -> connection);
6868 :
6869 0 : if ($4[0] == ':')
6870 : {
6871 0 : free($4);
6872 0 : $4 = mm_strdup("$0");
6873 : }
6874 0 : if ($2[0] == '$')
6875 : {
6876 0 : free($2);
6877 0 : $2 = mm_strdup("$0");
6878 : }
6879 :
6880 0 : $$ = cat_str(4,mm_strdup("forward"),$2,$3,$4);
6881 : }
6882 : | FORWARD ALL opt_from_in cursor_name
6883 : {
6884 0 : struct cursor *ptr = add_additional_variables($4, false);
6885 0 : if (ptr -> connection)
6886 0 : connection = mm_strdup(ptr -> connection);
6887 :
6888 0 : if ($4[0] == ':')
6889 : {
6890 0 : free($4);
6891 0 : $4 = mm_strdup("$0");
6892 : }
6893 :
6894 0 : $$ = cat_str(3,mm_strdup("forward all"),$3,$4);
6895 : }
6896 : | BACKWARD SignedIconst opt_from_in cursor_name
6897 : {
6898 2 : struct cursor *ptr = add_additional_variables($4, false);
6899 2 : if (ptr -> connection)
6900 0 : connection = mm_strdup(ptr -> connection);
6901 :
6902 2 : if ($4[0] == ':')
6903 : {
6904 0 : free($4);
6905 0 : $4 = mm_strdup("$0");
6906 : }
6907 2 : if ($2[0] == '$')
6908 : {
6909 0 : free($2);
6910 0 : $2 = mm_strdup("$0");
6911 : }
6912 :
6913 2 : $$ = cat_str(4,mm_strdup("backward"),$2,$3,$4);
6914 : }
6915 : | BACKWARD ALL opt_from_in cursor_name
6916 : {
6917 0 : struct cursor *ptr = add_additional_variables($4, false);
6918 0 : if (ptr -> connection)
6919 0 : connection = mm_strdup(ptr -> connection);
6920 :
6921 0 : if ($4[0] == ':')
6922 : {
6923 0 : free($4);
6924 0 : $4 = mm_strdup("$0");
6925 : }
6926 :
6927 0 : $$ = cat_str(3,mm_strdup("backward all"),$3,$4);
6928 : }
6929 : ;
6930 :
6931 :
6932 : from_in:
6933 : FROM
6934 : {
6935 46 : $$ = mm_strdup("from");
6936 : }
6937 : | IN_P
6938 : {
6939 22 : $$ = mm_strdup("in");
6940 : }
6941 : ;
6942 :
6943 :
6944 : opt_from_in:
6945 : from_in
6946 : {
6947 44 : $$ = $1;
6948 : }
6949 : |
6950 : {
6951 22 : $$=EMPTY; }
6952 : ;
6953 :
6954 :
6955 : GrantStmt:
6956 : GRANT privileges ON privilege_target TO grantee_list opt_grant_grant_option opt_granted_by
6957 : {
6958 0 : $$ = cat_str(8,mm_strdup("grant"),$2,mm_strdup("on"),$4,mm_strdup("to"),$6,$7,$8);
6959 : }
6960 : ;
6961 :
6962 :
6963 : RevokeStmt:
6964 : REVOKE privileges ON privilege_target FROM grantee_list opt_granted_by opt_drop_behavior
6965 : {
6966 0 : $$ = cat_str(8,mm_strdup("revoke"),$2,mm_strdup("on"),$4,mm_strdup("from"),$6,$7,$8);
6967 : }
6968 : | REVOKE GRANT OPTION FOR privileges ON privilege_target FROM grantee_list opt_granted_by opt_drop_behavior
6969 : {
6970 0 : $$ = cat_str(8,mm_strdup("revoke grant option for"),$5,mm_strdup("on"),$7,mm_strdup("from"),$9,$10,$11);
6971 : }
6972 : ;
6973 :
6974 :
6975 : privileges:
6976 : privilege_list
6977 : {
6978 0 : $$ = $1;
6979 : }
6980 : | ALL
6981 : {
6982 0 : $$ = mm_strdup("all");
6983 : }
6984 : | ALL PRIVILEGES
6985 : {
6986 0 : $$ = mm_strdup("all privileges");
6987 : }
6988 : | ALL '(' columnList ')'
6989 : {
6990 0 : $$ = cat_str(3,mm_strdup("all ("),$3,mm_strdup(")"));
6991 : }
6992 : | ALL PRIVILEGES '(' columnList ')'
6993 : {
6994 0 : $$ = cat_str(3,mm_strdup("all privileges ("),$4,mm_strdup(")"));
6995 : }
6996 : ;
6997 :
6998 :
6999 : privilege_list:
7000 : privilege
7001 : {
7002 0 : $$ = $1;
7003 : }
7004 : | privilege_list ',' privilege
7005 : {
7006 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
7007 : }
7008 : ;
7009 :
7010 :
7011 : privilege:
7012 : SELECT opt_column_list
7013 : {
7014 0 : $$ = cat_str(2,mm_strdup("select"),$2);
7015 : }
7016 : | REFERENCES opt_column_list
7017 : {
7018 0 : $$ = cat_str(2,mm_strdup("references"),$2);
7019 : }
7020 : | CREATE opt_column_list
7021 : {
7022 0 : $$ = cat_str(2,mm_strdup("create"),$2);
7023 : }
7024 : | ALTER SYSTEM_P
7025 : {
7026 0 : $$ = mm_strdup("alter system");
7027 : }
7028 : | ColId opt_column_list
7029 : {
7030 0 : $$ = cat_str(2,$1,$2);
7031 : }
7032 : ;
7033 :
7034 :
7035 : parameter_name_list:
7036 : parameter_name
7037 : {
7038 0 : $$ = $1;
7039 : }
7040 : | parameter_name_list ',' parameter_name
7041 : {
7042 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
7043 : }
7044 : ;
7045 :
7046 :
7047 : parameter_name:
7048 : ColId
7049 : {
7050 0 : $$ = $1;
7051 : }
7052 : | parameter_name '.' ColId
7053 : {
7054 0 : $$ = cat_str(3,$1,mm_strdup("."),$3);
7055 : }
7056 : ;
7057 :
7058 :
7059 : privilege_target:
7060 : qualified_name_list
7061 : {
7062 0 : $$ = $1;
7063 : }
7064 : | TABLE qualified_name_list
7065 : {
7066 0 : $$ = cat_str(2,mm_strdup("table"),$2);
7067 : }
7068 : | SEQUENCE qualified_name_list
7069 : {
7070 0 : $$ = cat_str(2,mm_strdup("sequence"),$2);
7071 : }
7072 : | FOREIGN DATA_P WRAPPER name_list
7073 : {
7074 0 : $$ = cat_str(2,mm_strdup("foreign data wrapper"),$4);
7075 : }
7076 : | FOREIGN SERVER name_list
7077 : {
7078 0 : $$ = cat_str(2,mm_strdup("foreign server"),$3);
7079 : }
7080 : | FUNCTION function_with_argtypes_list
7081 : {
7082 0 : $$ = cat_str(2,mm_strdup("function"),$2);
7083 : }
7084 : | PROCEDURE function_with_argtypes_list
7085 : {
7086 0 : $$ = cat_str(2,mm_strdup("procedure"),$2);
7087 : }
7088 : | ROUTINE function_with_argtypes_list
7089 : {
7090 0 : $$ = cat_str(2,mm_strdup("routine"),$2);
7091 : }
7092 : | DATABASE name_list
7093 : {
7094 0 : $$ = cat_str(2,mm_strdup("database"),$2);
7095 : }
7096 : | DOMAIN_P any_name_list
7097 : {
7098 0 : $$ = cat_str(2,mm_strdup("domain"),$2);
7099 : }
7100 : | LANGUAGE name_list
7101 : {
7102 0 : $$ = cat_str(2,mm_strdup("language"),$2);
7103 : }
7104 : | LARGE_P OBJECT_P NumericOnly_list
7105 : {
7106 0 : $$ = cat_str(2,mm_strdup("large object"),$3);
7107 : }
7108 : | PARAMETER parameter_name_list
7109 : {
7110 0 : $$ = cat_str(2,mm_strdup("parameter"),$2);
7111 : }
7112 : | SCHEMA name_list
7113 : {
7114 0 : $$ = cat_str(2,mm_strdup("schema"),$2);
7115 : }
7116 : | TABLESPACE name_list
7117 : {
7118 0 : $$ = cat_str(2,mm_strdup("tablespace"),$2);
7119 : }
7120 : | TYPE_P any_name_list
7121 : {
7122 0 : $$ = cat_str(2,mm_strdup("type"),$2);
7123 : }
7124 : | ALL TABLES IN_P SCHEMA name_list
7125 : {
7126 0 : $$ = cat_str(2,mm_strdup("all tables in schema"),$5);
7127 : }
7128 : | ALL SEQUENCES IN_P SCHEMA name_list
7129 : {
7130 0 : $$ = cat_str(2,mm_strdup("all sequences in schema"),$5);
7131 : }
7132 : | ALL FUNCTIONS IN_P SCHEMA name_list
7133 : {
7134 0 : $$ = cat_str(2,mm_strdup("all functions in schema"),$5);
7135 : }
7136 : | ALL PROCEDURES IN_P SCHEMA name_list
7137 : {
7138 0 : $$ = cat_str(2,mm_strdup("all procedures in schema"),$5);
7139 : }
7140 : | ALL ROUTINES IN_P SCHEMA name_list
7141 : {
7142 0 : $$ = cat_str(2,mm_strdup("all routines in schema"),$5);
7143 : }
7144 : ;
7145 :
7146 :
7147 : grantee_list:
7148 : grantee
7149 : {
7150 0 : $$ = $1;
7151 : }
7152 : | grantee_list ',' grantee
7153 : {
7154 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
7155 : }
7156 : ;
7157 :
7158 :
7159 : grantee:
7160 : RoleSpec
7161 : {
7162 0 : $$ = $1;
7163 : }
7164 : | GROUP_P RoleSpec
7165 : {
7166 0 : $$ = cat_str(2,mm_strdup("group"),$2);
7167 : }
7168 : ;
7169 :
7170 :
7171 : opt_grant_grant_option:
7172 : WITH GRANT OPTION
7173 : {
7174 0 : $$ = mm_strdup("with grant option");
7175 : }
7176 : |
7177 : {
7178 0 : $$=EMPTY; }
7179 : ;
7180 :
7181 :
7182 : GrantRoleStmt:
7183 : GRANT privilege_list TO role_list opt_granted_by
7184 : {
7185 0 : $$ = cat_str(5,mm_strdup("grant"),$2,mm_strdup("to"),$4,$5);
7186 : }
7187 : | GRANT privilege_list TO role_list WITH grant_role_opt_list opt_granted_by
7188 : {
7189 0 : $$ = cat_str(7,mm_strdup("grant"),$2,mm_strdup("to"),$4,mm_strdup("with"),$6,$7);
7190 : }
7191 : ;
7192 :
7193 :
7194 : RevokeRoleStmt:
7195 : REVOKE privilege_list FROM role_list opt_granted_by opt_drop_behavior
7196 : {
7197 0 : $$ = cat_str(6,mm_strdup("revoke"),$2,mm_strdup("from"),$4,$5,$6);
7198 : }
7199 : | REVOKE ColId OPTION FOR privilege_list FROM role_list opt_granted_by opt_drop_behavior
7200 : {
7201 0 : $$ = cat_str(8,mm_strdup("revoke"),$2,mm_strdup("option for"),$5,mm_strdup("from"),$7,$8,$9);
7202 : }
7203 : ;
7204 :
7205 :
7206 : grant_role_opt_list:
7207 : grant_role_opt_list ',' grant_role_opt
7208 : {
7209 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
7210 : }
7211 : | grant_role_opt
7212 : {
7213 0 : $$ = $1;
7214 : }
7215 : ;
7216 :
7217 :
7218 : grant_role_opt:
7219 : ColLabel grant_role_opt_value
7220 : {
7221 0 : $$ = cat_str(2,$1,$2);
7222 : }
7223 : ;
7224 :
7225 :
7226 : grant_role_opt_value:
7227 : OPTION
7228 : {
7229 0 : $$ = mm_strdup("option");
7230 : }
7231 : | TRUE_P
7232 : {
7233 0 : $$ = mm_strdup("true");
7234 : }
7235 : | FALSE_P
7236 : {
7237 0 : $$ = mm_strdup("false");
7238 : }
7239 : ;
7240 :
7241 :
7242 : opt_granted_by:
7243 : GRANTED BY RoleSpec
7244 : {
7245 0 : $$ = cat_str(2,mm_strdup("granted by"),$3);
7246 : }
7247 : |
7248 : {
7249 0 : $$=EMPTY; }
7250 : ;
7251 :
7252 :
7253 : AlterDefaultPrivilegesStmt:
7254 : ALTER DEFAULT PRIVILEGES DefACLOptionList DefACLAction
7255 : {
7256 0 : $$ = cat_str(3,mm_strdup("alter default privileges"),$4,$5);
7257 : }
7258 : ;
7259 :
7260 :
7261 : DefACLOptionList:
7262 : DefACLOptionList DefACLOption
7263 : {
7264 0 : $$ = cat_str(2,$1,$2);
7265 : }
7266 : |
7267 : {
7268 0 : $$=EMPTY; }
7269 : ;
7270 :
7271 :
7272 : DefACLOption:
7273 : IN_P SCHEMA name_list
7274 : {
7275 0 : $$ = cat_str(2,mm_strdup("in schema"),$3);
7276 : }
7277 : | FOR ROLE role_list
7278 : {
7279 0 : $$ = cat_str(2,mm_strdup("for role"),$3);
7280 : }
7281 : | FOR USER role_list
7282 : {
7283 0 : $$ = cat_str(2,mm_strdup("for user"),$3);
7284 : }
7285 : ;
7286 :
7287 :
7288 : DefACLAction:
7289 : GRANT privileges ON defacl_privilege_target TO grantee_list opt_grant_grant_option
7290 : {
7291 0 : $$ = cat_str(7,mm_strdup("grant"),$2,mm_strdup("on"),$4,mm_strdup("to"),$6,$7);
7292 : }
7293 : | REVOKE privileges ON defacl_privilege_target FROM grantee_list opt_drop_behavior
7294 : {
7295 0 : $$ = cat_str(7,mm_strdup("revoke"),$2,mm_strdup("on"),$4,mm_strdup("from"),$6,$7);
7296 : }
7297 : | REVOKE GRANT OPTION FOR privileges ON defacl_privilege_target FROM grantee_list opt_drop_behavior
7298 : {
7299 0 : $$ = cat_str(7,mm_strdup("revoke grant option for"),$5,mm_strdup("on"),$7,mm_strdup("from"),$9,$10);
7300 : }
7301 : ;
7302 :
7303 :
7304 : defacl_privilege_target:
7305 : TABLES
7306 : {
7307 0 : $$ = mm_strdup("tables");
7308 : }
7309 : | FUNCTIONS
7310 : {
7311 0 : $$ = mm_strdup("functions");
7312 : }
7313 : | ROUTINES
7314 : {
7315 0 : $$ = mm_strdup("routines");
7316 : }
7317 : | SEQUENCES
7318 : {
7319 0 : $$ = mm_strdup("sequences");
7320 : }
7321 : | TYPES_P
7322 : {
7323 0 : $$ = mm_strdup("types");
7324 : }
7325 : | SCHEMAS
7326 : {
7327 0 : $$ = mm_strdup("schemas");
7328 : }
7329 : ;
7330 :
7331 :
7332 : IndexStmt:
7333 : CREATE opt_unique INDEX opt_concurrently opt_single_name ON relation_expr access_method_clause '(' index_params ')' opt_include opt_unique_null_treatment opt_reloptions OptTableSpace where_clause
7334 : {
7335 0 : $$ = cat_str(16,mm_strdup("create"),$2,mm_strdup("index"),$4,$5,mm_strdup("on"),$7,$8,mm_strdup("("),$10,mm_strdup(")"),$12,$13,$14,$15,$16);
7336 : }
7337 : | CREATE opt_unique INDEX opt_concurrently IF_P NOT EXISTS name ON relation_expr access_method_clause '(' index_params ')' opt_include opt_unique_null_treatment opt_reloptions OptTableSpace where_clause
7338 : {
7339 0 : $$ = cat_str(17,mm_strdup("create"),$2,mm_strdup("index"),$4,mm_strdup("if not exists"),$8,mm_strdup("on"),$10,$11,mm_strdup("("),$13,mm_strdup(")"),$15,$16,$17,$18,$19);
7340 : }
7341 : ;
7342 :
7343 :
7344 : opt_unique:
7345 : UNIQUE
7346 : {
7347 0 : $$ = mm_strdup("unique");
7348 : }
7349 : |
7350 : {
7351 0 : $$=EMPTY; }
7352 : ;
7353 :
7354 :
7355 : access_method_clause:
7356 : USING name
7357 : {
7358 0 : $$ = cat_str(2,mm_strdup("using"),$2);
7359 : }
7360 : |
7361 : {
7362 0 : $$=EMPTY; }
7363 : ;
7364 :
7365 :
7366 : index_params:
7367 : index_elem
7368 : {
7369 0 : $$ = $1;
7370 : }
7371 : | index_params ',' index_elem
7372 : {
7373 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
7374 : }
7375 : ;
7376 :
7377 :
7378 : index_elem_options:
7379 : opt_collate opt_qualified_name opt_asc_desc opt_nulls_order
7380 : {
7381 0 : $$ = cat_str(4,$1,$2,$3,$4);
7382 : }
7383 : | opt_collate any_name reloptions opt_asc_desc opt_nulls_order
7384 : {
7385 0 : $$ = cat_str(5,$1,$2,$3,$4,$5);
7386 : }
7387 : ;
7388 :
7389 :
7390 : index_elem:
7391 : ColId index_elem_options
7392 : {
7393 0 : $$ = cat_str(2,$1,$2);
7394 : }
7395 : | func_expr_windowless index_elem_options
7396 : {
7397 0 : $$ = cat_str(2,$1,$2);
7398 : }
7399 : | '(' a_expr ')' index_elem_options
7400 : {
7401 0 : $$ = cat_str(4,mm_strdup("("),$2,mm_strdup(")"),$4);
7402 : }
7403 : ;
7404 :
7405 :
7406 : opt_include:
7407 : INCLUDE '(' index_including_params ')'
7408 : {
7409 0 : $$ = cat_str(3,mm_strdup("include ("),$3,mm_strdup(")"));
7410 : }
7411 : |
7412 : {
7413 0 : $$=EMPTY; }
7414 : ;
7415 :
7416 :
7417 : index_including_params:
7418 : index_elem
7419 : {
7420 0 : $$ = $1;
7421 : }
7422 : | index_including_params ',' index_elem
7423 : {
7424 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
7425 : }
7426 : ;
7427 :
7428 :
7429 : opt_collate:
7430 : COLLATE any_name
7431 : {
7432 0 : $$ = cat_str(2,mm_strdup("collate"),$2);
7433 : }
7434 : |
7435 : {
7436 0 : $$=EMPTY; }
7437 : ;
7438 :
7439 :
7440 : opt_asc_desc:
7441 : ASC
7442 : {
7443 2 : $$ = mm_strdup("asc");
7444 : }
7445 : | DESC
7446 : {
7447 0 : $$ = mm_strdup("desc");
7448 : }
7449 : |
7450 : {
7451 10 : $$=EMPTY; }
7452 : ;
7453 :
7454 :
7455 : opt_nulls_order:
7456 : NULLS_LA FIRST_P
7457 : {
7458 0 : $$ = mm_strdup("nulls first");
7459 : }
7460 : | NULLS_LA LAST_P
7461 : {
7462 4 : $$ = mm_strdup("nulls last");
7463 : }
7464 : |
7465 : {
7466 8 : $$=EMPTY; }
7467 : ;
7468 :
7469 :
7470 : CreateFunctionStmt:
7471 : CREATE opt_or_replace FUNCTION func_name func_args_with_defaults RETURNS func_return opt_createfunc_opt_list opt_routine_body
7472 : {
7473 2 : $$ = cat_str(9,mm_strdup("create"),$2,mm_strdup("function"),$4,$5,mm_strdup("returns"),$7,$8,$9);
7474 : }
7475 : | CREATE opt_or_replace FUNCTION func_name func_args_with_defaults RETURNS TABLE '(' table_func_column_list ')' opt_createfunc_opt_list opt_routine_body
7476 : {
7477 0 : $$ = cat_str(10,mm_strdup("create"),$2,mm_strdup("function"),$4,$5,mm_strdup("returns table ("),$9,mm_strdup(")"),$11,$12);
7478 : }
7479 : | CREATE opt_or_replace FUNCTION func_name func_args_with_defaults opt_createfunc_opt_list opt_routine_body
7480 : {
7481 0 : $$ = cat_str(7,mm_strdup("create"),$2,mm_strdup("function"),$4,$5,$6,$7);
7482 : }
7483 : | CREATE opt_or_replace PROCEDURE func_name func_args_with_defaults opt_createfunc_opt_list opt_routine_body
7484 : {
7485 0 : $$ = cat_str(7,mm_strdup("create"),$2,mm_strdup("procedure"),$4,$5,$6,$7);
7486 : }
7487 : ;
7488 :
7489 :
7490 : opt_or_replace:
7491 : OR REPLACE
7492 : {
7493 0 : $$ = mm_strdup("or replace");
7494 : }
7495 : |
7496 : {
7497 4 : $$=EMPTY; }
7498 : ;
7499 :
7500 :
7501 : func_args:
7502 : '(' func_args_list ')'
7503 : {
7504 0 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
7505 : }
7506 : | '(' ')'
7507 : {
7508 2 : $$ = mm_strdup("( )");
7509 : }
7510 : ;
7511 :
7512 :
7513 : func_args_list:
7514 : func_arg
7515 : {
7516 0 : $$ = $1;
7517 : }
7518 : | func_args_list ',' func_arg
7519 : {
7520 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
7521 : }
7522 : ;
7523 :
7524 :
7525 : function_with_argtypes_list:
7526 : function_with_argtypes
7527 : {
7528 2 : $$ = $1;
7529 : }
7530 : | function_with_argtypes_list ',' function_with_argtypes
7531 : {
7532 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
7533 : }
7534 : ;
7535 :
7536 :
7537 : function_with_argtypes:
7538 : func_name func_args
7539 : {
7540 2 : $$ = cat_str(2,$1,$2);
7541 : }
7542 : | type_func_name_keyword
7543 : {
7544 0 : $$ = $1;
7545 : }
7546 : | ColId
7547 : {
7548 0 : $$ = $1;
7549 : }
7550 : | ColId indirection
7551 : {
7552 0 : $$ = cat_str(2,$1,$2);
7553 : }
7554 : ;
7555 :
7556 :
7557 : func_args_with_defaults:
7558 : '(' func_args_with_defaults_list ')'
7559 : {
7560 0 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
7561 : }
7562 : | '(' ')'
7563 : {
7564 2 : $$ = mm_strdup("( )");
7565 : }
7566 : ;
7567 :
7568 :
7569 : func_args_with_defaults_list:
7570 : func_arg_with_default
7571 : {
7572 0 : $$ = $1;
7573 : }
7574 : | func_args_with_defaults_list ',' func_arg_with_default
7575 : {
7576 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
7577 : }
7578 : ;
7579 :
7580 :
7581 : func_arg:
7582 : arg_class param_name func_type
7583 : {
7584 0 : $$ = cat_str(3,$1,$2,$3);
7585 : }
7586 : | param_name arg_class func_type
7587 : {
7588 0 : $$ = cat_str(3,$1,$2,$3);
7589 : }
7590 : | param_name func_type
7591 : {
7592 0 : $$ = cat_str(2,$1,$2);
7593 : }
7594 : | arg_class func_type
7595 : {
7596 0 : $$ = cat_str(2,$1,$2);
7597 : }
7598 : | func_type
7599 : {
7600 0 : $$ = $1;
7601 : }
7602 : ;
7603 :
7604 :
7605 : arg_class:
7606 : IN_P
7607 : {
7608 0 : $$ = mm_strdup("in");
7609 : }
7610 : | OUT_P
7611 : {
7612 0 : $$ = mm_strdup("out");
7613 : }
7614 : | INOUT
7615 : {
7616 0 : $$ = mm_strdup("inout");
7617 : }
7618 : | IN_P OUT_P
7619 : {
7620 0 : $$ = mm_strdup("in out");
7621 : }
7622 : | VARIADIC
7623 : {
7624 0 : $$ = mm_strdup("variadic");
7625 : }
7626 : ;
7627 :
7628 :
7629 : param_name:
7630 : type_function_name
7631 : {
7632 0 : $$ = $1;
7633 : }
7634 : ;
7635 :
7636 :
7637 : func_return:
7638 : func_type
7639 : {
7640 2 : $$ = $1;
7641 : }
7642 : ;
7643 :
7644 :
7645 : func_type:
7646 : Typename
7647 : {
7648 2 : $$ = $1;
7649 : }
7650 : | type_function_name attrs '%' TYPE_P
7651 : {
7652 0 : $$ = cat_str(3,$1,$2,mm_strdup("% type"));
7653 : }
7654 : | SETOF type_function_name attrs '%' TYPE_P
7655 : {
7656 0 : $$ = cat_str(4,mm_strdup("setof"),$2,$3,mm_strdup("% type"));
7657 : }
7658 : ;
7659 :
7660 :
7661 : func_arg_with_default:
7662 : func_arg
7663 : {
7664 0 : $$ = $1;
7665 : }
7666 : | func_arg DEFAULT a_expr
7667 : {
7668 0 : $$ = cat_str(3,$1,mm_strdup("default"),$3);
7669 : }
7670 : | func_arg '=' a_expr
7671 : {
7672 0 : $$ = cat_str(3,$1,mm_strdup("="),$3);
7673 : }
7674 : ;
7675 :
7676 :
7677 : aggr_arg:
7678 : func_arg
7679 : {
7680 0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
7681 0 : $$ = $1;
7682 : }
7683 : ;
7684 :
7685 :
7686 : aggr_args:
7687 : '(' '*' ')'
7688 : {
7689 0 : $$ = mm_strdup("( * )");
7690 : }
7691 : | '(' aggr_args_list ')'
7692 : {
7693 0 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
7694 : }
7695 : | '(' ORDER BY aggr_args_list ')'
7696 : {
7697 0 : $$ = cat_str(3,mm_strdup("( order by"),$4,mm_strdup(")"));
7698 : }
7699 : | '(' aggr_args_list ORDER BY aggr_args_list ')'
7700 : {
7701 0 : $$ = cat_str(5,mm_strdup("("),$2,mm_strdup("order by"),$5,mm_strdup(")"));
7702 : }
7703 : ;
7704 :
7705 :
7706 : aggr_args_list:
7707 : aggr_arg
7708 : {
7709 0 : $$ = $1;
7710 : }
7711 : | aggr_args_list ',' aggr_arg
7712 : {
7713 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
7714 : }
7715 : ;
7716 :
7717 :
7718 : aggregate_with_argtypes:
7719 : func_name aggr_args
7720 : {
7721 0 : $$ = cat_str(2,$1,$2);
7722 : }
7723 : ;
7724 :
7725 :
7726 : aggregate_with_argtypes_list:
7727 : aggregate_with_argtypes
7728 : {
7729 0 : $$ = $1;
7730 : }
7731 : | aggregate_with_argtypes_list ',' aggregate_with_argtypes
7732 : {
7733 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
7734 : }
7735 : ;
7736 :
7737 :
7738 : opt_createfunc_opt_list:
7739 : createfunc_opt_list
7740 : {
7741 2 : $$ = $1;
7742 : }
7743 : |
7744 : {
7745 0 : $$=EMPTY; }
7746 : ;
7747 :
7748 :
7749 : createfunc_opt_list:
7750 : createfunc_opt_item
7751 : {
7752 2 : $$ = $1;
7753 : }
7754 : | createfunc_opt_list createfunc_opt_item
7755 : {
7756 2 : $$ = cat_str(2,$1,$2);
7757 : }
7758 : ;
7759 :
7760 :
7761 : common_func_opt_item:
7762 : CALLED ON NULL_P INPUT_P
7763 : {
7764 0 : $$ = mm_strdup("called on null input");
7765 : }
7766 : | RETURNS NULL_P ON NULL_P INPUT_P
7767 : {
7768 0 : $$ = mm_strdup("returns null on null input");
7769 : }
7770 : | STRICT_P
7771 : {
7772 0 : $$ = mm_strdup("strict");
7773 : }
7774 : | IMMUTABLE
7775 : {
7776 0 : $$ = mm_strdup("immutable");
7777 : }
7778 : | STABLE
7779 : {
7780 0 : $$ = mm_strdup("stable");
7781 : }
7782 : | VOLATILE
7783 : {
7784 0 : $$ = mm_strdup("volatile");
7785 : }
7786 : | EXTERNAL SECURITY DEFINER
7787 : {
7788 0 : $$ = mm_strdup("external security definer");
7789 : }
7790 : | EXTERNAL SECURITY INVOKER
7791 : {
7792 0 : $$ = mm_strdup("external security invoker");
7793 : }
7794 : | SECURITY DEFINER
7795 : {
7796 0 : $$ = mm_strdup("security definer");
7797 : }
7798 : | SECURITY INVOKER
7799 : {
7800 0 : $$ = mm_strdup("security invoker");
7801 : }
7802 : | LEAKPROOF
7803 : {
7804 0 : $$ = mm_strdup("leakproof");
7805 : }
7806 : | NOT LEAKPROOF
7807 : {
7808 0 : $$ = mm_strdup("not leakproof");
7809 : }
7810 : | COST NumericOnly
7811 : {
7812 0 : $$ = cat_str(2,mm_strdup("cost"),$2);
7813 : }
7814 : | ROWS NumericOnly
7815 : {
7816 0 : $$ = cat_str(2,mm_strdup("rows"),$2);
7817 : }
7818 : | SUPPORT any_name
7819 : {
7820 0 : $$ = cat_str(2,mm_strdup("support"),$2);
7821 : }
7822 : | FunctionSetResetClause
7823 : {
7824 0 : $$ = $1;
7825 : }
7826 : | PARALLEL ColId
7827 : {
7828 0 : $$ = cat_str(2,mm_strdup("parallel"),$2);
7829 : }
7830 : ;
7831 :
7832 :
7833 : createfunc_opt_item:
7834 : AS func_as
7835 : {
7836 2 : $$ = cat_str(2,mm_strdup("as"),$2);
7837 : }
7838 : | LANGUAGE NonReservedWord_or_Sconst
7839 : {
7840 2 : $$ = cat_str(2,mm_strdup("language"),$2);
7841 : }
7842 : | TRANSFORM transform_type_list
7843 : {
7844 0 : $$ = cat_str(2,mm_strdup("transform"),$2);
7845 : }
7846 : | WINDOW
7847 : {
7848 0 : $$ = mm_strdup("window");
7849 : }
7850 : | common_func_opt_item
7851 : {
7852 0 : $$ = $1;
7853 : }
7854 : ;
7855 :
7856 :
7857 : func_as:
7858 : ecpg_sconst
7859 : {
7860 2 : $$ = $1;
7861 : }
7862 : | ecpg_sconst ',' ecpg_sconst
7863 : {
7864 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
7865 : }
7866 : ;
7867 :
7868 :
7869 : ReturnStmt:
7870 : RETURN a_expr
7871 : {
7872 0 : $$ = cat_str(2,mm_strdup("return"),$2);
7873 : }
7874 : ;
7875 :
7876 :
7877 : opt_routine_body:
7878 : ReturnStmt
7879 : {
7880 0 : $$ = $1;
7881 : }
7882 : | BEGIN_P ATOMIC routine_body_stmt_list END_P
7883 : {
7884 0 : $$ = cat_str(3,mm_strdup("begin atomic"),$3,mm_strdup("end"));
7885 : }
7886 : |
7887 : {
7888 2 : $$=EMPTY; }
7889 : ;
7890 :
7891 :
7892 : routine_body_stmt_list:
7893 : routine_body_stmt_list routine_body_stmt ';'
7894 : {
7895 0 : $$ = cat_str(3,$1,$2,mm_strdup(";"));
7896 : }
7897 : |
7898 : {
7899 0 : $$=EMPTY; }
7900 : ;
7901 :
7902 :
7903 : routine_body_stmt:
7904 : stmt
7905 : {
7906 0 : $$ = $1;
7907 : }
7908 : | ReturnStmt
7909 : {
7910 0 : $$ = $1;
7911 : }
7912 : ;
7913 :
7914 :
7915 : transform_type_list:
7916 : FOR TYPE_P Typename
7917 : {
7918 0 : $$ = cat_str(2,mm_strdup("for type"),$3);
7919 : }
7920 : | transform_type_list ',' FOR TYPE_P Typename
7921 : {
7922 0 : $$ = cat_str(3,$1,mm_strdup(", for type"),$5);
7923 : }
7924 : ;
7925 :
7926 :
7927 : opt_definition:
7928 : WITH definition
7929 : {
7930 0 : $$ = cat_str(2,mm_strdup("with"),$2);
7931 : }
7932 : |
7933 : {
7934 20 : $$=EMPTY; }
7935 : ;
7936 :
7937 :
7938 : table_func_column:
7939 : param_name func_type
7940 : {
7941 0 : $$ = cat_str(2,$1,$2);
7942 : }
7943 : ;
7944 :
7945 :
7946 : table_func_column_list:
7947 : table_func_column
7948 : {
7949 0 : $$ = $1;
7950 : }
7951 : | table_func_column_list ',' table_func_column
7952 : {
7953 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
7954 : }
7955 : ;
7956 :
7957 :
7958 : AlterFunctionStmt:
7959 : ALTER FUNCTION function_with_argtypes alterfunc_opt_list opt_restrict
7960 : {
7961 0 : $$ = cat_str(4,mm_strdup("alter function"),$3,$4,$5);
7962 : }
7963 : | ALTER PROCEDURE function_with_argtypes alterfunc_opt_list opt_restrict
7964 : {
7965 0 : $$ = cat_str(4,mm_strdup("alter procedure"),$3,$4,$5);
7966 : }
7967 : | ALTER ROUTINE function_with_argtypes alterfunc_opt_list opt_restrict
7968 : {
7969 0 : $$ = cat_str(4,mm_strdup("alter routine"),$3,$4,$5);
7970 : }
7971 : ;
7972 :
7973 :
7974 : alterfunc_opt_list:
7975 : common_func_opt_item
7976 : {
7977 0 : $$ = $1;
7978 : }
7979 : | alterfunc_opt_list common_func_opt_item
7980 : {
7981 0 : $$ = cat_str(2,$1,$2);
7982 : }
7983 : ;
7984 :
7985 :
7986 : opt_restrict:
7987 : RESTRICT
7988 : {
7989 0 : $$ = mm_strdup("restrict");
7990 : }
7991 : |
7992 : {
7993 0 : $$=EMPTY; }
7994 : ;
7995 :
7996 :
7997 : RemoveFuncStmt:
7998 : DROP FUNCTION function_with_argtypes_list opt_drop_behavior
7999 : {
8000 2 : $$ = cat_str(3,mm_strdup("drop function"),$3,$4);
8001 : }
8002 : | DROP FUNCTION IF_P EXISTS function_with_argtypes_list opt_drop_behavior
8003 : {
8004 0 : $$ = cat_str(3,mm_strdup("drop function if exists"),$5,$6);
8005 : }
8006 : | DROP PROCEDURE function_with_argtypes_list opt_drop_behavior
8007 : {
8008 0 : $$ = cat_str(3,mm_strdup("drop procedure"),$3,$4);
8009 : }
8010 : | DROP PROCEDURE IF_P EXISTS function_with_argtypes_list opt_drop_behavior
8011 : {
8012 0 : $$ = cat_str(3,mm_strdup("drop procedure if exists"),$5,$6);
8013 : }
8014 : | DROP ROUTINE function_with_argtypes_list opt_drop_behavior
8015 : {
8016 0 : $$ = cat_str(3,mm_strdup("drop routine"),$3,$4);
8017 : }
8018 : | DROP ROUTINE IF_P EXISTS function_with_argtypes_list opt_drop_behavior
8019 : {
8020 0 : $$ = cat_str(3,mm_strdup("drop routine if exists"),$5,$6);
8021 : }
8022 : ;
8023 :
8024 :
8025 : RemoveAggrStmt:
8026 : DROP AGGREGATE aggregate_with_argtypes_list opt_drop_behavior
8027 : {
8028 0 : $$ = cat_str(3,mm_strdup("drop aggregate"),$3,$4);
8029 : }
8030 : | DROP AGGREGATE IF_P EXISTS aggregate_with_argtypes_list opt_drop_behavior
8031 : {
8032 0 : $$ = cat_str(3,mm_strdup("drop aggregate if exists"),$5,$6);
8033 : }
8034 : ;
8035 :
8036 :
8037 : RemoveOperStmt:
8038 : DROP OPERATOR operator_with_argtypes_list opt_drop_behavior
8039 : {
8040 0 : $$ = cat_str(3,mm_strdup("drop operator"),$3,$4);
8041 : }
8042 : | DROP OPERATOR IF_P EXISTS operator_with_argtypes_list opt_drop_behavior
8043 : {
8044 0 : $$ = cat_str(3,mm_strdup("drop operator if exists"),$5,$6);
8045 : }
8046 : ;
8047 :
8048 :
8049 : oper_argtypes:
8050 : '(' Typename ')'
8051 : {
8052 0 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
8053 : }
8054 : | '(' Typename ',' Typename ')'
8055 : {
8056 0 : $$ = cat_str(5,mm_strdup("("),$2,mm_strdup(","),$4,mm_strdup(")"));
8057 : }
8058 : | '(' NONE ',' Typename ')'
8059 : {
8060 0 : $$ = cat_str(3,mm_strdup("( none ,"),$4,mm_strdup(")"));
8061 : }
8062 : | '(' Typename ',' NONE ')'
8063 : {
8064 0 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(", none )"));
8065 : }
8066 : ;
8067 :
8068 :
8069 : any_operator:
8070 : all_Op
8071 : {
8072 0 : $$ = $1;
8073 : }
8074 : | ColId '.' any_operator
8075 : {
8076 0 : $$ = cat_str(3,$1,mm_strdup("."),$3);
8077 : }
8078 : ;
8079 :
8080 :
8081 : operator_with_argtypes_list:
8082 : operator_with_argtypes
8083 : {
8084 0 : $$ = $1;
8085 : }
8086 : | operator_with_argtypes_list ',' operator_with_argtypes
8087 : {
8088 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
8089 : }
8090 : ;
8091 :
8092 :
8093 : operator_with_argtypes:
8094 : any_operator oper_argtypes
8095 : {
8096 0 : $$ = cat_str(2,$1,$2);
8097 : }
8098 : ;
8099 :
8100 :
8101 : DoStmt:
8102 : DO dostmt_opt_list
8103 : {
8104 0 : $$ = cat_str(2,mm_strdup("do"),$2);
8105 : }
8106 : ;
8107 :
8108 :
8109 : dostmt_opt_list:
8110 : dostmt_opt_item
8111 : {
8112 0 : $$ = $1;
8113 : }
8114 : | dostmt_opt_list dostmt_opt_item
8115 : {
8116 0 : $$ = cat_str(2,$1,$2);
8117 : }
8118 : ;
8119 :
8120 :
8121 : dostmt_opt_item:
8122 : ecpg_sconst
8123 : {
8124 0 : $$ = $1;
8125 : }
8126 : | LANGUAGE NonReservedWord_or_Sconst
8127 : {
8128 0 : $$ = cat_str(2,mm_strdup("language"),$2);
8129 : }
8130 : ;
8131 :
8132 :
8133 : CreateCastStmt:
8134 : CREATE CAST '(' Typename AS Typename ')' WITH FUNCTION function_with_argtypes cast_context
8135 : {
8136 0 : $$ = cat_str(7,mm_strdup("create cast ("),$4,mm_strdup("as"),$6,mm_strdup(") with function"),$10,$11);
8137 : }
8138 : | CREATE CAST '(' Typename AS Typename ')' WITHOUT FUNCTION cast_context
8139 : {
8140 0 : $$ = cat_str(6,mm_strdup("create cast ("),$4,mm_strdup("as"),$6,mm_strdup(") without function"),$10);
8141 : }
8142 : | CREATE CAST '(' Typename AS Typename ')' WITH INOUT cast_context
8143 : {
8144 0 : $$ = cat_str(6,mm_strdup("create cast ("),$4,mm_strdup("as"),$6,mm_strdup(") with inout"),$10);
8145 : }
8146 : ;
8147 :
8148 :
8149 : cast_context:
8150 : AS IMPLICIT_P
8151 : {
8152 0 : $$ = mm_strdup("as implicit");
8153 : }
8154 : | AS ASSIGNMENT
8155 : {
8156 0 : $$ = mm_strdup("as assignment");
8157 : }
8158 : |
8159 : {
8160 0 : $$=EMPTY; }
8161 : ;
8162 :
8163 :
8164 : DropCastStmt:
8165 : DROP CAST opt_if_exists '(' Typename AS Typename ')' opt_drop_behavior
8166 : {
8167 0 : $$ = cat_str(8,mm_strdup("drop cast"),$3,mm_strdup("("),$5,mm_strdup("as"),$7,mm_strdup(")"),$9);
8168 : }
8169 : ;
8170 :
8171 :
8172 : opt_if_exists:
8173 : IF_P EXISTS
8174 : {
8175 0 : $$ = mm_strdup("if exists");
8176 : }
8177 : |
8178 : {
8179 0 : $$=EMPTY; }
8180 : ;
8181 :
8182 :
8183 : CreateTransformStmt:
8184 : CREATE opt_or_replace TRANSFORM FOR Typename LANGUAGE name '(' transform_element_list ')'
8185 : {
8186 0 : $$ = cat_str(9,mm_strdup("create"),$2,mm_strdup("transform for"),$5,mm_strdup("language"),$7,mm_strdup("("),$9,mm_strdup(")"));
8187 : }
8188 : ;
8189 :
8190 :
8191 : transform_element_list:
8192 : FROM SQL_P WITH FUNCTION function_with_argtypes ',' TO SQL_P WITH FUNCTION function_with_argtypes
8193 : {
8194 0 : $$ = cat_str(4,mm_strdup("from sql with function"),$5,mm_strdup(", to sql with function"),$11);
8195 : }
8196 : | TO SQL_P WITH FUNCTION function_with_argtypes ',' FROM SQL_P WITH FUNCTION function_with_argtypes
8197 : {
8198 0 : $$ = cat_str(4,mm_strdup("to sql with function"),$5,mm_strdup(", from sql with function"),$11);
8199 : }
8200 : | FROM SQL_P WITH FUNCTION function_with_argtypes
8201 : {
8202 0 : $$ = cat_str(2,mm_strdup("from sql with function"),$5);
8203 : }
8204 : | TO SQL_P WITH FUNCTION function_with_argtypes
8205 : {
8206 0 : $$ = cat_str(2,mm_strdup("to sql with function"),$5);
8207 : }
8208 : ;
8209 :
8210 :
8211 : DropTransformStmt:
8212 : DROP TRANSFORM opt_if_exists FOR Typename LANGUAGE name opt_drop_behavior
8213 : {
8214 0 : $$ = cat_str(7,mm_strdup("drop transform"),$3,mm_strdup("for"),$5,mm_strdup("language"),$7,$8);
8215 : }
8216 : ;
8217 :
8218 :
8219 : ReindexStmt:
8220 : REINDEX opt_reindex_option_list reindex_target_relation opt_concurrently qualified_name
8221 : {
8222 0 : $$ = cat_str(5,mm_strdup("reindex"),$2,$3,$4,$5);
8223 : }
8224 : | REINDEX opt_reindex_option_list SCHEMA opt_concurrently name
8225 : {
8226 0 : $$ = cat_str(5,mm_strdup("reindex"),$2,mm_strdup("schema"),$4,$5);
8227 : }
8228 : | REINDEX opt_reindex_option_list reindex_target_all opt_concurrently opt_single_name
8229 : {
8230 0 : $$ = cat_str(5,mm_strdup("reindex"),$2,$3,$4,$5);
8231 : }
8232 : ;
8233 :
8234 :
8235 : reindex_target_relation:
8236 : INDEX
8237 : {
8238 0 : $$ = mm_strdup("index");
8239 : }
8240 : | TABLE
8241 : {
8242 0 : $$ = mm_strdup("table");
8243 : }
8244 : ;
8245 :
8246 :
8247 : reindex_target_all:
8248 : SYSTEM_P
8249 : {
8250 0 : $$ = mm_strdup("system");
8251 : }
8252 : | DATABASE
8253 : {
8254 0 : $$ = mm_strdup("database");
8255 : }
8256 : ;
8257 :
8258 :
8259 : opt_reindex_option_list:
8260 : '(' utility_option_list ')'
8261 : {
8262 0 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
8263 : }
8264 : |
8265 : {
8266 0 : $$=EMPTY; }
8267 : ;
8268 :
8269 :
8270 : AlterTblSpcStmt:
8271 : ALTER TABLESPACE name SET reloptions
8272 : {
8273 0 : $$ = cat_str(4,mm_strdup("alter tablespace"),$3,mm_strdup("set"),$5);
8274 : }
8275 : | ALTER TABLESPACE name RESET reloptions
8276 : {
8277 0 : $$ = cat_str(4,mm_strdup("alter tablespace"),$3,mm_strdup("reset"),$5);
8278 : }
8279 : ;
8280 :
8281 :
8282 : RenameStmt:
8283 : ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
8284 : {
8285 0 : $$ = cat_str(4,mm_strdup("alter aggregate"),$3,mm_strdup("rename to"),$6);
8286 : }
8287 : | ALTER COLLATION any_name RENAME TO name
8288 : {
8289 0 : $$ = cat_str(4,mm_strdup("alter collation"),$3,mm_strdup("rename to"),$6);
8290 : }
8291 : | ALTER CONVERSION_P any_name RENAME TO name
8292 : {
8293 0 : $$ = cat_str(4,mm_strdup("alter conversion"),$3,mm_strdup("rename to"),$6);
8294 : }
8295 : | ALTER DATABASE name RENAME TO name
8296 : {
8297 0 : $$ = cat_str(4,mm_strdup("alter database"),$3,mm_strdup("rename to"),$6);
8298 : }
8299 : | ALTER DOMAIN_P any_name RENAME TO name
8300 : {
8301 0 : $$ = cat_str(4,mm_strdup("alter domain"),$3,mm_strdup("rename to"),$6);
8302 : }
8303 : | ALTER DOMAIN_P any_name RENAME CONSTRAINT name TO name
8304 : {
8305 0 : $$ = cat_str(6,mm_strdup("alter domain"),$3,mm_strdup("rename constraint"),$6,mm_strdup("to"),$8);
8306 : }
8307 : | ALTER FOREIGN DATA_P WRAPPER name RENAME TO name
8308 : {
8309 0 : $$ = cat_str(4,mm_strdup("alter foreign data wrapper"),$5,mm_strdup("rename to"),$8);
8310 : }
8311 : | ALTER FUNCTION function_with_argtypes RENAME TO name
8312 : {
8313 0 : $$ = cat_str(4,mm_strdup("alter function"),$3,mm_strdup("rename to"),$6);
8314 : }
8315 : | ALTER GROUP_P RoleId RENAME TO RoleId
8316 : {
8317 0 : $$ = cat_str(4,mm_strdup("alter group"),$3,mm_strdup("rename to"),$6);
8318 : }
8319 : | ALTER opt_procedural LANGUAGE name RENAME TO name
8320 : {
8321 0 : $$ = cat_str(6,mm_strdup("alter"),$2,mm_strdup("language"),$4,mm_strdup("rename to"),$7);
8322 : }
8323 : | ALTER OPERATOR CLASS any_name USING name RENAME TO name
8324 : {
8325 0 : $$ = cat_str(6,mm_strdup("alter operator class"),$4,mm_strdup("using"),$6,mm_strdup("rename to"),$9);
8326 : }
8327 : | ALTER OPERATOR FAMILY any_name USING name RENAME TO name
8328 : {
8329 0 : $$ = cat_str(6,mm_strdup("alter operator family"),$4,mm_strdup("using"),$6,mm_strdup("rename to"),$9);
8330 : }
8331 : | ALTER POLICY name ON qualified_name RENAME TO name
8332 : {
8333 0 : $$ = cat_str(6,mm_strdup("alter policy"),$3,mm_strdup("on"),$5,mm_strdup("rename to"),$8);
8334 : }
8335 : | ALTER POLICY IF_P EXISTS name ON qualified_name RENAME TO name
8336 : {
8337 0 : $$ = cat_str(6,mm_strdup("alter policy if exists"),$5,mm_strdup("on"),$7,mm_strdup("rename to"),$10);
8338 : }
8339 : | ALTER PROCEDURE function_with_argtypes RENAME TO name
8340 : {
8341 0 : $$ = cat_str(4,mm_strdup("alter procedure"),$3,mm_strdup("rename to"),$6);
8342 : }
8343 : | ALTER PUBLICATION name RENAME TO name
8344 : {
8345 0 : $$ = cat_str(4,mm_strdup("alter publication"),$3,mm_strdup("rename to"),$6);
8346 : }
8347 : | ALTER ROUTINE function_with_argtypes RENAME TO name
8348 : {
8349 0 : $$ = cat_str(4,mm_strdup("alter routine"),$3,mm_strdup("rename to"),$6);
8350 : }
8351 : | ALTER SCHEMA name RENAME TO name
8352 : {
8353 0 : $$ = cat_str(4,mm_strdup("alter schema"),$3,mm_strdup("rename to"),$6);
8354 : }
8355 : | ALTER SERVER name RENAME TO name
8356 : {
8357 0 : $$ = cat_str(4,mm_strdup("alter server"),$3,mm_strdup("rename to"),$6);
8358 : }
8359 : | ALTER SUBSCRIPTION name RENAME TO name
8360 : {
8361 0 : $$ = cat_str(4,mm_strdup("alter subscription"),$3,mm_strdup("rename to"),$6);
8362 : }
8363 : | ALTER TABLE relation_expr RENAME TO name
8364 : {
8365 0 : $$ = cat_str(4,mm_strdup("alter table"),$3,mm_strdup("rename to"),$6);
8366 : }
8367 : | ALTER TABLE IF_P EXISTS relation_expr RENAME TO name
8368 : {
8369 0 : $$ = cat_str(4,mm_strdup("alter table if exists"),$5,mm_strdup("rename to"),$8);
8370 : }
8371 : | ALTER SEQUENCE qualified_name RENAME TO name
8372 : {
8373 0 : $$ = cat_str(4,mm_strdup("alter sequence"),$3,mm_strdup("rename to"),$6);
8374 : }
8375 : | ALTER SEQUENCE IF_P EXISTS qualified_name RENAME TO name
8376 : {
8377 0 : $$ = cat_str(4,mm_strdup("alter sequence if exists"),$5,mm_strdup("rename to"),$8);
8378 : }
8379 : | ALTER VIEW qualified_name RENAME TO name
8380 : {
8381 0 : $$ = cat_str(4,mm_strdup("alter view"),$3,mm_strdup("rename to"),$6);
8382 : }
8383 : | ALTER VIEW IF_P EXISTS qualified_name RENAME TO name
8384 : {
8385 0 : $$ = cat_str(4,mm_strdup("alter view if exists"),$5,mm_strdup("rename to"),$8);
8386 : }
8387 : | ALTER MATERIALIZED VIEW qualified_name RENAME TO name
8388 : {
8389 0 : $$ = cat_str(4,mm_strdup("alter materialized view"),$4,mm_strdup("rename to"),$7);
8390 : }
8391 : | ALTER MATERIALIZED VIEW IF_P EXISTS qualified_name RENAME TO name
8392 : {
8393 0 : $$ = cat_str(4,mm_strdup("alter materialized view if exists"),$6,mm_strdup("rename to"),$9);
8394 : }
8395 : | ALTER INDEX qualified_name RENAME TO name
8396 : {
8397 0 : $$ = cat_str(4,mm_strdup("alter index"),$3,mm_strdup("rename to"),$6);
8398 : }
8399 : | ALTER INDEX IF_P EXISTS qualified_name RENAME TO name
8400 : {
8401 0 : $$ = cat_str(4,mm_strdup("alter index if exists"),$5,mm_strdup("rename to"),$8);
8402 : }
8403 : | ALTER FOREIGN TABLE relation_expr RENAME TO name
8404 : {
8405 0 : $$ = cat_str(4,mm_strdup("alter foreign table"),$4,mm_strdup("rename to"),$7);
8406 : }
8407 : | ALTER FOREIGN TABLE IF_P EXISTS relation_expr RENAME TO name
8408 : {
8409 0 : $$ = cat_str(4,mm_strdup("alter foreign table if exists"),$6,mm_strdup("rename to"),$9);
8410 : }
8411 : | ALTER TABLE relation_expr RENAME opt_column name TO name
8412 : {
8413 0 : $$ = cat_str(7,mm_strdup("alter table"),$3,mm_strdup("rename"),$5,$6,mm_strdup("to"),$8);
8414 : }
8415 : | ALTER TABLE IF_P EXISTS relation_expr RENAME opt_column name TO name
8416 : {
8417 0 : $$ = cat_str(7,mm_strdup("alter table if exists"),$5,mm_strdup("rename"),$7,$8,mm_strdup("to"),$10);
8418 : }
8419 : | ALTER VIEW qualified_name RENAME opt_column name TO name
8420 : {
8421 0 : $$ = cat_str(7,mm_strdup("alter view"),$3,mm_strdup("rename"),$5,$6,mm_strdup("to"),$8);
8422 : }
8423 : | ALTER VIEW IF_P EXISTS qualified_name RENAME opt_column name TO name
8424 : {
8425 0 : $$ = cat_str(7,mm_strdup("alter view if exists"),$5,mm_strdup("rename"),$7,$8,mm_strdup("to"),$10);
8426 : }
8427 : | ALTER MATERIALIZED VIEW qualified_name RENAME opt_column name TO name
8428 : {
8429 0 : $$ = cat_str(7,mm_strdup("alter materialized view"),$4,mm_strdup("rename"),$6,$7,mm_strdup("to"),$9);
8430 : }
8431 : | ALTER MATERIALIZED VIEW IF_P EXISTS qualified_name RENAME opt_column name TO name
8432 : {
8433 0 : $$ = cat_str(7,mm_strdup("alter materialized view if exists"),$6,mm_strdup("rename"),$8,$9,mm_strdup("to"),$11);
8434 : }
8435 : | ALTER TABLE relation_expr RENAME CONSTRAINT name TO name
8436 : {
8437 0 : $$ = cat_str(6,mm_strdup("alter table"),$3,mm_strdup("rename constraint"),$6,mm_strdup("to"),$8);
8438 : }
8439 : | ALTER TABLE IF_P EXISTS relation_expr RENAME CONSTRAINT name TO name
8440 : {
8441 0 : $$ = cat_str(6,mm_strdup("alter table if exists"),$5,mm_strdup("rename constraint"),$8,mm_strdup("to"),$10);
8442 : }
8443 : | ALTER FOREIGN TABLE relation_expr RENAME opt_column name TO name
8444 : {
8445 0 : $$ = cat_str(7,mm_strdup("alter foreign table"),$4,mm_strdup("rename"),$6,$7,mm_strdup("to"),$9);
8446 : }
8447 : | ALTER FOREIGN TABLE IF_P EXISTS relation_expr RENAME opt_column name TO name
8448 : {
8449 0 : $$ = cat_str(7,mm_strdup("alter foreign table if exists"),$6,mm_strdup("rename"),$8,$9,mm_strdup("to"),$11);
8450 : }
8451 : | ALTER RULE name ON qualified_name RENAME TO name
8452 : {
8453 0 : $$ = cat_str(6,mm_strdup("alter rule"),$3,mm_strdup("on"),$5,mm_strdup("rename to"),$8);
8454 : }
8455 : | ALTER TRIGGER name ON qualified_name RENAME TO name
8456 : {
8457 0 : $$ = cat_str(6,mm_strdup("alter trigger"),$3,mm_strdup("on"),$5,mm_strdup("rename to"),$8);
8458 : }
8459 : | ALTER EVENT TRIGGER name RENAME TO name
8460 : {
8461 0 : $$ = cat_str(4,mm_strdup("alter event trigger"),$4,mm_strdup("rename to"),$7);
8462 : }
8463 : | ALTER ROLE RoleId RENAME TO RoleId
8464 : {
8465 0 : $$ = cat_str(4,mm_strdup("alter role"),$3,mm_strdup("rename to"),$6);
8466 : }
8467 : | ALTER USER RoleId RENAME TO RoleId
8468 : {
8469 0 : $$ = cat_str(4,mm_strdup("alter user"),$3,mm_strdup("rename to"),$6);
8470 : }
8471 : | ALTER TABLESPACE name RENAME TO name
8472 : {
8473 0 : $$ = cat_str(4,mm_strdup("alter tablespace"),$3,mm_strdup("rename to"),$6);
8474 : }
8475 : | ALTER STATISTICS any_name RENAME TO name
8476 : {
8477 0 : $$ = cat_str(4,mm_strdup("alter statistics"),$3,mm_strdup("rename to"),$6);
8478 : }
8479 : | ALTER TEXT_P SEARCH PARSER any_name RENAME TO name
8480 : {
8481 0 : $$ = cat_str(4,mm_strdup("alter text search parser"),$5,mm_strdup("rename to"),$8);
8482 : }
8483 : | ALTER TEXT_P SEARCH DICTIONARY any_name RENAME TO name
8484 : {
8485 0 : $$ = cat_str(4,mm_strdup("alter text search dictionary"),$5,mm_strdup("rename to"),$8);
8486 : }
8487 : | ALTER TEXT_P SEARCH TEMPLATE any_name RENAME TO name
8488 : {
8489 0 : $$ = cat_str(4,mm_strdup("alter text search template"),$5,mm_strdup("rename to"),$8);
8490 : }
8491 : | ALTER TEXT_P SEARCH CONFIGURATION any_name RENAME TO name
8492 : {
8493 0 : $$ = cat_str(4,mm_strdup("alter text search configuration"),$5,mm_strdup("rename to"),$8);
8494 : }
8495 : | ALTER TYPE_P any_name RENAME TO name
8496 : {
8497 0 : $$ = cat_str(4,mm_strdup("alter type"),$3,mm_strdup("rename to"),$6);
8498 : }
8499 : | ALTER TYPE_P any_name RENAME ATTRIBUTE name TO name opt_drop_behavior
8500 : {
8501 0 : $$ = cat_str(7,mm_strdup("alter type"),$3,mm_strdup("rename attribute"),$6,mm_strdup("to"),$8,$9);
8502 : }
8503 : ;
8504 :
8505 :
8506 : opt_column:
8507 : COLUMN
8508 : {
8509 2 : $$ = mm_strdup("column");
8510 : }
8511 : |
8512 : {
8513 2 : $$=EMPTY; }
8514 : ;
8515 :
8516 :
8517 : opt_set_data:
8518 : SET DATA_P
8519 : {
8520 2 : $$ = mm_strdup("set data");
8521 : }
8522 : |
8523 : {
8524 2 : $$=EMPTY; }
8525 : ;
8526 :
8527 :
8528 : AlterObjectDependsStmt:
8529 : ALTER FUNCTION function_with_argtypes opt_no DEPENDS ON EXTENSION name
8530 : {
8531 0 : $$ = cat_str(5,mm_strdup("alter function"),$3,$4,mm_strdup("depends on extension"),$8);
8532 : }
8533 : | ALTER PROCEDURE function_with_argtypes opt_no DEPENDS ON EXTENSION name
8534 : {
8535 0 : $$ = cat_str(5,mm_strdup("alter procedure"),$3,$4,mm_strdup("depends on extension"),$8);
8536 : }
8537 : | ALTER ROUTINE function_with_argtypes opt_no DEPENDS ON EXTENSION name
8538 : {
8539 0 : $$ = cat_str(5,mm_strdup("alter routine"),$3,$4,mm_strdup("depends on extension"),$8);
8540 : }
8541 : | ALTER TRIGGER name ON qualified_name opt_no DEPENDS ON EXTENSION name
8542 : {
8543 0 : $$ = cat_str(7,mm_strdup("alter trigger"),$3,mm_strdup("on"),$5,$6,mm_strdup("depends on extension"),$10);
8544 : }
8545 : | ALTER MATERIALIZED VIEW qualified_name opt_no DEPENDS ON EXTENSION name
8546 : {
8547 0 : $$ = cat_str(5,mm_strdup("alter materialized view"),$4,$5,mm_strdup("depends on extension"),$9);
8548 : }
8549 : | ALTER INDEX qualified_name opt_no DEPENDS ON EXTENSION name
8550 : {
8551 0 : $$ = cat_str(5,mm_strdup("alter index"),$3,$4,mm_strdup("depends on extension"),$8);
8552 : }
8553 : ;
8554 :
8555 :
8556 : opt_no:
8557 : NO
8558 : {
8559 0 : $$ = mm_strdup("no");
8560 : }
8561 : |
8562 : {
8563 0 : $$=EMPTY; }
8564 : ;
8565 :
8566 :
8567 : AlterObjectSchemaStmt:
8568 : ALTER AGGREGATE aggregate_with_argtypes SET SCHEMA name
8569 : {
8570 0 : $$ = cat_str(4,mm_strdup("alter aggregate"),$3,mm_strdup("set schema"),$6);
8571 : }
8572 : | ALTER COLLATION any_name SET SCHEMA name
8573 : {
8574 0 : $$ = cat_str(4,mm_strdup("alter collation"),$3,mm_strdup("set schema"),$6);
8575 : }
8576 : | ALTER CONVERSION_P any_name SET SCHEMA name
8577 : {
8578 0 : $$ = cat_str(4,mm_strdup("alter conversion"),$3,mm_strdup("set schema"),$6);
8579 : }
8580 : | ALTER DOMAIN_P any_name SET SCHEMA name
8581 : {
8582 0 : $$ = cat_str(4,mm_strdup("alter domain"),$3,mm_strdup("set schema"),$6);
8583 : }
8584 : | ALTER EXTENSION name SET SCHEMA name
8585 : {
8586 0 : $$ = cat_str(4,mm_strdup("alter extension"),$3,mm_strdup("set schema"),$6);
8587 : }
8588 : | ALTER FUNCTION function_with_argtypes SET SCHEMA name
8589 : {
8590 0 : $$ = cat_str(4,mm_strdup("alter function"),$3,mm_strdup("set schema"),$6);
8591 : }
8592 : | ALTER OPERATOR operator_with_argtypes SET SCHEMA name
8593 : {
8594 0 : $$ = cat_str(4,mm_strdup("alter operator"),$3,mm_strdup("set schema"),$6);
8595 : }
8596 : | ALTER OPERATOR CLASS any_name USING name SET SCHEMA name
8597 : {
8598 0 : $$ = cat_str(6,mm_strdup("alter operator class"),$4,mm_strdup("using"),$6,mm_strdup("set schema"),$9);
8599 : }
8600 : | ALTER OPERATOR FAMILY any_name USING name SET SCHEMA name
8601 : {
8602 0 : $$ = cat_str(6,mm_strdup("alter operator family"),$4,mm_strdup("using"),$6,mm_strdup("set schema"),$9);
8603 : }
8604 : | ALTER PROCEDURE function_with_argtypes SET SCHEMA name
8605 : {
8606 0 : $$ = cat_str(4,mm_strdup("alter procedure"),$3,mm_strdup("set schema"),$6);
8607 : }
8608 : | ALTER ROUTINE function_with_argtypes SET SCHEMA name
8609 : {
8610 0 : $$ = cat_str(4,mm_strdup("alter routine"),$3,mm_strdup("set schema"),$6);
8611 : }
8612 : | ALTER TABLE relation_expr SET SCHEMA name
8613 : {
8614 0 : $$ = cat_str(4,mm_strdup("alter table"),$3,mm_strdup("set schema"),$6);
8615 : }
8616 : | ALTER TABLE IF_P EXISTS relation_expr SET SCHEMA name
8617 : {
8618 0 : $$ = cat_str(4,mm_strdup("alter table if exists"),$5,mm_strdup("set schema"),$8);
8619 : }
8620 : | ALTER STATISTICS any_name SET SCHEMA name
8621 : {
8622 0 : $$ = cat_str(4,mm_strdup("alter statistics"),$3,mm_strdup("set schema"),$6);
8623 : }
8624 : | ALTER TEXT_P SEARCH PARSER any_name SET SCHEMA name
8625 : {
8626 0 : $$ = cat_str(4,mm_strdup("alter text search parser"),$5,mm_strdup("set schema"),$8);
8627 : }
8628 : | ALTER TEXT_P SEARCH DICTIONARY any_name SET SCHEMA name
8629 : {
8630 0 : $$ = cat_str(4,mm_strdup("alter text search dictionary"),$5,mm_strdup("set schema"),$8);
8631 : }
8632 : | ALTER TEXT_P SEARCH TEMPLATE any_name SET SCHEMA name
8633 : {
8634 0 : $$ = cat_str(4,mm_strdup("alter text search template"),$5,mm_strdup("set schema"),$8);
8635 : }
8636 : | ALTER TEXT_P SEARCH CONFIGURATION any_name SET SCHEMA name
8637 : {
8638 0 : $$ = cat_str(4,mm_strdup("alter text search configuration"),$5,mm_strdup("set schema"),$8);
8639 : }
8640 : | ALTER SEQUENCE qualified_name SET SCHEMA name
8641 : {
8642 0 : $$ = cat_str(4,mm_strdup("alter sequence"),$3,mm_strdup("set schema"),$6);
8643 : }
8644 : | ALTER SEQUENCE IF_P EXISTS qualified_name SET SCHEMA name
8645 : {
8646 0 : $$ = cat_str(4,mm_strdup("alter sequence if exists"),$5,mm_strdup("set schema"),$8);
8647 : }
8648 : | ALTER VIEW qualified_name SET SCHEMA name
8649 : {
8650 0 : $$ = cat_str(4,mm_strdup("alter view"),$3,mm_strdup("set schema"),$6);
8651 : }
8652 : | ALTER VIEW IF_P EXISTS qualified_name SET SCHEMA name
8653 : {
8654 0 : $$ = cat_str(4,mm_strdup("alter view if exists"),$5,mm_strdup("set schema"),$8);
8655 : }
8656 : | ALTER MATERIALIZED VIEW qualified_name SET SCHEMA name
8657 : {
8658 0 : $$ = cat_str(4,mm_strdup("alter materialized view"),$4,mm_strdup("set schema"),$7);
8659 : }
8660 : | ALTER MATERIALIZED VIEW IF_P EXISTS qualified_name SET SCHEMA name
8661 : {
8662 0 : $$ = cat_str(4,mm_strdup("alter materialized view if exists"),$6,mm_strdup("set schema"),$9);
8663 : }
8664 : | ALTER FOREIGN TABLE relation_expr SET SCHEMA name
8665 : {
8666 0 : $$ = cat_str(4,mm_strdup("alter foreign table"),$4,mm_strdup("set schema"),$7);
8667 : }
8668 : | ALTER FOREIGN TABLE IF_P EXISTS relation_expr SET SCHEMA name
8669 : {
8670 0 : $$ = cat_str(4,mm_strdup("alter foreign table if exists"),$6,mm_strdup("set schema"),$9);
8671 : }
8672 : | ALTER TYPE_P any_name SET SCHEMA name
8673 : {
8674 0 : $$ = cat_str(4,mm_strdup("alter type"),$3,mm_strdup("set schema"),$6);
8675 : }
8676 : ;
8677 :
8678 :
8679 : AlterOperatorStmt:
8680 : ALTER OPERATOR operator_with_argtypes SET '(' operator_def_list ')'
8681 : {
8682 0 : $$ = cat_str(5,mm_strdup("alter operator"),$3,mm_strdup("set ("),$6,mm_strdup(")"));
8683 : }
8684 : ;
8685 :
8686 :
8687 : operator_def_list:
8688 : operator_def_elem
8689 : {
8690 0 : $$ = $1;
8691 : }
8692 : | operator_def_list ',' operator_def_elem
8693 : {
8694 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
8695 : }
8696 : ;
8697 :
8698 :
8699 : operator_def_elem:
8700 : ColLabel '=' NONE
8701 : {
8702 0 : $$ = cat_str(2,$1,mm_strdup("= none"));
8703 : }
8704 : | ColLabel '=' operator_def_arg
8705 : {
8706 0 : $$ = cat_str(3,$1,mm_strdup("="),$3);
8707 : }
8708 : | ColLabel
8709 : {
8710 0 : $$ = $1;
8711 : }
8712 : ;
8713 :
8714 :
8715 : operator_def_arg:
8716 : func_type
8717 : {
8718 0 : $$ = $1;
8719 : }
8720 : | reserved_keyword
8721 : {
8722 0 : $$ = $1;
8723 : }
8724 : | qual_all_Op
8725 : {
8726 0 : $$ = $1;
8727 : }
8728 : | NumericOnly
8729 : {
8730 0 : $$ = $1;
8731 : }
8732 : | ecpg_sconst
8733 : {
8734 0 : $$ = $1;
8735 : }
8736 : ;
8737 :
8738 :
8739 : AlterTypeStmt:
8740 : ALTER TYPE_P any_name SET '(' operator_def_list ')'
8741 : {
8742 0 : $$ = cat_str(5,mm_strdup("alter type"),$3,mm_strdup("set ("),$6,mm_strdup(")"));
8743 : }
8744 : ;
8745 :
8746 :
8747 : AlterOwnerStmt:
8748 : ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
8749 : {
8750 0 : $$ = cat_str(4,mm_strdup("alter aggregate"),$3,mm_strdup("owner to"),$6);
8751 : }
8752 : | ALTER COLLATION any_name OWNER TO RoleSpec
8753 : {
8754 0 : $$ = cat_str(4,mm_strdup("alter collation"),$3,mm_strdup("owner to"),$6);
8755 : }
8756 : | ALTER CONVERSION_P any_name OWNER TO RoleSpec
8757 : {
8758 0 : $$ = cat_str(4,mm_strdup("alter conversion"),$3,mm_strdup("owner to"),$6);
8759 : }
8760 : | ALTER DATABASE name OWNER TO RoleSpec
8761 : {
8762 0 : $$ = cat_str(4,mm_strdup("alter database"),$3,mm_strdup("owner to"),$6);
8763 : }
8764 : | ALTER DOMAIN_P any_name OWNER TO RoleSpec
8765 : {
8766 0 : $$ = cat_str(4,mm_strdup("alter domain"),$3,mm_strdup("owner to"),$6);
8767 : }
8768 : | ALTER FUNCTION function_with_argtypes OWNER TO RoleSpec
8769 : {
8770 0 : $$ = cat_str(4,mm_strdup("alter function"),$3,mm_strdup("owner to"),$6);
8771 : }
8772 : | ALTER opt_procedural LANGUAGE name OWNER TO RoleSpec
8773 : {
8774 0 : $$ = cat_str(6,mm_strdup("alter"),$2,mm_strdup("language"),$4,mm_strdup("owner to"),$7);
8775 : }
8776 : | ALTER LARGE_P OBJECT_P NumericOnly OWNER TO RoleSpec
8777 : {
8778 0 : $$ = cat_str(4,mm_strdup("alter large object"),$4,mm_strdup("owner to"),$7);
8779 : }
8780 : | ALTER OPERATOR operator_with_argtypes OWNER TO RoleSpec
8781 : {
8782 0 : $$ = cat_str(4,mm_strdup("alter operator"),$3,mm_strdup("owner to"),$6);
8783 : }
8784 : | ALTER OPERATOR CLASS any_name USING name OWNER TO RoleSpec
8785 : {
8786 0 : $$ = cat_str(6,mm_strdup("alter operator class"),$4,mm_strdup("using"),$6,mm_strdup("owner to"),$9);
8787 : }
8788 : | ALTER OPERATOR FAMILY any_name USING name OWNER TO RoleSpec
8789 : {
8790 0 : $$ = cat_str(6,mm_strdup("alter operator family"),$4,mm_strdup("using"),$6,mm_strdup("owner to"),$9);
8791 : }
8792 : | ALTER PROCEDURE function_with_argtypes OWNER TO RoleSpec
8793 : {
8794 0 : $$ = cat_str(4,mm_strdup("alter procedure"),$3,mm_strdup("owner to"),$6);
8795 : }
8796 : | ALTER ROUTINE function_with_argtypes OWNER TO RoleSpec
8797 : {
8798 0 : $$ = cat_str(4,mm_strdup("alter routine"),$3,mm_strdup("owner to"),$6);
8799 : }
8800 : | ALTER SCHEMA name OWNER TO RoleSpec
8801 : {
8802 0 : $$ = cat_str(4,mm_strdup("alter schema"),$3,mm_strdup("owner to"),$6);
8803 : }
8804 : | ALTER TYPE_P any_name OWNER TO RoleSpec
8805 : {
8806 0 : $$ = cat_str(4,mm_strdup("alter type"),$3,mm_strdup("owner to"),$6);
8807 : }
8808 : | ALTER TABLESPACE name OWNER TO RoleSpec
8809 : {
8810 0 : $$ = cat_str(4,mm_strdup("alter tablespace"),$3,mm_strdup("owner to"),$6);
8811 : }
8812 : | ALTER STATISTICS any_name OWNER TO RoleSpec
8813 : {
8814 0 : $$ = cat_str(4,mm_strdup("alter statistics"),$3,mm_strdup("owner to"),$6);
8815 : }
8816 : | ALTER TEXT_P SEARCH DICTIONARY any_name OWNER TO RoleSpec
8817 : {
8818 0 : $$ = cat_str(4,mm_strdup("alter text search dictionary"),$5,mm_strdup("owner to"),$8);
8819 : }
8820 : | ALTER TEXT_P SEARCH CONFIGURATION any_name OWNER TO RoleSpec
8821 : {
8822 0 : $$ = cat_str(4,mm_strdup("alter text search configuration"),$5,mm_strdup("owner to"),$8);
8823 : }
8824 : | ALTER FOREIGN DATA_P WRAPPER name OWNER TO RoleSpec
8825 : {
8826 0 : $$ = cat_str(4,mm_strdup("alter foreign data wrapper"),$5,mm_strdup("owner to"),$8);
8827 : }
8828 : | ALTER SERVER name OWNER TO RoleSpec
8829 : {
8830 0 : $$ = cat_str(4,mm_strdup("alter server"),$3,mm_strdup("owner to"),$6);
8831 : }
8832 : | ALTER EVENT TRIGGER name OWNER TO RoleSpec
8833 : {
8834 0 : $$ = cat_str(4,mm_strdup("alter event trigger"),$4,mm_strdup("owner to"),$7);
8835 : }
8836 : | ALTER PUBLICATION name OWNER TO RoleSpec
8837 : {
8838 0 : $$ = cat_str(4,mm_strdup("alter publication"),$3,mm_strdup("owner to"),$6);
8839 : }
8840 : | ALTER SUBSCRIPTION name OWNER TO RoleSpec
8841 : {
8842 0 : $$ = cat_str(4,mm_strdup("alter subscription"),$3,mm_strdup("owner to"),$6);
8843 : }
8844 : ;
8845 :
8846 :
8847 : CreatePublicationStmt:
8848 : CREATE PUBLICATION name opt_definition
8849 : {
8850 0 : $$ = cat_str(3,mm_strdup("create publication"),$3,$4);
8851 : }
8852 : | CREATE PUBLICATION name FOR ALL TABLES opt_definition
8853 : {
8854 0 : $$ = cat_str(4,mm_strdup("create publication"),$3,mm_strdup("for all tables"),$7);
8855 : }
8856 : | CREATE PUBLICATION name FOR pub_obj_list opt_definition
8857 : {
8858 0 : $$ = cat_str(5,mm_strdup("create publication"),$3,mm_strdup("for"),$5,$6);
8859 : }
8860 : ;
8861 :
8862 :
8863 : PublicationObjSpec:
8864 : TABLE relation_expr opt_column_list OptWhereClause
8865 : {
8866 0 : $$ = cat_str(4,mm_strdup("table"),$2,$3,$4);
8867 : }
8868 : | TABLES IN_P SCHEMA ColId
8869 : {
8870 0 : $$ = cat_str(2,mm_strdup("tables in schema"),$4);
8871 : }
8872 : | TABLES IN_P SCHEMA CURRENT_SCHEMA
8873 : {
8874 0 : $$ = mm_strdup("tables in schema current_schema");
8875 : }
8876 : | ColId opt_column_list OptWhereClause
8877 : {
8878 0 : $$ = cat_str(3,$1,$2,$3);
8879 : }
8880 : | ColId indirection opt_column_list OptWhereClause
8881 : {
8882 0 : $$ = cat_str(4,$1,$2,$3,$4);
8883 : }
8884 : | extended_relation_expr opt_column_list OptWhereClause
8885 : {
8886 0 : $$ = cat_str(3,$1,$2,$3);
8887 : }
8888 : | CURRENT_SCHEMA
8889 : {
8890 0 : $$ = mm_strdup("current_schema");
8891 : }
8892 : ;
8893 :
8894 :
8895 : pub_obj_list:
8896 : PublicationObjSpec
8897 : {
8898 0 : $$ = $1;
8899 : }
8900 : | pub_obj_list ',' PublicationObjSpec
8901 : {
8902 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
8903 : }
8904 : ;
8905 :
8906 :
8907 : AlterPublicationStmt:
8908 : ALTER PUBLICATION name SET definition
8909 : {
8910 0 : $$ = cat_str(4,mm_strdup("alter publication"),$3,mm_strdup("set"),$5);
8911 : }
8912 : | ALTER PUBLICATION name ADD_P pub_obj_list
8913 : {
8914 0 : $$ = cat_str(4,mm_strdup("alter publication"),$3,mm_strdup("add"),$5);
8915 : }
8916 : | ALTER PUBLICATION name SET pub_obj_list
8917 : {
8918 0 : $$ = cat_str(4,mm_strdup("alter publication"),$3,mm_strdup("set"),$5);
8919 : }
8920 : | ALTER PUBLICATION name DROP pub_obj_list
8921 : {
8922 0 : $$ = cat_str(4,mm_strdup("alter publication"),$3,mm_strdup("drop"),$5);
8923 : }
8924 : ;
8925 :
8926 :
8927 : CreateSubscriptionStmt:
8928 : CREATE SUBSCRIPTION name CONNECTION ecpg_sconst PUBLICATION name_list opt_definition
8929 : {
8930 0 : $$ = cat_str(7,mm_strdup("create subscription"),$3,mm_strdup("connection"),$5,mm_strdup("publication"),$7,$8);
8931 : }
8932 : ;
8933 :
8934 :
8935 : AlterSubscriptionStmt:
8936 : ALTER SUBSCRIPTION name SET definition
8937 : {
8938 0 : $$ = cat_str(4,mm_strdup("alter subscription"),$3,mm_strdup("set"),$5);
8939 : }
8940 : | ALTER SUBSCRIPTION name CONNECTION ecpg_sconst
8941 : {
8942 0 : $$ = cat_str(4,mm_strdup("alter subscription"),$3,mm_strdup("connection"),$5);
8943 : }
8944 : | ALTER SUBSCRIPTION name REFRESH PUBLICATION opt_definition
8945 : {
8946 0 : $$ = cat_str(4,mm_strdup("alter subscription"),$3,mm_strdup("refresh publication"),$6);
8947 : }
8948 : | ALTER SUBSCRIPTION name ADD_P PUBLICATION name_list opt_definition
8949 : {
8950 0 : $$ = cat_str(5,mm_strdup("alter subscription"),$3,mm_strdup("add publication"),$6,$7);
8951 : }
8952 : | ALTER SUBSCRIPTION name DROP PUBLICATION name_list opt_definition
8953 : {
8954 0 : $$ = cat_str(5,mm_strdup("alter subscription"),$3,mm_strdup("drop publication"),$6,$7);
8955 : }
8956 : | ALTER SUBSCRIPTION name SET PUBLICATION name_list opt_definition
8957 : {
8958 0 : $$ = cat_str(5,mm_strdup("alter subscription"),$3,mm_strdup("set publication"),$6,$7);
8959 : }
8960 : | ALTER SUBSCRIPTION name ENABLE_P
8961 : {
8962 0 : $$ = cat_str(3,mm_strdup("alter subscription"),$3,mm_strdup("enable"));
8963 : }
8964 : | ALTER SUBSCRIPTION name DISABLE_P
8965 : {
8966 0 : $$ = cat_str(3,mm_strdup("alter subscription"),$3,mm_strdup("disable"));
8967 : }
8968 : | ALTER SUBSCRIPTION name SKIP definition
8969 : {
8970 0 : $$ = cat_str(4,mm_strdup("alter subscription"),$3,mm_strdup("skip"),$5);
8971 : }
8972 : ;
8973 :
8974 :
8975 : DropSubscriptionStmt:
8976 : DROP SUBSCRIPTION name opt_drop_behavior
8977 : {
8978 0 : $$ = cat_str(3,mm_strdup("drop subscription"),$3,$4);
8979 : }
8980 : | DROP SUBSCRIPTION IF_P EXISTS name opt_drop_behavior
8981 : {
8982 0 : $$ = cat_str(3,mm_strdup("drop subscription if exists"),$5,$6);
8983 : }
8984 : ;
8985 :
8986 :
8987 : RuleStmt:
8988 : CREATE opt_or_replace RULE name AS ON event TO qualified_name where_clause DO opt_instead RuleActionList
8989 : {
8990 0 : $$ = cat_str(12,mm_strdup("create"),$2,mm_strdup("rule"),$4,mm_strdup("as on"),$7,mm_strdup("to"),$9,$10,mm_strdup("do"),$12,$13);
8991 : }
8992 : ;
8993 :
8994 :
8995 : RuleActionList:
8996 : NOTHING
8997 : {
8998 0 : $$ = mm_strdup("nothing");
8999 : }
9000 : | RuleActionStmt
9001 : {
9002 0 : $$ = $1;
9003 : }
9004 : | '(' RuleActionMulti ')'
9005 : {
9006 0 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
9007 : }
9008 : ;
9009 :
9010 :
9011 : RuleActionMulti:
9012 : RuleActionMulti ';' RuleActionStmtOrEmpty
9013 : {
9014 0 : $$ = cat_str(3,$1,mm_strdup(";"),$3);
9015 : }
9016 : | RuleActionStmtOrEmpty
9017 : {
9018 0 : $$ = $1;
9019 : }
9020 : ;
9021 :
9022 :
9023 : RuleActionStmt:
9024 : SelectStmt
9025 : {
9026 0 : $$ = $1;
9027 : }
9028 : | InsertStmt
9029 : {
9030 0 : $$ = $1;
9031 : }
9032 : | UpdateStmt
9033 : {
9034 0 : $$ = $1;
9035 : }
9036 : | DeleteStmt
9037 : {
9038 0 : $$ = $1;
9039 : }
9040 : | NotifyStmt
9041 : {
9042 0 : $$ = $1;
9043 : }
9044 : ;
9045 :
9046 :
9047 : RuleActionStmtOrEmpty:
9048 : RuleActionStmt
9049 : {
9050 0 : $$ = $1;
9051 : }
9052 : |
9053 : {
9054 0 : $$=EMPTY; }
9055 : ;
9056 :
9057 :
9058 : event:
9059 : SELECT
9060 : {
9061 0 : $$ = mm_strdup("select");
9062 : }
9063 : | UPDATE
9064 : {
9065 0 : $$ = mm_strdup("update");
9066 : }
9067 : | DELETE_P
9068 : {
9069 0 : $$ = mm_strdup("delete");
9070 : }
9071 : | INSERT
9072 : {
9073 0 : $$ = mm_strdup("insert");
9074 : }
9075 : ;
9076 :
9077 :
9078 : opt_instead:
9079 : INSTEAD
9080 : {
9081 0 : $$ = mm_strdup("instead");
9082 : }
9083 : | ALSO
9084 : {
9085 0 : $$ = mm_strdup("also");
9086 : }
9087 : |
9088 : {
9089 0 : $$=EMPTY; }
9090 : ;
9091 :
9092 :
9093 : NotifyStmt:
9094 : NOTIFY ColId notify_payload
9095 : {
9096 0 : $$ = cat_str(3,mm_strdup("notify"),$2,$3);
9097 : }
9098 : ;
9099 :
9100 :
9101 : notify_payload:
9102 : ',' ecpg_sconst
9103 : {
9104 0 : $$ = cat_str(2,mm_strdup(","),$2);
9105 : }
9106 : |
9107 : {
9108 0 : $$=EMPTY; }
9109 : ;
9110 :
9111 :
9112 : ListenStmt:
9113 : LISTEN ColId
9114 : {
9115 0 : $$ = cat_str(2,mm_strdup("listen"),$2);
9116 : }
9117 : ;
9118 :
9119 :
9120 : UnlistenStmt:
9121 : UNLISTEN ColId
9122 : {
9123 0 : $$ = cat_str(2,mm_strdup("unlisten"),$2);
9124 : }
9125 : | UNLISTEN '*'
9126 : {
9127 0 : $$ = mm_strdup("unlisten *");
9128 : }
9129 : ;
9130 :
9131 :
9132 : TransactionStmt:
9133 : ABORT_P opt_transaction opt_transaction_chain
9134 : {
9135 0 : $$ = cat_str(3,mm_strdup("abort"),$2,$3);
9136 : }
9137 : | START TRANSACTION transaction_mode_list_or_empty
9138 : {
9139 0 : $$ = cat_str(2,mm_strdup("start transaction"),$3);
9140 : }
9141 : | COMMIT opt_transaction opt_transaction_chain
9142 : {
9143 122 : $$ = cat_str(3,mm_strdup("commit"),$2,$3);
9144 : }
9145 : | ROLLBACK opt_transaction opt_transaction_chain
9146 : {
9147 32 : $$ = cat_str(3,mm_strdup("rollback"),$2,$3);
9148 : }
9149 : | SAVEPOINT ColId
9150 : {
9151 0 : $$ = cat_str(2,mm_strdup("savepoint"),$2);
9152 : }
9153 : | RELEASE SAVEPOINT ColId
9154 : {
9155 0 : $$ = cat_str(2,mm_strdup("release savepoint"),$3);
9156 : }
9157 : | RELEASE ColId
9158 : {
9159 0 : $$ = cat_str(2,mm_strdup("release"),$2);
9160 : }
9161 : | ROLLBACK opt_transaction TO SAVEPOINT ColId
9162 : {
9163 0 : $$ = cat_str(4,mm_strdup("rollback"),$2,mm_strdup("to savepoint"),$5);
9164 : }
9165 : | ROLLBACK opt_transaction TO ColId
9166 : {
9167 0 : $$ = cat_str(4,mm_strdup("rollback"),$2,mm_strdup("to"),$4);
9168 : }
9169 : | PREPARE TRANSACTION ecpg_sconst
9170 : {
9171 2 : $$ = cat_str(2,mm_strdup("prepare transaction"),$3);
9172 : }
9173 : | COMMIT PREPARED ecpg_sconst
9174 : {
9175 2 : $$ = cat_str(2,mm_strdup("commit prepared"),$3);
9176 : }
9177 : | ROLLBACK PREPARED ecpg_sconst
9178 : {
9179 0 : $$ = cat_str(2,mm_strdup("rollback prepared"),$3);
9180 : }
9181 : ;
9182 :
9183 :
9184 : TransactionStmtLegacy:
9185 : BEGIN_P opt_transaction transaction_mode_list_or_empty
9186 : {
9187 16 : $$ = cat_str(3,mm_strdup("begin"),$2,$3);
9188 : }
9189 : | END_P opt_transaction opt_transaction_chain
9190 : {
9191 0 : $$ = cat_str(3,mm_strdup("end"),$2,$3);
9192 : }
9193 : ;
9194 :
9195 :
9196 : opt_transaction:
9197 : WORK
9198 : {
9199 24 : $$ = mm_strdup("work");
9200 : }
9201 : | TRANSACTION
9202 : {
9203 0 : $$ = mm_strdup("transaction");
9204 : }
9205 : |
9206 : {
9207 146 : $$=EMPTY; }
9208 : ;
9209 :
9210 :
9211 : transaction_mode_item:
9212 : ISOLATION LEVEL iso_level
9213 : {
9214 2 : $$ = cat_str(2,mm_strdup("isolation level"),$3);
9215 : }
9216 : | READ ONLY
9217 : {
9218 0 : $$ = mm_strdup("read only");
9219 : }
9220 : | READ WRITE
9221 : {
9222 0 : $$ = mm_strdup("read write");
9223 : }
9224 : | DEFERRABLE
9225 : {
9226 0 : $$ = mm_strdup("deferrable");
9227 : }
9228 : | NOT DEFERRABLE
9229 : {
9230 0 : $$ = mm_strdup("not deferrable");
9231 : }
9232 : ;
9233 :
9234 :
9235 : transaction_mode_list:
9236 : transaction_mode_item
9237 : {
9238 2 : $$ = $1;
9239 : }
9240 : | transaction_mode_list ',' transaction_mode_item
9241 : {
9242 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
9243 : }
9244 : | transaction_mode_list transaction_mode_item
9245 : {
9246 0 : $$ = cat_str(2,$1,$2);
9247 : }
9248 : ;
9249 :
9250 :
9251 : transaction_mode_list_or_empty:
9252 : transaction_mode_list
9253 : {
9254 0 : $$ = $1;
9255 : }
9256 : |
9257 : {
9258 16 : $$=EMPTY; }
9259 : ;
9260 :
9261 :
9262 : opt_transaction_chain:
9263 : AND CHAIN
9264 : {
9265 0 : $$ = mm_strdup("and chain");
9266 : }
9267 : | AND NO CHAIN
9268 : {
9269 0 : $$ = mm_strdup("and no chain");
9270 : }
9271 : |
9272 : {
9273 154 : $$=EMPTY; }
9274 : ;
9275 :
9276 :
9277 : ViewStmt:
9278 : CREATE OptTemp VIEW qualified_name opt_column_list opt_reloptions AS SelectStmt opt_check_option
9279 : {
9280 0 : $$ = cat_str(9,mm_strdup("create"),$2,mm_strdup("view"),$4,$5,$6,mm_strdup("as"),$8,$9);
9281 : }
9282 : | CREATE OR REPLACE OptTemp VIEW qualified_name opt_column_list opt_reloptions AS SelectStmt opt_check_option
9283 : {
9284 0 : $$ = cat_str(9,mm_strdup("create or replace"),$4,mm_strdup("view"),$6,$7,$8,mm_strdup("as"),$10,$11);
9285 : }
9286 : | CREATE OptTemp RECURSIVE VIEW qualified_name '(' columnList ')' opt_reloptions AS SelectStmt opt_check_option
9287 : {
9288 0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
9289 0 : $$ = cat_str(11,mm_strdup("create"),$2,mm_strdup("recursive view"),$5,mm_strdup("("),$7,mm_strdup(")"),$9,mm_strdup("as"),$11,$12);
9290 : }
9291 : | CREATE OR REPLACE OptTemp RECURSIVE VIEW qualified_name '(' columnList ')' opt_reloptions AS SelectStmt opt_check_option
9292 : {
9293 0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
9294 0 : $$ = cat_str(11,mm_strdup("create or replace"),$4,mm_strdup("recursive view"),$7,mm_strdup("("),$9,mm_strdup(")"),$11,mm_strdup("as"),$13,$14);
9295 : }
9296 : ;
9297 :
9298 :
9299 : opt_check_option:
9300 : WITH CHECK OPTION
9301 : {
9302 0 : $$ = mm_strdup("with check option");
9303 : }
9304 : | WITH CASCADED CHECK OPTION
9305 : {
9306 0 : $$ = mm_strdup("with cascaded check option");
9307 : }
9308 : | WITH LOCAL CHECK OPTION
9309 : {
9310 0 : $$ = mm_strdup("with local check option");
9311 : }
9312 : |
9313 : {
9314 0 : $$=EMPTY; }
9315 : ;
9316 :
9317 :
9318 : LoadStmt:
9319 : LOAD file_name
9320 : {
9321 0 : $$ = cat_str(2,mm_strdup("load"),$2);
9322 : }
9323 : ;
9324 :
9325 :
9326 : CreatedbStmt:
9327 : CREATE DATABASE name opt_with createdb_opt_list
9328 : {
9329 0 : $$ = cat_str(4,mm_strdup("create database"),$3,$4,$5);
9330 : }
9331 : ;
9332 :
9333 :
9334 : createdb_opt_list:
9335 : createdb_opt_items
9336 : {
9337 0 : $$ = $1;
9338 : }
9339 : |
9340 : {
9341 0 : $$=EMPTY; }
9342 : ;
9343 :
9344 :
9345 : createdb_opt_items:
9346 : createdb_opt_item
9347 : {
9348 0 : $$ = $1;
9349 : }
9350 : | createdb_opt_items createdb_opt_item
9351 : {
9352 0 : $$ = cat_str(2,$1,$2);
9353 : }
9354 : ;
9355 :
9356 :
9357 : createdb_opt_item:
9358 : createdb_opt_name opt_equal NumericOnly
9359 : {
9360 0 : $$ = cat_str(3,$1,$2,$3);
9361 : }
9362 : | createdb_opt_name opt_equal opt_boolean_or_string
9363 : {
9364 0 : $$ = cat_str(3,$1,$2,$3);
9365 : }
9366 : | createdb_opt_name opt_equal DEFAULT
9367 : {
9368 0 : $$ = cat_str(3,$1,$2,mm_strdup("default"));
9369 : }
9370 : ;
9371 :
9372 :
9373 : createdb_opt_name:
9374 : ecpg_ident
9375 : {
9376 0 : $$ = $1;
9377 : }
9378 : | CONNECTION LIMIT
9379 : {
9380 0 : $$ = mm_strdup("connection limit");
9381 : }
9382 : | ENCODING
9383 : {
9384 0 : $$ = mm_strdup("encoding");
9385 : }
9386 : | LOCATION
9387 : {
9388 0 : $$ = mm_strdup("location");
9389 : }
9390 : | OWNER
9391 : {
9392 0 : $$ = mm_strdup("owner");
9393 : }
9394 : | TABLESPACE
9395 : {
9396 0 : $$ = mm_strdup("tablespace");
9397 : }
9398 : | TEMPLATE
9399 : {
9400 0 : $$ = mm_strdup("template");
9401 : }
9402 : ;
9403 :
9404 :
9405 : opt_equal:
9406 : '='
9407 : {
9408 0 : $$ = mm_strdup("=");
9409 : }
9410 : |
9411 : {
9412 0 : $$=EMPTY; }
9413 : ;
9414 :
9415 :
9416 : AlterDatabaseStmt:
9417 : ALTER DATABASE name WITH createdb_opt_list
9418 : {
9419 0 : $$ = cat_str(4,mm_strdup("alter database"),$3,mm_strdup("with"),$5);
9420 : }
9421 : | ALTER DATABASE name createdb_opt_list
9422 : {
9423 0 : $$ = cat_str(3,mm_strdup("alter database"),$3,$4);
9424 : }
9425 : | ALTER DATABASE name SET TABLESPACE name
9426 : {
9427 0 : $$ = cat_str(4,mm_strdup("alter database"),$3,mm_strdup("set tablespace"),$6);
9428 : }
9429 : | ALTER DATABASE name REFRESH COLLATION VERSION_P
9430 : {
9431 0 : $$ = cat_str(3,mm_strdup("alter database"),$3,mm_strdup("refresh collation version"));
9432 : }
9433 : ;
9434 :
9435 :
9436 : AlterDatabaseSetStmt:
9437 : ALTER DATABASE name SetResetClause
9438 : {
9439 0 : $$ = cat_str(3,mm_strdup("alter database"),$3,$4);
9440 : }
9441 : ;
9442 :
9443 :
9444 : DropdbStmt:
9445 : DROP DATABASE name
9446 : {
9447 0 : $$ = cat_str(2,mm_strdup("drop database"),$3);
9448 : }
9449 : | DROP DATABASE IF_P EXISTS name
9450 : {
9451 0 : $$ = cat_str(2,mm_strdup("drop database if exists"),$5);
9452 : }
9453 : | DROP DATABASE name opt_with '(' drop_option_list ')'
9454 : {
9455 0 : $$ = cat_str(6,mm_strdup("drop database"),$3,$4,mm_strdup("("),$6,mm_strdup(")"));
9456 : }
9457 : | DROP DATABASE IF_P EXISTS name opt_with '(' drop_option_list ')'
9458 : {
9459 0 : $$ = cat_str(6,mm_strdup("drop database if exists"),$5,$6,mm_strdup("("),$8,mm_strdup(")"));
9460 : }
9461 : ;
9462 :
9463 :
9464 : drop_option_list:
9465 : drop_option
9466 : {
9467 0 : $$ = $1;
9468 : }
9469 : | drop_option_list ',' drop_option
9470 : {
9471 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
9472 : }
9473 : ;
9474 :
9475 :
9476 : drop_option:
9477 : FORCE
9478 : {
9479 0 : $$ = mm_strdup("force");
9480 : }
9481 : ;
9482 :
9483 :
9484 : AlterCollationStmt:
9485 : ALTER COLLATION any_name REFRESH VERSION_P
9486 : {
9487 0 : $$ = cat_str(3,mm_strdup("alter collation"),$3,mm_strdup("refresh version"));
9488 : }
9489 : ;
9490 :
9491 :
9492 : AlterSystemStmt:
9493 : ALTER SYSTEM_P SET generic_set
9494 : {
9495 0 : $$ = cat_str(2,mm_strdup("alter system set"),$4);
9496 : }
9497 : | ALTER SYSTEM_P RESET generic_reset
9498 : {
9499 0 : $$ = cat_str(2,mm_strdup("alter system reset"),$4);
9500 : }
9501 : ;
9502 :
9503 :
9504 : CreateDomainStmt:
9505 : CREATE DOMAIN_P any_name opt_as Typename ColQualList
9506 : {
9507 0 : $$ = cat_str(5,mm_strdup("create domain"),$3,$4,$5,$6);
9508 : }
9509 : ;
9510 :
9511 :
9512 : AlterDomainStmt:
9513 : ALTER DOMAIN_P any_name alter_column_default
9514 : {
9515 0 : $$ = cat_str(3,mm_strdup("alter domain"),$3,$4);
9516 : }
9517 : | ALTER DOMAIN_P any_name DROP NOT NULL_P
9518 : {
9519 0 : $$ = cat_str(3,mm_strdup("alter domain"),$3,mm_strdup("drop not null"));
9520 : }
9521 : | ALTER DOMAIN_P any_name SET NOT NULL_P
9522 : {
9523 0 : $$ = cat_str(3,mm_strdup("alter domain"),$3,mm_strdup("set not null"));
9524 : }
9525 : | ALTER DOMAIN_P any_name ADD_P TableConstraint
9526 : {
9527 0 : $$ = cat_str(4,mm_strdup("alter domain"),$3,mm_strdup("add"),$5);
9528 : }
9529 : | ALTER DOMAIN_P any_name DROP CONSTRAINT name opt_drop_behavior
9530 : {
9531 0 : $$ = cat_str(5,mm_strdup("alter domain"),$3,mm_strdup("drop constraint"),$6,$7);
9532 : }
9533 : | ALTER DOMAIN_P any_name DROP CONSTRAINT IF_P EXISTS name opt_drop_behavior
9534 : {
9535 0 : $$ = cat_str(5,mm_strdup("alter domain"),$3,mm_strdup("drop constraint if exists"),$8,$9);
9536 : }
9537 : | ALTER DOMAIN_P any_name VALIDATE CONSTRAINT name
9538 : {
9539 0 : $$ = cat_str(4,mm_strdup("alter domain"),$3,mm_strdup("validate constraint"),$6);
9540 : }
9541 : ;
9542 :
9543 :
9544 : opt_as:
9545 : AS
9546 : {
9547 0 : $$ = mm_strdup("as");
9548 : }
9549 : |
9550 : {
9551 2 : $$=EMPTY; }
9552 : ;
9553 :
9554 :
9555 : AlterTSDictionaryStmt:
9556 : ALTER TEXT_P SEARCH DICTIONARY any_name definition
9557 : {
9558 0 : $$ = cat_str(3,mm_strdup("alter text search dictionary"),$5,$6);
9559 : }
9560 : ;
9561 :
9562 :
9563 : AlterTSConfigurationStmt:
9564 : ALTER TEXT_P SEARCH CONFIGURATION any_name ADD_P MAPPING FOR name_list any_with any_name_list
9565 : {
9566 0 : $$ = cat_str(6,mm_strdup("alter text search configuration"),$5,mm_strdup("add mapping for"),$9,$10,$11);
9567 : }
9568 : | ALTER TEXT_P SEARCH CONFIGURATION any_name ALTER MAPPING FOR name_list any_with any_name_list
9569 : {
9570 0 : $$ = cat_str(6,mm_strdup("alter text search configuration"),$5,mm_strdup("alter mapping for"),$9,$10,$11);
9571 : }
9572 : | ALTER TEXT_P SEARCH CONFIGURATION any_name ALTER MAPPING REPLACE any_name any_with any_name
9573 : {
9574 0 : $$ = cat_str(6,mm_strdup("alter text search configuration"),$5,mm_strdup("alter mapping replace"),$9,$10,$11);
9575 : }
9576 : | ALTER TEXT_P SEARCH CONFIGURATION any_name ALTER MAPPING FOR name_list REPLACE any_name any_with any_name
9577 : {
9578 0 : $$ = cat_str(8,mm_strdup("alter text search configuration"),$5,mm_strdup("alter mapping for"),$9,mm_strdup("replace"),$11,$12,$13);
9579 : }
9580 : | ALTER TEXT_P SEARCH CONFIGURATION any_name DROP MAPPING FOR name_list
9581 : {
9582 0 : $$ = cat_str(4,mm_strdup("alter text search configuration"),$5,mm_strdup("drop mapping for"),$9);
9583 : }
9584 : | ALTER TEXT_P SEARCH CONFIGURATION any_name DROP MAPPING IF_P EXISTS FOR name_list
9585 : {
9586 0 : $$ = cat_str(4,mm_strdup("alter text search configuration"),$5,mm_strdup("drop mapping if exists for"),$11);
9587 : }
9588 : ;
9589 :
9590 :
9591 : any_with:
9592 : WITH
9593 : {
9594 0 : $$ = mm_strdup("with");
9595 : }
9596 : | WITH_LA
9597 : {
9598 0 : $$ = mm_strdup("with");
9599 : }
9600 : ;
9601 :
9602 :
9603 : CreateConversionStmt:
9604 : CREATE opt_default CONVERSION_P any_name FOR ecpg_sconst TO ecpg_sconst FROM any_name
9605 : {
9606 0 : $$ = cat_str(10,mm_strdup("create"),$2,mm_strdup("conversion"),$4,mm_strdup("for"),$6,mm_strdup("to"),$8,mm_strdup("from"),$10);
9607 : }
9608 : ;
9609 :
9610 :
9611 : ClusterStmt:
9612 : CLUSTER '(' utility_option_list ')' qualified_name cluster_index_specification
9613 : {
9614 0 : $$ = cat_str(5,mm_strdup("cluster ("),$3,mm_strdup(")"),$5,$6);
9615 : }
9616 : | CLUSTER '(' utility_option_list ')'
9617 : {
9618 0 : $$ = cat_str(3,mm_strdup("cluster ("),$3,mm_strdup(")"));
9619 : }
9620 : | CLUSTER opt_verbose qualified_name cluster_index_specification
9621 : {
9622 0 : $$ = cat_str(4,mm_strdup("cluster"),$2,$3,$4);
9623 : }
9624 : | CLUSTER opt_verbose
9625 : {
9626 0 : $$ = cat_str(2,mm_strdup("cluster"),$2);
9627 : }
9628 : | CLUSTER opt_verbose name ON qualified_name
9629 : {
9630 0 : $$ = cat_str(5,mm_strdup("cluster"),$2,$3,mm_strdup("on"),$5);
9631 : }
9632 : ;
9633 :
9634 :
9635 : cluster_index_specification:
9636 : USING name
9637 : {
9638 0 : $$ = cat_str(2,mm_strdup("using"),$2);
9639 : }
9640 : |
9641 : {
9642 0 : $$=EMPTY; }
9643 : ;
9644 :
9645 :
9646 : VacuumStmt:
9647 : VACUUM opt_full opt_freeze opt_verbose opt_analyze opt_vacuum_relation_list
9648 : {
9649 0 : $$ = cat_str(6,mm_strdup("vacuum"),$2,$3,$4,$5,$6);
9650 : }
9651 : | VACUUM '(' utility_option_list ')' opt_vacuum_relation_list
9652 : {
9653 0 : $$ = cat_str(4,mm_strdup("vacuum ("),$3,mm_strdup(")"),$5);
9654 : }
9655 : ;
9656 :
9657 :
9658 : AnalyzeStmt:
9659 : analyze_keyword opt_verbose opt_vacuum_relation_list
9660 : {
9661 0 : $$ = cat_str(3,$1,$2,$3);
9662 : }
9663 : | analyze_keyword '(' utility_option_list ')' opt_vacuum_relation_list
9664 : {
9665 0 : $$ = cat_str(5,$1,mm_strdup("("),$3,mm_strdup(")"),$5);
9666 : }
9667 : ;
9668 :
9669 :
9670 : utility_option_list:
9671 : utility_option_elem
9672 : {
9673 0 : $$ = $1;
9674 : }
9675 : | utility_option_list ',' utility_option_elem
9676 : {
9677 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
9678 : }
9679 : ;
9680 :
9681 :
9682 : analyze_keyword:
9683 : ANALYZE
9684 : {
9685 0 : $$ = mm_strdup("analyze");
9686 : }
9687 : | ANALYSE
9688 : {
9689 0 : $$ = mm_strdup("analyse");
9690 : }
9691 : ;
9692 :
9693 :
9694 : utility_option_elem:
9695 : utility_option_name utility_option_arg
9696 : {
9697 0 : $$ = cat_str(2,$1,$2);
9698 : }
9699 : ;
9700 :
9701 :
9702 : utility_option_name:
9703 : NonReservedWord
9704 : {
9705 0 : $$ = $1;
9706 : }
9707 : | analyze_keyword
9708 : {
9709 0 : $$ = $1;
9710 : }
9711 : | FORMAT_LA
9712 : {
9713 0 : $$ = mm_strdup("format");
9714 : }
9715 : ;
9716 :
9717 :
9718 : utility_option_arg:
9719 : opt_boolean_or_string
9720 : {
9721 0 : $$ = $1;
9722 : }
9723 : | NumericOnly
9724 : {
9725 0 : $$ = $1;
9726 : }
9727 : |
9728 : {
9729 0 : $$=EMPTY; }
9730 : ;
9731 :
9732 :
9733 : opt_analyze:
9734 : analyze_keyword
9735 : {
9736 0 : $$ = $1;
9737 : }
9738 : |
9739 : {
9740 0 : $$=EMPTY; }
9741 : ;
9742 :
9743 :
9744 : opt_verbose:
9745 : VERBOSE
9746 : {
9747 0 : $$ = mm_strdup("verbose");
9748 : }
9749 : |
9750 : {
9751 0 : $$=EMPTY; }
9752 : ;
9753 :
9754 :
9755 : opt_full:
9756 : FULL
9757 : {
9758 0 : $$ = mm_strdup("full");
9759 : }
9760 : |
9761 : {
9762 0 : $$=EMPTY; }
9763 : ;
9764 :
9765 :
9766 : opt_freeze:
9767 : FREEZE
9768 : {
9769 0 : $$ = mm_strdup("freeze");
9770 : }
9771 : |
9772 : {
9773 0 : $$=EMPTY; }
9774 : ;
9775 :
9776 :
9777 : opt_name_list:
9778 : '(' name_list ')'
9779 : {
9780 2 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
9781 : }
9782 : |
9783 : {
9784 0 : $$=EMPTY; }
9785 : ;
9786 :
9787 :
9788 : vacuum_relation:
9789 : qualified_name opt_name_list
9790 : {
9791 0 : $$ = cat_str(2,$1,$2);
9792 : }
9793 : ;
9794 :
9795 :
9796 : vacuum_relation_list:
9797 : vacuum_relation
9798 : {
9799 0 : $$ = $1;
9800 : }
9801 : | vacuum_relation_list ',' vacuum_relation
9802 : {
9803 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
9804 : }
9805 : ;
9806 :
9807 :
9808 : opt_vacuum_relation_list:
9809 : vacuum_relation_list
9810 : {
9811 0 : $$ = $1;
9812 : }
9813 : |
9814 : {
9815 0 : $$=EMPTY; }
9816 : ;
9817 :
9818 :
9819 : ExplainStmt:
9820 : EXPLAIN ExplainableStmt
9821 : {
9822 0 : $$ = cat_str(2,mm_strdup("explain"),$2);
9823 : }
9824 : | EXPLAIN analyze_keyword opt_verbose ExplainableStmt
9825 : {
9826 0 : $$ = cat_str(4,mm_strdup("explain"),$2,$3,$4);
9827 : }
9828 : | EXPLAIN VERBOSE ExplainableStmt
9829 : {
9830 0 : $$ = cat_str(2,mm_strdup("explain verbose"),$3);
9831 : }
9832 : | EXPLAIN '(' utility_option_list ')' ExplainableStmt
9833 : {
9834 0 : $$ = cat_str(4,mm_strdup("explain ("),$3,mm_strdup(")"),$5);
9835 : }
9836 : ;
9837 :
9838 :
9839 : ExplainableStmt:
9840 : SelectStmt
9841 : {
9842 0 : $$ = $1;
9843 : }
9844 : | InsertStmt
9845 : {
9846 0 : $$ = $1;
9847 : }
9848 : | UpdateStmt
9849 : {
9850 0 : $$ = $1;
9851 : }
9852 : | DeleteStmt
9853 : {
9854 0 : $$ = $1;
9855 : }
9856 : | MergeStmt
9857 : {
9858 0 : $$ = $1;
9859 : }
9860 : | DeclareCursorStmt
9861 : {
9862 0 : $$ = $1;
9863 : }
9864 : | CreateAsStmt
9865 : {
9866 0 : $$ = $1;
9867 : }
9868 : | CreateMatViewStmt
9869 : {
9870 0 : $$ = $1;
9871 : }
9872 : | RefreshMatViewStmt
9873 : {
9874 0 : $$ = $1;
9875 : }
9876 : | ExecuteStmt
9877 : {
9878 0 : $$ = $1.name;
9879 : }
9880 : ;
9881 :
9882 :
9883 : PrepareStmt:
9884 : PREPARE prepared_name prep_type_clause AS PreparableStmt
9885 : {
9886 12 : $$.name = $2;
9887 12 : $$.type = $3;
9888 12 : $$.stmt = $5;
9889 : }
9890 : | PREPARE prepared_name FROM execstring
9891 : {
9892 94 : $$.name = $2;
9893 94 : $$.type = NULL;
9894 94 : $$.stmt = $4;
9895 : }
9896 : ;
9897 :
9898 :
9899 : prep_type_clause:
9900 : '(' type_list ')'
9901 : {
9902 10 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
9903 : }
9904 : |
9905 : {
9906 2 : $$=EMPTY; }
9907 : ;
9908 :
9909 :
9910 : PreparableStmt:
9911 : SelectStmt
9912 : {
9913 2 : $$ = $1;
9914 : }
9915 : | InsertStmt
9916 : {
9917 12 : $$ = $1;
9918 : }
9919 : | UpdateStmt
9920 : {
9921 0 : $$ = $1;
9922 : }
9923 : | DeleteStmt
9924 : {
9925 0 : $$ = $1;
9926 : }
9927 : | MergeStmt
9928 : {
9929 0 : $$ = $1;
9930 : }
9931 : ;
9932 :
9933 :
9934 : ExecuteStmt:
9935 : EXECUTE prepared_name execute_param_clause execute_rest
9936 : {
9937 66 : $$.name = $2;
9938 66 : $$.type = $3;
9939 : }
9940 : | CREATE OptTemp TABLE create_as_target AS EXECUTE prepared_name execute_param_clause opt_with_data execute_rest
9941 : {
9942 0 : $$.name = cat_str(8,mm_strdup("create"),$2,mm_strdup("table"),$4,mm_strdup("as execute"),$7,$8,$9);
9943 : }
9944 : | CREATE OptTemp TABLE IF_P NOT EXISTS create_as_target AS EXECUTE prepared_name execute_param_clause opt_with_data execute_rest
9945 : {
9946 0 : $$.name = cat_str(8,mm_strdup("create"),$2,mm_strdup("table if not exists"),$7,mm_strdup("as execute"),$10,$11,$12);
9947 : }
9948 : ;
9949 :
9950 :
9951 : execute_param_clause:
9952 : '(' expr_list ')'
9953 : {
9954 18 : $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
9955 : }
9956 : |
9957 : {
9958 48 : $$=EMPTY; }
9959 : ;
9960 :
9961 :
9962 : InsertStmt:
9963 : opt_with_clause INSERT INTO insert_target insert_rest opt_on_conflict returning_clause
9964 : {
9965 236 : $$ = cat_str(6,$1,mm_strdup("insert into"),$4,$5,$6,$7);
9966 : }
9967 : ;
9968 :
9969 :
9970 : insert_target:
9971 : qualified_name
9972 : {
9973 236 : $$ = $1;
9974 : }
9975 : | qualified_name AS ColId
9976 : {
9977 0 : $$ = cat_str(3,$1,mm_strdup("as"),$3);
9978 : }
9979 : ;
9980 :
9981 :
9982 : insert_rest:
9983 : SelectStmt
9984 : {
9985 132 : $$ = $1;
9986 : }
9987 : | OVERRIDING override_kind VALUE_P SelectStmt
9988 : {
9989 0 : $$ = cat_str(4,mm_strdup("overriding"),$2,mm_strdup("value"),$4);
9990 : }
9991 : | '(' insert_column_list ')' SelectStmt
9992 : {
9993 104 : $$ = cat_str(4,mm_strdup("("),$2,mm_strdup(")"),$4);
9994 : }
9995 : | '(' insert_column_list ')' OVERRIDING override_kind VALUE_P SelectStmt
9996 : {
9997 0 : $$ = cat_str(6,mm_strdup("("),$2,mm_strdup(") overriding"),$5,mm_strdup("value"),$7);
9998 : }
9999 : | DEFAULT VALUES
10000 : {
10001 0 : $$ = mm_strdup("default values");
10002 : }
10003 : ;
10004 :
10005 :
10006 : override_kind:
10007 : USER
10008 : {
10009 0 : $$ = mm_strdup("user");
10010 : }
10011 : | SYSTEM_P
10012 : {
10013 0 : $$ = mm_strdup("system");
10014 : }
10015 : ;
10016 :
10017 :
10018 : insert_column_list:
10019 : insert_column_item
10020 : {
10021 104 : $$ = $1;
10022 : }
10023 : | insert_column_list ',' insert_column_item
10024 : {
10025 242 : $$ = cat_str(3,$1,mm_strdup(","),$3);
10026 : }
10027 : ;
10028 :
10029 :
10030 : insert_column_item:
10031 : ColId opt_indirection
10032 : {
10033 346 : $$ = cat_str(2,$1,$2);
10034 : }
10035 : ;
10036 :
10037 :
10038 : opt_on_conflict:
10039 : ON CONFLICT opt_conf_expr DO UPDATE SET set_clause_list where_clause
10040 : {
10041 0 : $$ = cat_str(5,mm_strdup("on conflict"),$3,mm_strdup("do update set"),$7,$8);
10042 : }
10043 : | ON CONFLICT opt_conf_expr DO NOTHING
10044 : {
10045 0 : $$ = cat_str(3,mm_strdup("on conflict"),$3,mm_strdup("do nothing"));
10046 : }
10047 : |
10048 : {
10049 236 : $$=EMPTY; }
10050 : ;
10051 :
10052 :
10053 : opt_conf_expr:
10054 : '(' index_params ')' where_clause
10055 : {
10056 0 : $$ = cat_str(4,mm_strdup("("),$2,mm_strdup(")"),$4);
10057 : }
10058 : | ON CONSTRAINT name
10059 : {
10060 0 : $$ = cat_str(2,mm_strdup("on constraint"),$3);
10061 : }
10062 : |
10063 : {
10064 0 : $$=EMPTY; }
10065 : ;
10066 :
10067 :
10068 : returning_clause:
10069 : RETURNING target_list opt_ecpg_into
10070 : {
10071 4 : $$ = cat_str(2,mm_strdup("returning"),$2);
10072 : }
10073 : |
10074 : {
10075 246 : $$=EMPTY; }
10076 : ;
10077 :
10078 :
10079 : DeleteStmt:
10080 : opt_with_clause DELETE_P FROM relation_expr_opt_alias using_clause where_or_current_clause returning_clause
10081 : {
10082 4 : $$ = cat_str(6,$1,mm_strdup("delete from"),$4,$5,$6,$7);
10083 : }
10084 : ;
10085 :
10086 :
10087 : using_clause:
10088 : USING from_list
10089 : {
10090 0 : $$ = cat_str(2,mm_strdup("using"),$2);
10091 : }
10092 : |
10093 : {
10094 4 : $$=EMPTY; }
10095 : ;
10096 :
10097 :
10098 : LockStmt:
10099 : LOCK_P opt_table relation_expr_list opt_lock opt_nowait
10100 : {
10101 0 : $$ = cat_str(5,mm_strdup("lock"),$2,$3,$4,$5);
10102 : }
10103 : ;
10104 :
10105 :
10106 : opt_lock:
10107 : IN_P lock_type MODE
10108 : {
10109 0 : $$ = cat_str(3,mm_strdup("in"),$2,mm_strdup("mode"));
10110 : }
10111 : |
10112 : {
10113 0 : $$=EMPTY; }
10114 : ;
10115 :
10116 :
10117 : lock_type:
10118 : ACCESS SHARE
10119 : {
10120 0 : $$ = mm_strdup("access share");
10121 : }
10122 : | ROW SHARE
10123 : {
10124 0 : $$ = mm_strdup("row share");
10125 : }
10126 : | ROW EXCLUSIVE
10127 : {
10128 0 : $$ = mm_strdup("row exclusive");
10129 : }
10130 : | SHARE UPDATE EXCLUSIVE
10131 : {
10132 0 : $$ = mm_strdup("share update exclusive");
10133 : }
10134 : | SHARE
10135 : {
10136 0 : $$ = mm_strdup("share");
10137 : }
10138 : | SHARE ROW EXCLUSIVE
10139 : {
10140 0 : $$ = mm_strdup("share row exclusive");
10141 : }
10142 : | EXCLUSIVE
10143 : {
10144 0 : $$ = mm_strdup("exclusive");
10145 : }
10146 : | ACCESS EXCLUSIVE
10147 : {
10148 0 : $$ = mm_strdup("access exclusive");
10149 : }
10150 : ;
10151 :
10152 :
10153 : opt_nowait:
10154 : NOWAIT
10155 : {
10156 0 : $$ = mm_strdup("nowait");
10157 : }
10158 : |
10159 : {
10160 0 : $$=EMPTY; }
10161 : ;
10162 :
10163 :
10164 : opt_nowait_or_skip:
10165 : NOWAIT
10166 : {
10167 0 : $$ = mm_strdup("nowait");
10168 : }
10169 : | SKIP LOCKED
10170 : {
10171 0 : $$ = mm_strdup("skip locked");
10172 : }
10173 : |
10174 : {
10175 0 : $$=EMPTY; }
10176 : ;
10177 :
10178 :
10179 : UpdateStmt:
10180 : opt_with_clause UPDATE relation_expr_opt_alias SET set_clause_list from_clause where_or_current_clause returning_clause
10181 : {
10182 10 : $$ = cat_str(8,$1,mm_strdup("update"),$3,mm_strdup("set"),$5,$6,$7,$8);
10183 : }
10184 : ;
10185 :
10186 :
10187 : set_clause_list:
10188 : set_clause
10189 : {
10190 10 : $$ = $1;
10191 : }
10192 : | set_clause_list ',' set_clause
10193 : {
10194 0 : $$ = cat_str(3,$1,mm_strdup(","),$3);
10195 : }
10196 : ;
10197 :
10198 :
10199 : set_clause:
10200 : set_target '=' a_expr
10201 : {
10202 8 : $$ = cat_str(3,$1,mm_strdup("="),$3);
10203 : }
10204 : | '(' set_target_list ')' '=' a_expr
10205 : {
10206 2 : $$ = cat_str(4,mm_strdup("("),$2,mm_strdup(") ="),$5);
10207 : }
10208 : ;
10209 :
10210 :
10211 : set_target:
10212 : ColId opt_indirection
10213 : {
10214 12 : $$ = cat_str(2,$1,$2);
10215 : }
10216 : ;
10217 :
10218 :
10219 : set_target_list:
10220 : set_target
10221 : {
10222 2 : $$ = $1;
10223 : }
10224 : | set_target_list ',' set_target
10225 : {
10226 2 : $$ = cat_str(3,$1,mm_strdup(","),$3);
10227 : }
10228 : ;
10229 :
10230 :
10231 : MergeStmt:
10232 : opt_with_clause MERGE INTO relation_expr_opt_alias USING table_ref ON a_expr merge_when_list
10233 : {
10234 0 : $$ = cat_str(8,$1,mm_strdup("merge into"),$4,mm_strdup("using"),$6,mm_strdup("on"),$8,$9);
10235 : }
10236 : ;
10237 :
10238 :
10239 : merge_when_list:
10240 : merge_when_clause
10241 : {
10242 0 : $$ = $1;
10243 : }
10244 : | merge_when_list merge_when_clause
10245 : {
10246 0 : $$ = cat_str(2,$1,$2);
10247 : }
10248 : ;
10249 :
10250 :
10251 : merge_when_clause:
10252 : WHEN MATCHED opt_merge_when_condition THEN merge_update
10253 : {
10254 0 : $$ = cat_str(4,mm_strdup("when matched"),$3,mm_strdup("then"),$5);
10255 : }
10256 : | WHEN MATCHED opt_merge_when_condition THEN merge_delete
10257 : {
10258 0 : $$ = cat_str(4,mm_strdup("when matched"),$3,mm_strdup("then"),$5);
10259 : }
10260 : | WHEN NOT MATCHED opt_merge_when_condition THEN merge_insert
10261 : {
10262 0 : $$ = cat_str(4,mm_strdup("when not matched"),$4,mm_strdup("then"),$6);
10263 : }
10264 : | WHEN MATCHED opt_merge_when_condition THEN DO NOTHING
10265 : {
10266 0 : $$ = cat_str(3,mm_strdup("when matched"),$3,mm_strdup("then do nothing"));
10267 : }
10268 : | WHEN NOT MATCHED opt_merge_when_condition THEN DO NOTHING
10269 : {
10270 0 : $$ = cat_str(3,mm_strdup("when not matched"),$4,mm_strdup("then do nothing"));
10271 : }
10272 : ;
10273 :
10274 :
10275 : opt_merge_when_condition:
10276 : AND a_expr
10277 : {
10278 0 : $$ = cat_str(2,mm_strdup("and"),$2);
10279 : }
10280 : |
10281 : {
10282 0 : $$=EMPTY; }
10283 : ;
10284 :
10285 :
10286 : merge_update:
10287 : UPDATE SET set_clause_list
10288 : {
10289 0 : $$ = cat_str(2,mm_strdup("update set"),$3);
10290 : }
10291 : ;
10292 :
10293 :
10294 : merge_delete:
10295 : DELETE_P
10296 : {
10297 0 : $$ = mm_strdup("delete");
10298 : }
10299 : ;
10300 :
10301 :
10302 : merge_insert:
10303 : INSERT merge_values_clause
10304 : {
10305 0 : $$ = cat_str(2,mm_strdup("insert"),$2);
10306 : }
10307 : | INSERT OVERRIDING override_kind VALUE_P merge_values_clause
10308 : {
10309 0 : $$ = cat_str(4,mm_strdup("insert overriding"),$3,mm_strdup("value"),$5);
10310 : }
10311 : | INSERT '(' insert_column_list ')' merge_values_clause
10312 : {
10313 0 : $$ = cat_str(4,mm_strdup("insert ("),$3,mm_strdup(")"),$5);
10314 : }
10315 : | INSERT '(' insert_column_list ')' OVERRIDING override_kind VALUE_P merge_values_clause
10316 : {
10317 0 : $$ = cat_str(6,mm_strdup("insert ("),$3,mm_strdup(") overriding"),$6,mm_strdup("value"),$8);
10318 : }
10319 : | INSERT DEFAULT VALUES
10320 : {
10321 0 : $$ = mm_strdup("insert default values");
10322 : }
10323 : ;
10324 :
10325 :
10326 : merge_values_clause:
10327 : VALUES '(' expr_list ')'
10328 : {
10329 0 : $$ = cat_str(3,mm_strdup("values ("),$3,mm_strdup(")"));
10330 : }
10331 : ;
10332 :
10333 :
10334 : DeclareCursorStmt:
10335 : DECLARE cursor_name cursor_options CURSOR opt_hold FOR SelectStmt
10336 : {
10337 : struct cursor *ptr, *this;
10338 34 : char *cursor_marker = $2[0] == ':' ? mm_strdup("$0") : mm_strdup($2);
10339 : char *comment, *c1, *c2;
10340 34 : int (* strcmp_fn)(const char *, const char *) = (($2[0] == ':' || $2[0] == '"') ? strcmp : pg_strcasecmp);
10341 :
10342 34 : if (INFORMIX_MODE && pg_strcasecmp($2, "database") == 0)
10343 0 : mmfatal(PARSE_ERROR, "\"database\" cannot be used as cursor name in INFORMIX mode");
10344 :
10345 46 : for (ptr = cur; ptr != NULL; ptr = ptr->next)
10346 : {
10347 12 : if (strcmp_fn($2, ptr->name) == 0)
10348 : {
10349 0 : if ($2[0] == ':')
10350 0 : mmerror(PARSE_ERROR, ET_ERROR, "using variable \"%s\" in different declare statements is not supported", $2+1);
10351 : else
10352 0 : mmerror(PARSE_ERROR, ET_ERROR, "cursor \"%s\" is already defined", $2);
10353 : }
10354 : }
10355 :
10356 34 : this = (struct cursor *) mm_alloc(sizeof(struct cursor));
10357 :
10358 34 : this->next = cur;
10359 34 : this->name = $2;
10360 34 : this->function = (current_function ? mm_strdup(current_function) : NULL);
10361 34 : this->connection = connection ? mm_strdup(connection) : NULL;
10362 34 : this->opened = false;
10363 |