LCOV - code coverage report
Current view: top level - src/interfaces/ecpg/preproc - preproc.y (source / functions) Hit Total Coverage
Test: PostgreSQL 17devel Lines: 1465 4923 29.8 %
Date: 2024-03-28 11:11:48 Functions: 10 15 66.7 %
Legend: Lines: hit not hit

          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       23136 : cat2_str(char *str1, char *str2)
     140             : {
     141       23136 :     char * res_str  = (char *)mm_alloc(strlen(str1) + strlen(str2) + 2);
     142             : 
     143       23136 :     strcpy(res_str, str1);
     144       23136 :     if (strlen(str1) != 0 && strlen(str2) != 0)
     145       13904 :         strcat(res_str, " ");
     146       23136 :     strcat(res_str, str2);
     147       23136 :     free(str1);
     148       23136 :     free(str2);
     149       23136 :     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       29006 :     for (i = 1; i < count; i++)
     165       21574 :         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        3526 : make3_str(char *str1, char *str2, char *str3)
     186             : {
     187        3526 :     char * res_str  = (char *)mm_alloc(strlen(str1) + strlen(str2) +strlen(str3) + 1);
     188             : 
     189        3526 :     strcpy(res_str, str1);
     190        3526 :     strcat(res_str, str2);
     191        3526 :     strcat(res_str, str3);
     192        3526 :     free(str1);
     193        3526 :     free(str2);
     194        3526 :     free(str3);
     195        3526 :     return res_str;
     196             : }
     197             : 
     198             : /* and the rest */
     199             : static char *
     200        4656 : make_name(void)
     201             : {
     202        4656 :     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> set_statistics_value
     719             : %type <str> set_access_method_name
     720             : %type <str> PartitionBoundSpec
     721             : %type <str> hash_partbound_elem
     722             : %type <str> hash_partbound
     723             : %type <str> AlterCompositeTypeStmt
     724             : %type <str> alter_type_cmds
     725             : %type <str> alter_type_cmd
     726             : %type <str> ClosePortalStmt
     727             : %type <str> CopyStmt
     728             : %type <str> copy_from
     729             : %type <str> opt_program
     730             : %type <str> copy_file_name
     731             : %type <str> copy_options
     732             : %type <str> copy_opt_list
     733             : %type <str> copy_opt_item
     734             : %type <str> opt_binary
     735             : %type <str> copy_delimiter
     736             : %type <str> opt_using
     737             : %type <str> copy_generic_opt_list
     738             : %type <str> copy_generic_opt_elem
     739             : %type <str> copy_generic_opt_arg
     740             : %type <str> copy_generic_opt_arg_list
     741             : %type <str> copy_generic_opt_arg_list_item
     742             : %type <str> CreateStmt
     743             : %type <str> OptTemp
     744             : %type <str> OptTableElementList
     745             : %type <str> OptTypedTableElementList
     746             : %type <str> TableElementList
     747             : %type <str> TypedTableElementList
     748             : %type <str> TableElement
     749             : %type <str> TypedTableElement
     750             : %type <str> columnDef
     751             : %type <str> columnOptions
     752             : %type <str> column_compression
     753             : %type <str> opt_column_compression
     754             : %type <str> column_storage
     755             : %type <str> opt_column_storage
     756             : %type <str> ColQualList
     757             : %type <str> ColConstraint
     758             : %type <str> ColConstraintElem
     759             : %type <str> opt_unique_null_treatment
     760             : %type <str> generated_when
     761             : %type <str> ConstraintAttr
     762             : %type <str> TableLikeClause
     763             : %type <str> TableLikeOptionList
     764             : %type <str> TableLikeOption
     765             : %type <str> TableConstraint
     766             : %type <str> ConstraintElem
     767             : %type <str> opt_no_inherit
     768             : %type <str> opt_without_overlaps
     769             : %type <str> opt_column_list
     770             : %type <str> columnList
     771             : %type <str> optionalPeriodName
     772             : %type <str> opt_column_and_period_list
     773             : %type <str> columnElem
     774             : %type <str> opt_c_include
     775             : %type <str> key_match
     776             : %type <str> ExclusionConstraintList
     777             : %type <str> ExclusionConstraintElem
     778             : %type <str> OptWhereClause
     779             : %type <str> key_actions
     780             : %type <str> key_update
     781             : %type <str> key_delete
     782             : %type <str> key_action
     783             : %type <str> OptInherit
     784             : %type <str> OptPartitionSpec
     785             : %type <str> PartitionSpec
     786             : %type <str> part_params
     787             : %type <str> part_elem
     788             : %type <str> table_access_method_clause
     789             : %type <str> OptWith
     790             : %type <str> OnCommitOption
     791             : %type <str> OptTableSpace
     792             : %type <str> OptConsTableSpace
     793             : %type <str> ExistingIndex
     794             : %type <str> CreateStatsStmt
     795             : %type <str> stats_params
     796             : %type <str> stats_param
     797             : %type <str> AlterStatsStmt
     798             : %type <str> create_as_target
     799             : %type <str> opt_with_data
     800             : %type <str> CreateMatViewStmt
     801             : %type <str> create_mv_target
     802             : %type <str> OptNoLog
     803             : %type <str> RefreshMatViewStmt
     804             : %type <str> CreateSeqStmt
     805             : %type <str> AlterSeqStmt
     806             : %type <str> OptSeqOptList
     807             : %type <str> OptParenthesizedSeqOptList
     808             : %type <str> SeqOptList
     809             : %type <str> SeqOptElem
     810             : %type <str> opt_by
     811             : %type <str> NumericOnly
     812             : %type <str> NumericOnly_list
     813             : %type <str> CreatePLangStmt
     814             : %type <str> opt_trusted
     815             : %type <str> handler_name
     816             : %type <str> opt_inline_handler
     817             : %type <str> validator_clause
     818             : %type <str> opt_validator
     819             : %type <str> opt_procedural
     820             : %type <str> CreateTableSpaceStmt
     821             : %type <str> OptTableSpaceOwner
     822             : %type <str> DropTableSpaceStmt
     823             : %type <str> CreateExtensionStmt
     824             : %type <str> create_extension_opt_list
     825             : %type <str> create_extension_opt_item
     826             : %type <str> AlterExtensionStmt
     827             : %type <str> alter_extension_opt_list
     828             : %type <str> alter_extension_opt_item
     829             : %type <str> AlterExtensionContentsStmt
     830             : %type <str> CreateFdwStmt
     831             : %type <str> fdw_option
     832             : %type <str> fdw_options
     833             : %type <str> opt_fdw_options
     834             : %type <str> AlterFdwStmt
     835             : %type <str> create_generic_options
     836             : %type <str> generic_option_list
     837             : %type <str> alter_generic_options
     838             : %type <str> alter_generic_option_list
     839             : %type <str> alter_generic_option_elem
     840             : %type <str> generic_option_elem
     841             : %type <str> generic_option_name
     842             : %type <str> generic_option_arg
     843             : %type <str> CreateForeignServerStmt
     844             : %type <str> opt_type
     845             : %type <str> foreign_server_version
     846             : %type <str> opt_foreign_server_version
     847             : %type <str> AlterForeignServerStmt
     848             : %type <str> CreateForeignTableStmt
     849             : %type <str> ImportForeignSchemaStmt
     850             : %type <str> import_qualification_type
     851             : %type <str> import_qualification
     852             : %type <str> CreateUserMappingStmt
     853             : %type <str> auth_ident
     854             : %type <str> DropUserMappingStmt
     855             : %type <str> AlterUserMappingStmt
     856             : %type <str> CreatePolicyStmt
     857             : %type <str> AlterPolicyStmt
     858             : %type <str> RowSecurityOptionalExpr
     859             : %type <str> RowSecurityOptionalWithCheck
     860             : %type <str> RowSecurityDefaultToRole
     861             : %type <str> RowSecurityOptionalToRole
     862             : %type <str> RowSecurityDefaultPermissive
     863             : %type <str> RowSecurityDefaultForCmd
     864             : %type <str> row_security_cmd
     865             : %type <str> CreateAmStmt
     866             : %type <str> am_type
     867             : %type <str> CreateTrigStmt
     868             : %type <str> TriggerActionTime
     869             : %type <str> TriggerEvents
     870             : %type <str> TriggerOneEvent
     871             : %type <str> TriggerReferencing
     872             : %type <str> TriggerTransitions
     873             : %type <str> TriggerTransition
     874             : %type <str> TransitionOldOrNew
     875             : %type <str> TransitionRowOrTable
     876             : %type <str> TransitionRelName
     877             : %type <str> TriggerForSpec
     878             : %type <str> TriggerForOptEach
     879             : %type <str> TriggerForType
     880             : %type <str> TriggerWhen
     881             : %type <str> FUNCTION_or_PROCEDURE
     882             : %type <str> TriggerFuncArgs
     883             : %type <str> TriggerFuncArg
     884             : %type <str> OptConstrFromTable
     885             : %type <str> ConstraintAttributeSpec
     886             : %type <str> ConstraintAttributeElem
     887             : %type <str> CreateEventTrigStmt
     888             : %type <str> event_trigger_when_list
     889             : %type <str> event_trigger_when_item
     890             : %type <str> event_trigger_value_list
     891             : %type <str> AlterEventTrigStmt
     892             : %type <str> enable_trigger
     893             : %type <str> CreateAssertionStmt
     894             : %type <str> DefineStmt
     895             : %type <str> definition
     896             : %type <str> def_list
     897             : %type <str> def_elem
     898             : %type <str> def_arg
     899             : %type <str> old_aggr_definition
     900             : %type <str> old_aggr_list
     901             : %type <str> old_aggr_elem
     902             : %type <str> opt_enum_val_list
     903             : %type <str> enum_val_list
     904             : %type <str> AlterEnumStmt
     905             : %type <str> opt_if_not_exists
     906             : %type <str> CreateOpClassStmt
     907             : %type <str> opclass_item_list
     908             : %type <str> opclass_item
     909             : %type <str> opt_default
     910             : %type <str> opt_opfamily
     911             : %type <str> opclass_purpose
     912             : %type <str> opt_recheck
     913             : %type <str> CreateOpFamilyStmt
     914             : %type <str> AlterOpFamilyStmt
     915             : %type <str> opclass_drop_list
     916             : %type <str> opclass_drop
     917             : %type <str> DropOpClassStmt
     918             : %type <str> DropOpFamilyStmt
     919             : %type <str> DropOwnedStmt
     920             : %type <str> ReassignOwnedStmt
     921             : %type <str> DropStmt
     922             : %type <str> object_type_any_name
     923             : %type <str> object_type_name
     924             : %type <str> drop_type_name
     925             : %type <str> object_type_name_on_any_name
     926             : %type <str> any_name_list
     927             : %type <str> any_name
     928             : %type <str> attrs
     929             : %type <str> type_name_list
     930             : %type <str> TruncateStmt
     931             : %type <str> opt_restart_seqs
     932             : %type <str> CommentStmt
     933             : %type <str> comment_text
     934             : %type <str> SecLabelStmt
     935             : %type <str> opt_provider
     936             : %type <str> security_label
     937             : %type <str> FetchStmt
     938             : %type <str> fetch_args
     939             : %type <str> from_in
     940             : %type <str> opt_from_in
     941             : %type <str> GrantStmt
     942             : %type <str> RevokeStmt
     943             : %type <str> privileges
     944             : %type <str> privilege_list
     945             : %type <str> privilege
     946             : %type <str> parameter_name_list
     947             : %type <str> parameter_name
     948             : %type <str> privilege_target
     949             : %type <str> grantee_list
     950             : %type <str> grantee
     951             : %type <str> opt_grant_grant_option
     952             : %type <str> GrantRoleStmt
     953             : %type <str> RevokeRoleStmt
     954             : %type <str> grant_role_opt_list
     955             : %type <str> grant_role_opt
     956             : %type <str> grant_role_opt_value
     957             : %type <str> opt_granted_by
     958             : %type <str> AlterDefaultPrivilegesStmt
     959             : %type <str> DefACLOptionList
     960             : %type <str> DefACLOption
     961             : %type <str> DefACLAction
     962             : %type <str> defacl_privilege_target
     963             : %type <str> IndexStmt
     964             : %type <str> opt_unique
     965             : %type <str> access_method_clause
     966             : %type <str> index_params
     967             : %type <str> index_elem_options
     968             : %type <str> index_elem
     969             : %type <str> opt_include
     970             : %type <str> index_including_params
     971             : %type <str> opt_collate
     972             : %type <str> opt_asc_desc
     973             : %type <str> opt_nulls_order
     974             : %type <str> CreateFunctionStmt
     975             : %type <str> opt_or_replace
     976             : %type <str> func_args
     977             : %type <str> func_args_list
     978             : %type <str> function_with_argtypes_list
     979             : %type <str> function_with_argtypes
     980             : %type <str> func_args_with_defaults
     981             : %type <str> func_args_with_defaults_list
     982             : %type <str> func_arg
     983             : %type <str> arg_class
     984             : %type <str> param_name
     985             : %type <str> func_return
     986             : %type <str> func_type
     987             : %type <str> func_arg_with_default
     988             : %type <str> aggr_arg
     989             : %type <str> aggr_args
     990             : %type <str> aggr_args_list
     991             : %type <str> aggregate_with_argtypes
     992             : %type <str> aggregate_with_argtypes_list
     993             : %type <str> opt_createfunc_opt_list
     994             : %type <str> createfunc_opt_list
     995             : %type <str> common_func_opt_item
     996             : %type <str> createfunc_opt_item
     997             : %type <str> func_as
     998             : %type <str> ReturnStmt
     999             : %type <str> opt_routine_body
    1000             : %type <str> routine_body_stmt_list
    1001             : %type <str> routine_body_stmt
    1002             : %type <str> transform_type_list
    1003             : %type <str> opt_definition
    1004             : %type <str> table_func_column
    1005             : %type <str> table_func_column_list
    1006             : %type <str> AlterFunctionStmt
    1007             : %type <str> alterfunc_opt_list
    1008             : %type <str> opt_restrict
    1009             : %type <str> RemoveFuncStmt
    1010             : %type <str> RemoveAggrStmt
    1011             : %type <str> RemoveOperStmt
    1012             : %type <str> oper_argtypes
    1013             : %type <str> any_operator
    1014             : %type <str> operator_with_argtypes_list
    1015             : %type <str> operator_with_argtypes
    1016             : %type <str> DoStmt
    1017             : %type <str> dostmt_opt_list
    1018             : %type <str> dostmt_opt_item
    1019             : %type <str> CreateCastStmt
    1020             : %type <str> cast_context
    1021             : %type <str> DropCastStmt
    1022             : %type <str> opt_if_exists
    1023             : %type <str> CreateTransformStmt
    1024             : %type <str> transform_element_list
    1025             : %type <str> DropTransformStmt
    1026             : %type <str> ReindexStmt
    1027             : %type <str> reindex_target_relation
    1028             : %type <str> reindex_target_all
    1029             : %type <str> opt_reindex_option_list
    1030             : %type <str> AlterTblSpcStmt
    1031             : %type <str> RenameStmt
    1032             : %type <str> opt_column
    1033             : %type <str> opt_set_data
    1034             : %type <str> AlterObjectDependsStmt
    1035             : %type <str> opt_no
    1036             : %type <str> AlterObjectSchemaStmt
    1037             : %type <str> AlterOperatorStmt
    1038             : %type <str> operator_def_list
    1039             : %type <str> operator_def_elem
    1040             : %type <str> operator_def_arg
    1041             : %type <str> AlterTypeStmt
    1042             : %type <str> AlterOwnerStmt
    1043             : %type <str> CreatePublicationStmt
    1044             : %type <str> PublicationObjSpec
    1045             : %type <str> pub_obj_list
    1046             : %type <str> AlterPublicationStmt
    1047             : %type <str> CreateSubscriptionStmt
    1048             : %type <str> AlterSubscriptionStmt
    1049             : %type <str> DropSubscriptionStmt
    1050             : %type <str> RuleStmt
    1051             : %type <str> RuleActionList
    1052             : %type <str> RuleActionMulti
    1053             : %type <str> RuleActionStmt
    1054             : %type <str> RuleActionStmtOrEmpty
    1055             : %type <str> event
    1056             : %type <str> opt_instead
    1057             : %type <str> NotifyStmt
    1058             : %type <str> notify_payload
    1059             : %type <str> ListenStmt
    1060             : %type <str> UnlistenStmt
    1061             : %type <str> TransactionStmt
    1062             : %type <str> TransactionStmtLegacy
    1063             : %type <str> opt_transaction
    1064             : %type <str> transaction_mode_item
    1065             : %type <str> transaction_mode_list
    1066             : %type <str> transaction_mode_list_or_empty
    1067             : %type <str> opt_transaction_chain
    1068             : %type <str> ViewStmt
    1069             : %type <str> opt_check_option
    1070             : %type <str> LoadStmt
    1071             : %type <str> CreatedbStmt
    1072             : %type <str> createdb_opt_list
    1073             : %type <str> createdb_opt_items
    1074             : %type <str> createdb_opt_item
    1075             : %type <str> createdb_opt_name
    1076             : %type <str> opt_equal
    1077             : %type <str> AlterDatabaseStmt
    1078             : %type <str> AlterDatabaseSetStmt
    1079             : %type <str> DropdbStmt
    1080             : %type <str> drop_option_list
    1081             : %type <str> drop_option
    1082             : %type <str> AlterCollationStmt
    1083             : %type <str> AlterSystemStmt
    1084             : %type <str> CreateDomainStmt
    1085             : %type <str> AlterDomainStmt
    1086             : %type <str> opt_as
    1087             : %type <str> AlterTSDictionaryStmt
    1088             : %type <str> AlterTSConfigurationStmt
    1089             : %type <str> any_with
    1090             : %type <str> CreateConversionStmt
    1091             : %type <str> ClusterStmt
    1092             : %type <str> cluster_index_specification
    1093             : %type <str> VacuumStmt
    1094             : %type <str> AnalyzeStmt
    1095             : %type <str> utility_option_list
    1096             : %type <str> analyze_keyword
    1097             : %type <str> utility_option_elem
    1098             : %type <str> utility_option_name
    1099             : %type <str> utility_option_arg
    1100             : %type <str> opt_analyze
    1101             : %type <str> opt_verbose
    1102             : %type <str> opt_full
    1103             : %type <str> opt_freeze
    1104             : %type <str> opt_name_list
    1105             : %type <str> vacuum_relation
    1106             : %type <str> vacuum_relation_list
    1107             : %type <str> opt_vacuum_relation_list
    1108             : %type <str> ExplainStmt
    1109             : %type <str> ExplainableStmt
    1110             : %type <prep> PrepareStmt
    1111             : %type <str> prep_type_clause
    1112             : %type <str> PreparableStmt
    1113             : %type <exec> ExecuteStmt
    1114             : %type <str> execute_param_clause
    1115             : %type <str> InsertStmt
    1116             : %type <str> insert_target
    1117             : %type <str> insert_rest
    1118             : %type <str> override_kind
    1119             : %type <str> insert_column_list
    1120             : %type <str> insert_column_item
    1121             : %type <str> opt_on_conflict
    1122             : %type <str> opt_conf_expr
    1123             : %type <str> returning_clause
    1124             : %type <str> DeleteStmt
    1125             : %type <str> using_clause
    1126             : %type <str> LockStmt
    1127             : %type <str> opt_lock
    1128             : %type <str> lock_type
    1129             : %type <str> opt_nowait
    1130             : %type <str> opt_nowait_or_skip
    1131             : %type <str> UpdateStmt
    1132             : %type <str> set_clause_list
    1133             : %type <str> set_clause
    1134             : %type <str> set_target
    1135             : %type <str> set_target_list
    1136             : %type <str> MergeStmt
    1137             : %type <str> merge_when_list
    1138             : %type <str> merge_when_clause
    1139             : %type <str> opt_merge_when_condition
    1140             : %type <str> merge_update
    1141             : %type <str> merge_delete
    1142             : %type <str> merge_insert
    1143             : %type <str> merge_values_clause
    1144             : %type <str> DeclareCursorStmt
    1145             : %type <str> cursor_name
    1146             : %type <str> cursor_options
    1147             : %type <str> opt_hold
    1148             : %type <str> SelectStmt
    1149             : %type <str> select_with_parens
    1150             : %type <str> select_no_parens
    1151             : %type <str> select_clause
    1152             : %type <str> simple_select
    1153             : %type <str> with_clause
    1154             : %type <str> cte_list
    1155             : %type <str> common_table_expr
    1156             : %type <str> opt_materialized
    1157             : %type <str> opt_search_clause
    1158             : %type <str> opt_cycle_clause
    1159             : %type <str> opt_with_clause
    1160             : %type <str> into_clause
    1161             : %type <str> OptTempTableName
    1162             : %type <str> opt_table
    1163             : %type <str> set_quantifier
    1164             : %type <str> distinct_clause
    1165             : %type <str> opt_all_clause
    1166             : %type <str> opt_sort_clause
    1167             : %type <str> sort_clause
    1168             : %type <str> sortby_list
    1169             : %type <str> sortby
    1170             : %type <str> select_limit
    1171             : %type <str> opt_select_limit
    1172             : %type <str> limit_clause
    1173             : %type <str> offset_clause
    1174             : %type <str> select_limit_value
    1175             : %type <str> select_offset_value
    1176             : %type <str> select_fetch_first_value
    1177             : %type <str> I_or_F_const
    1178             : %type <str> row_or_rows
    1179             : %type <str> first_or_next
    1180             : %type <str> group_clause
    1181             : %type <str> group_by_list
    1182             : %type <str> group_by_item
    1183             : %type <str> empty_grouping_set
    1184             : %type <str> rollup_clause
    1185             : %type <str> cube_clause
    1186             : %type <str> grouping_sets_clause
    1187             : %type <str> having_clause
    1188             : %type <str> for_locking_clause
    1189             : %type <str> opt_for_locking_clause
    1190             : %type <str> for_locking_items
    1191             : %type <str> for_locking_item
    1192             : %type <str> for_locking_strength
    1193             : %type <str> locked_rels_list
    1194             : %type <str> values_clause
    1195             : %type <str> from_clause
    1196             : %type <str> from_list
    1197             : %type <str> table_ref
    1198             : %type <str> joined_table
    1199             : %type <str> alias_clause
    1200             : %type <str> opt_alias_clause
    1201             : %type <str> opt_alias_clause_for_join_using
    1202             : %type <str> func_alias_clause
    1203             : %type <str> join_type
    1204             : %type <str> opt_outer
    1205             : %type <str> join_qual
    1206             : %type <str> relation_expr
    1207             : %type <str> extended_relation_expr
    1208             : %type <str> relation_expr_list
    1209             : %type <str> relation_expr_opt_alias
    1210             : %type <str> tablesample_clause
    1211             : %type <str> opt_repeatable_clause
    1212             : %type <str> func_table
    1213             : %type <str> rowsfrom_item
    1214             : %type <str> rowsfrom_list
    1215             : %type <str> opt_col_def_list
    1216             : %type <str> opt_ordinality
    1217             : %type <str> where_clause
    1218             : %type <str> where_or_current_clause
    1219             : %type <str> OptTableFuncElementList
    1220             : %type <str> TableFuncElementList
    1221             : %type <str> TableFuncElement
    1222             : %type <str> xmltable
    1223             : %type <str> xmltable_column_list
    1224             : %type <str> xmltable_column_el
    1225             : %type <str> xmltable_column_option_list
    1226             : %type <str> xmltable_column_option_el
    1227             : %type <str> xml_namespace_list
    1228             : %type <str> xml_namespace_el
    1229             : %type <str> Typename
    1230             : %type <index> opt_array_bounds
    1231             : %type <str> SimpleTypename
    1232             : %type <str> ConstTypename
    1233             : %type <str> GenericType
    1234             : %type <str> opt_type_modifiers
    1235             : %type <str> Numeric
    1236             : %type <str> opt_float
    1237             : %type <str> Bit
    1238             : %type <str> ConstBit
    1239             : %type <str> BitWithLength
    1240             : %type <str> BitWithoutLength
    1241             : %type <str> Character
    1242             : %type <str> ConstCharacter
    1243             : %type <str> CharacterWithLength
    1244             : %type <str> CharacterWithoutLength
    1245             : %type <str> character
    1246             : %type <str> opt_varying
    1247             : %type <str> ConstDatetime
    1248             : %type <str> ConstInterval
    1249             : %type <str> opt_timezone
    1250             : %type <str> opt_interval
    1251             : %type <str> interval_second
    1252             : %type <str> JsonType
    1253             : %type <str> a_expr
    1254             : %type <str> b_expr
    1255             : %type <str> c_expr
    1256             : %type <str> func_application
    1257             : %type <str> func_expr
    1258             : %type <str> func_expr_windowless
    1259             : %type <str> func_expr_common_subexpr
    1260             : %type <str> xml_root_version
    1261             : %type <str> opt_xml_root_standalone
    1262             : %type <str> xml_attributes
    1263             : %type <str> xml_attribute_list
    1264             : %type <str> xml_attribute_el
    1265             : %type <str> document_or_content
    1266             : %type <str> xml_indent_option
    1267             : %type <str> xml_whitespace_option
    1268             : %type <str> xmlexists_argument
    1269             : %type <str> xml_passing_mech
    1270             : %type <str> within_group_clause
    1271             : %type <str> filter_clause
    1272             : %type <str> window_clause
    1273             : %type <str> window_definition_list
    1274             : %type <str> window_definition
    1275             : %type <str> over_clause
    1276             : %type <str> window_specification
    1277             : %type <str> opt_existing_window_name
    1278             : %type <str> opt_partition_clause
    1279             : %type <str> opt_frame_clause
    1280             : %type <str> frame_extent
    1281             : %type <str> frame_bound
    1282             : %type <str> opt_window_exclusion_clause
    1283             : %type <str> row
    1284             : %type <str> explicit_row
    1285             : %type <str> implicit_row
    1286             : %type <str> sub_type
    1287             : %type <str> all_Op
    1288             : %type <str> MathOp
    1289             : %type <str> qual_Op
    1290             : %type <str> qual_all_Op
    1291             : %type <str> subquery_Op
    1292             : %type <str> expr_list
    1293             : %type <str> func_arg_list
    1294             : %type <str> func_arg_expr
    1295             : %type <str> func_arg_list_opt
    1296             : %type <str> type_list
    1297             : %type <str> array_expr
    1298             : %type <str> array_expr_list
    1299             : %type <str> extract_list
    1300             : %type <str> extract_arg
    1301             : %type <str> unicode_normal_form
    1302             : %type <str> overlay_list
    1303             : %type <str> position_list
    1304             : %type <str> substr_list
    1305             : %type <str> trim_list
    1306             : %type <str> in_expr
    1307             : %type <str> case_expr
    1308             : %type <str> when_clause_list
    1309             : %type <str> when_clause
    1310             : %type <str> case_default
    1311             : %type <str> case_arg
    1312             : %type <str> columnref
    1313             : %type <str> indirection_el
    1314             : %type <str> opt_slice_bound
    1315             : %type <str> indirection
    1316             : %type <str> opt_indirection
    1317             : %type <str> opt_asymmetric
    1318             : %type <str> json_passing_clause_opt
    1319             : %type <str> json_arguments
    1320             : %type <str> json_argument
    1321             : %type <str> json_wrapper_behavior
    1322             : %type <str> json_behavior
    1323             : %type <str> json_behavior_type
    1324             : %type <str> json_behavior_clause_opt
    1325             : %type <str> json_on_error_clause_opt
    1326             : %type <str> json_value_expr
    1327             : %type <str> json_format_clause
    1328             : %type <str> json_format_clause_opt
    1329             : %type <str> json_quotes_clause_opt
    1330             : %type <str> json_returning_clause_opt
    1331             : %type <str> json_predicate_type_constraint
    1332             : %type <str> json_key_uniqueness_constraint_opt
    1333             : %type <str> json_name_and_value_list
    1334             : %type <str> json_name_and_value
    1335             : %type <str> json_object_constructor_null_clause_opt
    1336             : %type <str> json_array_constructor_null_clause_opt
    1337             : %type <str> json_value_expr_list
    1338             : %type <str> json_aggregate_func
    1339             : %type <str> json_array_aggregate_order_by_clause_opt
    1340             : %type <str> opt_target_list
    1341             : %type <str> target_list
    1342             : %type <str> target_el
    1343             : %type <str> qualified_name_list
    1344             : %type <str> qualified_name
    1345             : %type <str> name_list
    1346             : %type <str> name
    1347             : %type <str> attr_name
    1348             : %type <str> file_name
    1349             : %type <str> func_name
    1350             : %type <str> AexprConst
    1351             : %type <str> Iconst
    1352             : %type <str> SignedIconst
    1353             : %type <str> RoleId
    1354             : %type <str> RoleSpec
    1355             : %type <str> role_list
    1356             : %type <str> NonReservedWord
    1357             : %type <str> BareColLabel
    1358             : %type <str> unreserved_keyword
    1359             : %type <str> col_name_keyword
    1360             : %type <str> type_func_name_keyword
    1361             : %type <str> reserved_keyword
    1362             : %type <str> bare_label_keyword
    1363             : /* ecpgtype */
    1364             : /* src/interfaces/ecpg/preproc/ecpg.type */
    1365             : %type <str> ECPGAllocateDescr
    1366             : %type <str> ECPGCKeywords
    1367             : %type <str> ECPGColId
    1368             : %type <str> ECPGColLabel
    1369             : %type <str> ECPGConnect
    1370             : %type <str> ECPGCursorStmt
    1371             : %type <str> ECPGDeallocateDescr
    1372             : %type <str> ECPGDeclaration
    1373             : %type <str> ECPGDeclare
    1374             : %type <str> ECPGDeclareStmt
    1375             : %type <str> ECPGDisconnect
    1376             : %type <str> ECPGExecuteImmediateStmt
    1377             : %type <str> ECPGFree
    1378             : %type <str> ECPGGetDescHeaderItem
    1379             : %type <str> ECPGGetDescItem
    1380             : %type <str> ECPGGetDescriptorHeader
    1381             : %type <str> ECPGKeywords
    1382             : %type <str> ECPGKeywords_rest
    1383             : %type <str> ECPGKeywords_vanames
    1384             : %type <str> ECPGOpen
    1385             : %type <str> ECPGSetAutocommit
    1386             : %type <str> ECPGSetConnection
    1387             : %type <str> ECPGSetDescHeaderItem
    1388             : %type <str> ECPGSetDescItem
    1389             : %type <str> ECPGSetDescriptorHeader
    1390             : %type <str> ECPGTypeName
    1391             : %type <str> ECPGTypedef
    1392             : %type <str> ECPGVar
    1393             : %type <str> ECPGVarDeclaration
    1394             : %type <str> ECPGWhenever
    1395             : %type <str> ECPGunreserved_interval
    1396             : %type <str> UsingConst
    1397             : %type <str> UsingValue
    1398             : %type <str> all_unreserved_keyword
    1399             : %type <str> c_anything
    1400             : %type <str> c_args
    1401             : %type <str> c_list
    1402             : %type <str> c_stuff
    1403             : %type <str> c_stuff_item
    1404             : %type <str> c_term
    1405             : %type <str> c_thing
    1406             : %type <str> char_variable
    1407             : %type <str> char_civar
    1408             : %type <str> civar
    1409             : %type <str> civarind
    1410             : %type <str> ColId
    1411             : %type <str> ColLabel
    1412             : %type <str> connect_options
    1413             : %type <str> connection_object
    1414             : %type <str> connection_target
    1415             : %type <str> coutputvariable
    1416             : %type <str> cvariable
    1417             : %type <str> db_prefix
    1418             : %type <str> CreateAsStmt
    1419             : %type <str> DeallocateStmt
    1420             : %type <str> dis_name
    1421             : %type <str> ecpg_bconst
    1422             : %type <str> ecpg_fconst
    1423             : %type <str> ecpg_ident
    1424             : %type <str> ecpg_interval
    1425             : %type <str> ecpg_into
    1426             : %type <str> ecpg_fetch_into
    1427             : %type <str> ecpg_param
    1428             : %type <str> ecpg_sconst
    1429             : %type <str> ecpg_using
    1430             : %type <str> ecpg_xconst
    1431             : %type <str> enum_definition
    1432             : %type <str> enum_type
    1433             : %type <str> execstring
    1434             : %type <str> execute_rest
    1435             : %type <str> indicator
    1436             : %type <str> into_descriptor
    1437             : %type <str> into_sqlda
    1438             : %type <str> Iresult
    1439             : %type <str> on_off
    1440             : %type <str> opt_bit_field
    1441             : %type <str> opt_connection_name
    1442             : %type <str> opt_database_name
    1443             : %type <str> opt_ecpg_into
    1444             : %type <str> opt_ecpg_fetch_into
    1445             : %type <str> opt_ecpg_using
    1446             : %type <str> opt_initializer
    1447             : %type <str> opt_options
    1448             : %type <str> opt_output
    1449             : %type <str> opt_pointer
    1450             : %type <str> opt_port
    1451             : %type <str> opt_reference
    1452             : %type <str> opt_scale
    1453             : %type <str> opt_server
    1454             : %type <str> opt_user
    1455             : %type <str> opt_opt_value
    1456             : %type <str> ora_user
    1457             : %type <str> precision
    1458             : %type <str> prepared_name
    1459             : %type <str> quoted_ident_stringvar
    1460             : %type <str> s_struct_union
    1461             : %type <str> server
    1462             : %type <str> server_name
    1463             : %type <str> single_vt_declaration
    1464             : %type <str> storage_clause
    1465             : %type <str> storage_declaration
    1466             : %type <str> storage_modifier
    1467             : %type <str> struct_union_type
    1468             : %type <str> struct_union_type_with_symbol
    1469             : %type <str> symbol
    1470             : %type <str> type_declaration
    1471             : %type <str> type_function_name
    1472             : %type <str> user_name
    1473             : %type <str> using_descriptor
    1474             : %type <str> var_declaration
    1475             : %type <str> var_type_declarations
    1476             : %type <str> variable
    1477             : %type <str> variable_declarations
    1478             : %type <str> variable_list
    1479             : %type <str> vt_declarations
    1480             : 
    1481             : %type <str> Op
    1482             : %type <str> IntConstVar
    1483             : %type <str> AllConstVar
    1484             : %type <str> CSTRING
    1485             : %type <str> CPP_LINE
    1486             : %type <str> CVARIABLE
    1487             : %type <str> BCONST
    1488             : %type <str> SCONST
    1489             : %type <str> XCONST
    1490             : %type <str> IDENT
    1491             : 
    1492             : %type  <struct_union> s_struct_union_symbol
    1493             : 
    1494             : %type  <descriptor> ECPGGetDescriptor
    1495             : %type  <descriptor> ECPGSetDescriptor
    1496             : 
    1497             : %type  <type_enum> simple_type
    1498             : %type  <type_enum> signed_type
    1499             : %type  <type_enum> unsigned_type
    1500             : 
    1501             : %type  <dtype_enum> descriptor_item
    1502             : %type  <dtype_enum> desc_header_item
    1503             : 
    1504             : %type  <type>   var_type
    1505             : 
    1506             : %type  <action> action
    1507             : 
    1508             : %type  <describe> ECPGDescribe
    1509             : /* orig_tokens */
    1510             :  %token IDENT UIDENT FCONST SCONST USCONST BCONST XCONST Op
    1511             :  %token ICONST PARAM
    1512             :  %token TYPECAST DOT_DOT COLON_EQUALS EQUALS_GREATER
    1513             :  %token LESS_EQUALS GREATER_EQUALS NOT_EQUALS
    1514             : 
    1515             : 
    1516             : 
    1517             : 
    1518             : 
    1519             : 
    1520             : 
    1521             : 
    1522             : 
    1523             :  %token ABORT_P ABSENT ABSOLUTE_P ACCESS ACTION ADD_P ADMIN AFTER
    1524             :  AGGREGATE ALL ALSO ALTER ALWAYS ANALYSE ANALYZE AND ANY ARRAY AS ASC
    1525             :  ASENSITIVE ASSERTION ASSIGNMENT ASYMMETRIC ATOMIC AT ATTACH ATTRIBUTE AUTHORIZATION
    1526             : 
    1527             :  BACKWARD BEFORE BEGIN_P BETWEEN BIGINT BINARY BIT
    1528             :  BOOLEAN_P BOTH BREADTH BY
    1529             : 
    1530             :  CACHE CALL CALLED CASCADE CASCADED CASE CAST CATALOG_P CHAIN CHAR_P
    1531             :  CHARACTER CHARACTERISTICS CHECK CHECKPOINT CLASS CLOSE
    1532             :  CLUSTER COALESCE COLLATE COLLATION COLUMN COLUMNS COMMENT COMMENTS COMMIT
    1533             :  COMMITTED COMPRESSION CONCURRENTLY CONDITIONAL CONFIGURATION CONFLICT
    1534             :  CONNECTION CONSTRAINT CONSTRAINTS CONTENT_P CONTINUE_P CONVERSION_P COPY
    1535             :  COST CREATE CROSS CSV CUBE CURRENT_P
    1536             :  CURRENT_CATALOG CURRENT_DATE CURRENT_ROLE CURRENT_SCHEMA
    1537             :  CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURSOR CYCLE
    1538             : 
    1539             :  DATA_P DATABASE DAY_P DEALLOCATE DEC DECIMAL_P DECLARE DEFAULT DEFAULTS
    1540             :  DEFERRABLE DEFERRED DEFINER DELETE_P DELIMITER DELIMITERS DEPENDS DEPTH DESC
    1541             :  DETACH DICTIONARY DISABLE_P DISCARD DISTINCT DO DOCUMENT_P DOMAIN_P
    1542             :  DOUBLE_P DROP
    1543             : 
    1544             :  EACH ELSE EMPTY_P ENABLE_P ENCODING ENCRYPTED END_P ENUM_P ERROR_P ESCAPE
    1545             :  EVENT EXCEPT EXCLUDE EXCLUDING EXCLUSIVE EXECUTE EXISTS EXPLAIN EXPRESSION
    1546             :  EXTENSION EXTERNAL EXTRACT
    1547             : 
    1548             :  FALSE_P FAMILY FETCH FILTER FINALIZE FIRST_P FLOAT_P FOLLOWING FOR
    1549             :  FORCE FOREIGN FORMAT FORWARD FREEZE FROM FULL FUNCTION FUNCTIONS
    1550             : 
    1551             :  GENERATED GLOBAL GRANT GRANTED GREATEST GROUP_P GROUPING GROUPS
    1552             : 
    1553             :  HANDLER HAVING HEADER_P HOLD HOUR_P
    1554             : 
    1555             :  IDENTITY_P IF_P ILIKE IMMEDIATE IMMUTABLE IMPLICIT_P IMPORT_P IN_P INCLUDE
    1556             :  INCLUDING INCREMENT INDENT INDEX INDEXES INHERIT INHERITS INITIALLY INLINE_P
    1557             :  INNER_P INOUT INPUT_P INSENSITIVE INSERT INSTEAD INT_P INTEGER
    1558             :  INTERSECT INTERVAL INTO INVOKER IS ISNULL ISOLATION
    1559             : 
    1560             :  JOIN JSON JSON_ARRAY JSON_ARRAYAGG JSON_EXISTS JSON_OBJECT JSON_OBJECTAGG
    1561             :  JSON_QUERY JSON_SCALAR JSON_SERIALIZE JSON_VALUE
    1562             : 
    1563             :  KEEP KEY KEYS
    1564             : 
    1565             :  LABEL LANGUAGE LARGE_P LAST_P LATERAL_P
    1566             :  LEADING LEAKPROOF LEAST LEFT LEVEL LIKE LIMIT LISTEN LOAD LOCAL
    1567             :  LOCALTIME LOCALTIMESTAMP LOCATION LOCK_P LOCKED LOGGED
    1568             : 
    1569             :  MAPPING MATCH MATCHED MATERIALIZED MAXVALUE MERGE MERGE_ACTION METHOD
    1570             :  MINUTE_P MINVALUE MODE MONTH_P MOVE
    1571             : 
    1572             :  NAME_P NAMES NATIONAL NATURAL NCHAR NEW NEXT NFC NFD NFKC NFKD NO NONE
    1573             :  NORMALIZE NORMALIZED
    1574             :  NOT NOTHING NOTIFY NOTNULL NOWAIT NULL_P NULLIF
    1575             :  NULLS_P NUMERIC
    1576             : 
    1577             :  OBJECT_P OF OFF OFFSET OIDS OLD OMIT ON ONLY OPERATOR OPTION OPTIONS OR
    1578             :  ORDER ORDINALITY OTHERS OUT_P OUTER_P
    1579             :  OVER OVERLAPS OVERLAY OVERRIDING OWNED OWNER
    1580             : 
    1581             :  PARALLEL PARAMETER PARSER PARTIAL PARTITION PASSING PASSWORD
    1582             :  PERIOD PLACING PLANS POLICY
    1583             :  POSITION PRECEDING PRECISION PRESERVE PREPARE PREPARED PRIMARY
    1584             :  PRIOR PRIVILEGES PROCEDURAL PROCEDURE PROCEDURES PROGRAM PUBLICATION
    1585             : 
    1586             :  QUOTE QUOTES
    1587             : 
    1588             :  RANGE READ REAL REASSIGN RECHECK RECURSIVE REF_P REFERENCES REFERENCING
    1589             :  REFRESH REINDEX RELATIVE_P RELEASE RENAME REPEATABLE REPLACE REPLICA
    1590             :  RESET RESTART RESTRICT RETURN RETURNING RETURNS REVOKE RIGHT ROLE ROLLBACK ROLLUP
    1591             :  ROUTINE ROUTINES ROW ROWS RULE
    1592             : 
    1593             :  SAVEPOINT SCALAR SCHEMA SCHEMAS SCROLL SEARCH SECOND_P SECURITY SELECT
    1594             :  SEQUENCE SEQUENCES
    1595             :  SERIALIZABLE SERVER SESSION SESSION_USER SET SETS SETOF SHARE SHOW
    1596             :  SIMILAR SIMPLE SKIP SMALLINT SNAPSHOT SOME SQL_P STABLE STANDALONE_P
    1597             :  START STATEMENT STATISTICS STDIN STDOUT STORAGE STORED STRICT_P STRING_P STRIP_P
    1598             :  SUBSCRIPTION SUBSTRING SUPPORT SYMMETRIC SYSID SYSTEM_P SYSTEM_USER
    1599             : 
    1600             :  TABLE TABLES TABLESAMPLE TABLESPACE TEMP TEMPLATE TEMPORARY TEXT_P THEN
    1601             :  TIES TIME TIMESTAMP TO TRAILING TRANSACTION TRANSFORM
    1602             :  TREAT TRIGGER TRIM TRUE_P
    1603             :  TRUNCATE TRUSTED TYPE_P TYPES_P
    1604             : 
    1605             :  UESCAPE UNBOUNDED UNCONDITIONAL UNCOMMITTED UNENCRYPTED UNION UNIQUE UNKNOWN
    1606             :  UNLISTEN UNLOGGED UNTIL UPDATE USER USING
    1607             : 
    1608             :  VACUUM VALID VALIDATE VALIDATOR VALUE_P VALUES VARCHAR VARIADIC VARYING
    1609             :  VERBOSE VERSION_P VIEW VIEWS VOLATILE
    1610             : 
    1611             :  WHEN WHERE WHITESPACE_P WINDOW WITH WITHIN WITHOUT WORK WRAPPER WRITE
    1612             : 
    1613             :  XML_P XMLATTRIBUTES XMLCONCAT XMLELEMENT XMLEXISTS XMLFOREST XMLNAMESPACES
    1614             :  XMLPARSE XMLPI XMLROOT XMLSERIALIZE XMLTABLE
    1615             : 
    1616             :  YEAR_P YES_P
    1617             : 
    1618             :  ZONE
    1619             : 
    1620             : 
    1621             : 
    1622             : 
    1623             : 
    1624             : 
    1625             : 
    1626             : 
    1627             : 
    1628             : 
    1629             : 
    1630             : 
    1631             :  %token FORMAT_LA NOT_LA NULLS_LA WITH_LA WITHOUT_LA
    1632             : 
    1633             : 
    1634             : 
    1635             : 
    1636             : 
    1637             : 
    1638             : 
    1639             : 
    1640             :  %token MODE_TYPE_NAME
    1641             :  %token MODE_PLPGSQL_EXPR
    1642             :  %token MODE_PLPGSQL_ASSIGN1
    1643             :  %token MODE_PLPGSQL_ASSIGN2
    1644             :  %token MODE_PLPGSQL_ASSIGN3
    1645             : 
    1646             : 
    1647             : 
    1648             :  %left UNION EXCEPT
    1649             :  %left INTERSECT
    1650             :  %left OR
    1651             :  %left AND
    1652             :  %right NOT
    1653             :  %nonassoc IS ISNULL NOTNULL
    1654             :  %nonassoc '<' '>' '=' LESS_EQUALS GREATER_EQUALS NOT_EQUALS
    1655             :  %nonassoc BETWEEN IN_P LIKE ILIKE SIMILAR NOT_LA
    1656             :  %nonassoc ESCAPE
    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             : 
    1688             : 
    1689             : 
    1690             : 
    1691             : 
    1692             : 
    1693             : 
    1694             : 
    1695             : 
    1696             : 
    1697             : 
    1698             : 
    1699             : 
    1700             : 
    1701             :  %nonassoc UNBOUNDED
    1702             :  %nonassoc IDENT
    1703             : %nonassoc CSTRING PARTITION RANGE ROWS GROUPS PRECEDING FOLLOWING CUBE ROLLUP
    1704             :  SET KEYS OBJECT_P SCALAR VALUE_P WITH WITHOUT
    1705             :  %left Op OPERATOR
    1706             :  %left '+' '-'
    1707             :  %left '*' '/' '%'
    1708             :  %left '^'
    1709             : 
    1710             :  %left AT
    1711             :  %left COLLATE
    1712             :  %right UMINUS
    1713             :  %left '[' ']'
    1714             :  %left '(' ')'
    1715             :  %left TYPECAST
    1716             :  %left '.'
    1717             : 
    1718             : 
    1719             : 
    1720             : 
    1721             : 
    1722             : 
    1723             : 
    1724             :  %left JOIN CROSS LEFT FULL RIGHT INNER_P NATURAL
    1725             : 
    1726             : %%
    1727             : prog: statements;
    1728             : /* rules */
    1729             :  toplevel_stmt:
    1730             :  stmt
    1731             :  { 
    1732        2344 :  $$ = $1;
    1733             : }
    1734             : |  TransactionStmtLegacy
    1735             :     {
    1736          16 :         fprintf(base_yyout, "{ ECPGtrans(__LINE__, %s, \"%s\");", connection ? connection : "NULL", $1);
    1737          16 :         whenever_action(2);
    1738          16 :         free($1);
    1739             :     }
    1740             : ;
    1741             : 
    1742             : 
    1743             :  stmt:
    1744             :  AlterEventTrigStmt
    1745           0 :  { output_statement($1, 0, ECPGst_normal); }
    1746             : |  AlterCollationStmt
    1747           0 :  { output_statement($1, 0, ECPGst_normal); }
    1748             : |  AlterDatabaseStmt
    1749           0 :  { output_statement($1, 0, ECPGst_normal); }
    1750             : |  AlterDatabaseSetStmt
    1751           0 :  { output_statement($1, 0, ECPGst_normal); }
    1752             : |  AlterDefaultPrivilegesStmt
    1753           0 :  { output_statement($1, 0, ECPGst_normal); }
    1754             : |  AlterDomainStmt
    1755           0 :  { output_statement($1, 0, ECPGst_normal); }
    1756             : |  AlterEnumStmt
    1757           0 :  { output_statement($1, 0, ECPGst_normal); }
    1758             : |  AlterExtensionStmt
    1759           0 :  { output_statement($1, 0, ECPGst_normal); }
    1760             : |  AlterExtensionContentsStmt
    1761           0 :  { output_statement($1, 0, ECPGst_normal); }
    1762             : |  AlterFdwStmt
    1763           0 :  { output_statement($1, 0, ECPGst_normal); }
    1764             : |  AlterForeignServerStmt
    1765           0 :  { output_statement($1, 0, ECPGst_normal); }
    1766             : |  AlterFunctionStmt
    1767           0 :  { output_statement($1, 0, ECPGst_normal); }
    1768             : |  AlterGroupStmt
    1769           0 :  { output_statement($1, 0, ECPGst_normal); }
    1770             : |  AlterObjectDependsStmt
    1771           0 :  { output_statement($1, 0, ECPGst_normal); }
    1772             : |  AlterObjectSchemaStmt
    1773           0 :  { output_statement($1, 0, ECPGst_normal); }
    1774             : |  AlterOwnerStmt
    1775           0 :  { output_statement($1, 0, ECPGst_normal); }
    1776             : |  AlterOperatorStmt
    1777           0 :  { output_statement($1, 0, ECPGst_normal); }
    1778             : |  AlterTypeStmt
    1779           0 :  { output_statement($1, 0, ECPGst_normal); }
    1780             : |  AlterPolicyStmt
    1781           0 :  { output_statement($1, 0, ECPGst_normal); }
    1782             : |  AlterSeqStmt
    1783           0 :  { output_statement($1, 0, ECPGst_normal); }
    1784             : |  AlterSystemStmt
    1785           0 :  { output_statement($1, 0, ECPGst_normal); }
    1786             : |  AlterTableStmt
    1787           4 :  { output_statement($1, 0, ECPGst_normal); }
    1788             : |  AlterTblSpcStmt
    1789           0 :  { output_statement($1, 0, ECPGst_normal); }
    1790             : |  AlterCompositeTypeStmt
    1791           0 :  { output_statement($1, 0, ECPGst_normal); }
    1792             : |  AlterPublicationStmt
    1793           0 :  { output_statement($1, 0, ECPGst_normal); }
    1794             : |  AlterRoleSetStmt
    1795           0 :  { output_statement($1, 0, ECPGst_normal); }
    1796             : |  AlterRoleStmt
    1797           6 :  { output_statement($1, 0, ECPGst_normal); }
    1798             : |  AlterSubscriptionStmt
    1799           0 :  { output_statement($1, 0, ECPGst_normal); }
    1800             : |  AlterStatsStmt
    1801           0 :  { output_statement($1, 0, ECPGst_normal); }
    1802             : |  AlterTSConfigurationStmt
    1803           0 :  { output_statement($1, 0, ECPGst_normal); }
    1804             : |  AlterTSDictionaryStmt
    1805           0 :  { output_statement($1, 0, ECPGst_normal); }
    1806             : |  AlterUserMappingStmt
    1807           0 :  { output_statement($1, 0, ECPGst_normal); }
    1808             : |  AnalyzeStmt
    1809           0 :  { output_statement($1, 0, ECPGst_normal); }
    1810             : |  CallStmt
    1811           0 :  { output_statement($1, 0, ECPGst_normal); }
    1812             : |  CheckPointStmt
    1813           0 :  { output_statement($1, 0, ECPGst_normal); }
    1814             : |  ClosePortalStmt
    1815             :     {
    1816          76 :         if (INFORMIX_MODE)
    1817             :         {
    1818           8 :             if (pg_strcasecmp($1+strlen("close "), "database") == 0)
    1819             :             {
    1820           4 :                 if (connection)
    1821           0 :                     mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in CLOSE DATABASE statement");
    1822             : 
    1823           4 :                 fprintf(base_yyout, "{ ECPGdisconnect(__LINE__, \"CURRENT\");");
    1824           4 :                 whenever_action(2);
    1825           4 :                 free($1);
    1826           4 :                 break;
    1827             :             }
    1828             :         }
    1829             : 
    1830          72 :         output_statement($1, 0, ECPGst_normal);
    1831             :     }
    1832             : |  ClusterStmt
    1833           0 :  { output_statement($1, 0, ECPGst_normal); }
    1834             : |  CommentStmt
    1835           0 :  { output_statement($1, 0, ECPGst_normal); }
    1836             : |  ConstraintsSetStmt
    1837           0 :  { output_statement($1, 0, ECPGst_normal); }
    1838             : |  CopyStmt
    1839           2 :  { output_statement($1, 0, ECPGst_normal); }
    1840             : |  CreateAmStmt
    1841           0 :  { output_statement($1, 0, ECPGst_normal); }
    1842             : |  CreateAsStmt
    1843           4 :  { output_statement($1, 0, ECPGst_normal); }
    1844             : |  CreateAssertionStmt
    1845           0 :  { output_statement($1, 0, ECPGst_normal); }
    1846             : |  CreateCastStmt
    1847           0 :  { output_statement($1, 0, ECPGst_normal); }
    1848             : |  CreateConversionStmt
    1849           0 :  { output_statement($1, 0, ECPGst_normal); }
    1850             : |  CreateDomainStmt
    1851           0 :  { output_statement($1, 0, ECPGst_normal); }
    1852             : |  CreateExtensionStmt
    1853           0 :  { output_statement($1, 0, ECPGst_normal); }
    1854             : |  CreateFdwStmt
    1855           0 :  { output_statement($1, 0, ECPGst_normal); }
    1856             : |  CreateForeignServerStmt
    1857           0 :  { output_statement($1, 0, ECPGst_normal); }
    1858             : |  CreateForeignTableStmt
    1859           0 :  { output_statement($1, 0, ECPGst_normal); }
    1860             : |  CreateFunctionStmt
    1861           2 :  { output_statement($1, 0, ECPGst_normal); }
    1862             : |  CreateGroupStmt
    1863           0 :  { output_statement($1, 0, ECPGst_normal); }
    1864             : |  CreateMatViewStmt
    1865           0 :  { output_statement($1, 0, ECPGst_normal); }
    1866             : |  CreateOpClassStmt
    1867           0 :  { output_statement($1, 0, ECPGst_normal); }
    1868             : |  CreateOpFamilyStmt
    1869           0 :  { output_statement($1, 0, ECPGst_normal); }
    1870             : |  CreatePublicationStmt
    1871           0 :  { output_statement($1, 0, ECPGst_normal); }
    1872             : |  AlterOpFamilyStmt
    1873           0 :  { output_statement($1, 0, ECPGst_normal); }
    1874             : |  CreatePolicyStmt
    1875           0 :  { output_statement($1, 0, ECPGst_normal); }
    1876             : |  CreatePLangStmt
    1877           0 :  { output_statement($1, 0, ECPGst_normal); }
    1878             : |  CreateSchemaStmt
    1879           0 :  { output_statement($1, 0, ECPGst_normal); }
    1880             : |  CreateSeqStmt
    1881           0 :  { output_statement($1, 0, ECPGst_normal); }
    1882             : |  CreateStmt
    1883         100 :  { output_statement($1, 0, ECPGst_normal); }
    1884             : |  CreateSubscriptionStmt
    1885           0 :  { output_statement($1, 0, ECPGst_normal); }
    1886             : |  CreateStatsStmt
    1887           0 :  { output_statement($1, 0, ECPGst_normal); }
    1888             : |  CreateTableSpaceStmt
    1889           0 :  { output_statement($1, 0, ECPGst_normal); }
    1890             : |  CreateTransformStmt
    1891           0 :  { output_statement($1, 0, ECPGst_normal); }
    1892             : |  CreateTrigStmt
    1893           2 :  { output_statement($1, 0, ECPGst_normal); }
    1894             : |  CreateEventTrigStmt
    1895           0 :  { output_statement($1, 0, ECPGst_normal); }
    1896             : |  CreateRoleStmt
    1897           0 :  { output_statement($1, 0, ECPGst_normal); }
    1898             : |  CreateUserStmt
    1899           0 :  { output_statement($1, 0, ECPGst_normal); }
    1900             : |  CreateUserMappingStmt
    1901           0 :  { output_statement($1, 0, ECPGst_normal); }
    1902             : |  CreatedbStmt
    1903           0 :  { output_statement($1, 0, ECPGst_normal); }
    1904             : |  DeallocateStmt
    1905             :     {
    1906          76 :         output_deallocate_prepare_statement($1);
    1907             :     }
    1908             : |  DeclareCursorStmt
    1909          34 :     { output_simple_statement($1, (strncmp($1, "ECPGset_var", strlen("ECPGset_var")) == 0) ? 4 : 0); }
    1910             : |  DefineStmt
    1911           0 :  { output_statement($1, 0, ECPGst_normal); }
    1912             : |  DeleteStmt
    1913           4 :     { output_statement($1, 1, ECPGst_prepnormal); }
    1914             : |  DiscardStmt
    1915           0 :     { output_statement($1, 1, ECPGst_normal); }
    1916             : |  DoStmt
    1917           0 :  { output_statement($1, 0, ECPGst_normal); }
    1918             : |  DropCastStmt
    1919           0 :  { output_statement($1, 0, ECPGst_normal); }
    1920             : |  DropOpClassStmt
    1921           0 :  { output_statement($1, 0, ECPGst_normal); }
    1922             : |  DropOpFamilyStmt
    1923           0 :  { output_statement($1, 0, ECPGst_normal); }
    1924             : |  DropOwnedStmt
    1925           0 :  { output_statement($1, 0, ECPGst_normal); }
    1926             : |  DropStmt
    1927          76 :  { output_statement($1, 0, ECPGst_normal); }
    1928             : |  DropSubscriptionStmt
    1929           0 :  { output_statement($1, 0, ECPGst_normal); }
    1930             : |  DropTableSpaceStmt
    1931           0 :  { output_statement($1, 0, ECPGst_normal); }
    1932             : |  DropTransformStmt
    1933           0 :  { output_statement($1, 0, ECPGst_normal); }
    1934             : |  DropRoleStmt
    1935           0 :  { output_statement($1, 0, ECPGst_normal); }
    1936             : |  DropUserMappingStmt
    1937           0 :  { output_statement($1, 0, ECPGst_normal); }
    1938             : |  DropdbStmt
    1939           0 :  { output_statement($1, 0, ECPGst_normal); }
    1940             : |  ExecuteStmt
    1941             :     {
    1942          66 :         check_declared_list($1.name);
    1943          66 :         if ($1.type == NULL || strlen($1.type) == 0)
    1944          48 :             output_statement($1.name, 1, ECPGst_execute);
    1945             :         else
    1946             :         {
    1947          18 :             if ($1.name[0] != '"')
    1948             :                 /* case of char_variable */
    1949           8 :                 add_variable_to_tail(&argsinsert, find_variable($1.name), &no_indicator);
    1950             :             else
    1951             :             {
    1952             :                 /* case of ecpg_ident or CSTRING */
    1953          10 :                 char *length = mm_alloc(sizeof(int) * CHAR_BIT * 10 / 3);
    1954          10 :                 char *str = mm_strdup($1.name + 1);
    1955             : 
    1956             :                 /* It must be cut off double quotation because new_variable() double-quotes. */
    1957          10 :                 str[strlen(str) - 1] = '\0';
    1958          10 :                 sprintf(length, "%zu", strlen(str));
    1959          10 :                 add_variable_to_tail(&argsinsert, new_variable(str, ECPGmake_simple_type(ECPGt_const, length, 0), 0), &no_indicator);
    1960             :             }
    1961          18 :             output_statement(cat_str(3, mm_strdup("execute"), mm_strdup("$0"), $1.type), 0, ECPGst_exec_with_exprlist);
    1962             :         }
    1963             :     }
    1964             : |  ExplainStmt
    1965           0 :  { output_statement($1, 0, ECPGst_normal); }
    1966             : |  FetchStmt
    1967         126 :     { output_statement($1, 1, ECPGst_normal); }
    1968             : |  GrantStmt
    1969           0 :  { output_statement($1, 0, ECPGst_normal); }
    1970             : |  GrantRoleStmt
    1971           0 :  { output_statement($1, 0, ECPGst_normal); }
    1972             : |  ImportForeignSchemaStmt
    1973           0 :  { output_statement($1, 0, ECPGst_normal); }
    1974             : |  IndexStmt
    1975           0 :  { output_statement($1, 0, ECPGst_normal); }
    1976             : |  InsertStmt
    1977         224 :     { output_statement($1, 1, ECPGst_prepnormal); }
    1978             : |  ListenStmt
    1979           0 :  { output_statement($1, 0, ECPGst_normal); }
    1980             : |  RefreshMatViewStmt
    1981           0 :  { output_statement($1, 0, ECPGst_normal); }
    1982             : |  LoadStmt
    1983           0 :  { output_statement($1, 0, ECPGst_normal); }
    1984             : |  LockStmt
    1985           0 :  { output_statement($1, 0, ECPGst_normal); }
    1986             : |  MergeStmt
    1987           0 :  { output_statement($1, 0, ECPGst_normal); }
    1988             : |  NotifyStmt
    1989           0 :  { output_statement($1, 0, ECPGst_normal); }
    1990             : |  PrepareStmt
    1991             :     {
    1992         106 :         check_declared_list($1.name);
    1993         106 :         if ($1.type == NULL)
    1994          94 :             output_prepare_statement($1.name, $1.stmt);
    1995          12 :         else if (strlen($1.type) == 0)
    1996             :         {
    1997           2 :             char *stmt = cat_str(3, mm_strdup("\""), $1.stmt, mm_strdup("\""));
    1998           2 :             output_prepare_statement($1.name, stmt);
    1999             :         }
    2000             :         else
    2001             :         {
    2002          10 :             if ($1.name[0] != '"')
    2003             :                 /* case of char_variable */
    2004           4 :                 add_variable_to_tail(&argsinsert, find_variable($1.name), &no_indicator);
    2005             :             else
    2006             :             {
    2007           6 :                 char *length = mm_alloc(sizeof(int) * CHAR_BIT * 10 / 3);
    2008           6 :                 char *str = mm_strdup($1.name + 1);
    2009             : 
    2010             :                 /* It must be cut off double quotation because new_variable() double-quotes. */
    2011           6 :                 str[strlen(str) - 1] = '\0';
    2012           6 :                 sprintf(length, "%zu", strlen(str));
    2013           6 :                 add_variable_to_tail(&argsinsert, new_variable(str, ECPGmake_simple_type(ECPGt_const, length, 0), 0), &no_indicator);
    2014             :             }
    2015          10 :             output_statement(cat_str(5, mm_strdup("prepare"), mm_strdup("$0"), $1.type, mm_strdup("as"), $1.stmt), 0, ECPGst_prepare);
    2016             :         }
    2017             :     }
    2018             : |  ReassignOwnedStmt
    2019           0 :  { output_statement($1, 0, ECPGst_normal); }
    2020             : |  ReindexStmt
    2021           0 :  { output_statement($1, 0, ECPGst_normal); }
    2022             : |  RemoveAggrStmt
    2023           0 :  { output_statement($1, 0, ECPGst_normal); }
    2024             : |  RemoveFuncStmt
    2025           2 :  { output_statement($1, 0, ECPGst_normal); }
    2026             : |  RemoveOperStmt
    2027           0 :  { output_statement($1, 0, ECPGst_normal); }
    2028             : |  RenameStmt
    2029           0 :  { output_statement($1, 0, ECPGst_normal); }
    2030             : |  RevokeStmt
    2031           0 :  { output_statement($1, 0, ECPGst_normal); }
    2032             : |  RevokeRoleStmt
    2033           0 :  { output_statement($1, 0, ECPGst_normal); }
    2034             : |  RuleStmt
    2035           0 :  { output_statement($1, 0, ECPGst_normal); }
    2036             : |  SecLabelStmt
    2037           0 :  { output_statement($1, 0, ECPGst_normal); }
    2038             : |  SelectStmt
    2039         192 :     { output_statement($1, 1, ECPGst_prepnormal); }
    2040             : |  TransactionStmt
    2041             :     {
    2042         158 :         fprintf(base_yyout, "{ ECPGtrans(__LINE__, %s, \"%s\");", connection ? connection : "NULL", $1);
    2043         158 :         whenever_action(2);
    2044         158 :         free($1);
    2045             :     }
    2046             : |  TruncateStmt
    2047          44 :  { output_statement($1, 0, ECPGst_normal); }
    2048             : |  UnlistenStmt
    2049           0 :  { output_statement($1, 0, ECPGst_normal); }
    2050             : |  UpdateStmt
    2051          10 :     { output_statement($1, 1, ECPGst_prepnormal); }
    2052             : |  VacuumStmt
    2053           0 :  { output_statement($1, 0, ECPGst_normal); }
    2054             : |  VariableResetStmt
    2055           0 :  { output_statement($1, 0, ECPGst_normal); }
    2056             : |  VariableSetStmt
    2057          46 :  { output_statement($1, 0, ECPGst_normal); }
    2058             : |  VariableShowStmt
    2059          14 :  { output_statement($1, 0, ECPGst_normal); }
    2060             : |  ViewStmt
    2061           0 :  { output_statement($1, 0, ECPGst_normal); }
    2062             :     | ECPGAllocateDescr
    2063             :     {
    2064          36 :         fprintf(base_yyout,"ECPGallocate_desc(__LINE__, %s);",$1);
    2065          36 :         whenever_action(0);
    2066          36 :         free($1);
    2067             :     }
    2068             :     | ECPGConnect
    2069             :     {
    2070         184 :         if (connection)
    2071           0 :             mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in CONNECT statement");
    2072             : 
    2073         184 :         fprintf(base_yyout, "{ ECPGconnect(__LINE__, %d, %s, %d); ", compat, $1, autocommit);
    2074         184 :         reset_variables();
    2075         184 :         whenever_action(2);
    2076         184 :         free($1);
    2077             :     }
    2078             :     | ECPGDeclareStmt
    2079             :     {
    2080          10 :         output_simple_statement($1, 0);
    2081             :     }
    2082             :     | ECPGCursorStmt
    2083             :     {
    2084          40 :          output_simple_statement($1, (strncmp($1, "ECPGset_var", strlen("ECPGset_var")) == 0) ? 4 : 0);
    2085             :     }
    2086             :     | ECPGDeallocateDescr
    2087             :     {
    2088          32 :         fprintf(base_yyout,"ECPGdeallocate_desc(__LINE__, %s);",$1);
    2089          32 :         whenever_action(0);
    2090          32 :         free($1);
    2091             :     }
    2092             :     | ECPGDeclare
    2093             :     {
    2094           0 :         output_simple_statement($1, 0);
    2095             :     }
    2096             :     | ECPGDescribe
    2097             :     {
    2098          42 :         check_declared_list($1.stmt_name);
    2099             : 
    2100          42 :         fprintf(base_yyout, "{ ECPGdescribe(__LINE__, %d, %d, %s, %s,", compat, $1.input, connection ? connection : "NULL", $1.stmt_name);
    2101          42 :         dump_variables(argsresult, 1);
    2102          42 :         fputs("ECPGt_EORT);", base_yyout);
    2103          42 :         fprintf(base_yyout, "}");
    2104          42 :         output_line_number();
    2105             : 
    2106          42 :         free($1.stmt_name);
    2107             :     }
    2108             :     | ECPGDisconnect
    2109             :     {
    2110         170 :         if (connection)
    2111           0 :             mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in DISCONNECT statement");
    2112             : 
    2113         170 :         fprintf(base_yyout, "{ ECPGdisconnect(__LINE__, %s);",
    2114         170 :                 $1 ? $1 : "\"CURRENT\"");
    2115         170 :         whenever_action(2);
    2116         170 :         free($1);
    2117             :     }
    2118          14 :     | ECPGExecuteImmediateStmt  { output_statement($1, 0, ECPGst_exec_immediate); }
    2119             :     | ECPGFree
    2120             :     {
    2121           2 :         const char *con = connection ? connection : "NULL";
    2122             : 
    2123           2 :         if (strcmp($1, "all") == 0)
    2124           0 :             fprintf(base_yyout, "{ ECPGdeallocate_all(__LINE__, %d, %s);", compat, con);
    2125           2 :         else if ($1[0] == ':')
    2126           0 :             fprintf(base_yyout, "{ ECPGdeallocate(__LINE__, %d, %s, %s);", compat, con, $1+1);
    2127             :         else
    2128           2 :             fprintf(base_yyout, "{ ECPGdeallocate(__LINE__, %d, %s, \"%s\");", compat, con, $1);
    2129             : 
    2130           2 :         whenever_action(2);
    2131           2 :         free($1);
    2132             :     }
    2133             :     | ECPGGetDescriptor
    2134             :     {
    2135          62 :         lookup_descriptor($1.name, connection);
    2136          62 :         output_get_descr($1.name, $1.str);
    2137          62 :         free($1.name);
    2138          62 :         free($1.str);
    2139             :     }
    2140             :     | ECPGGetDescriptorHeader
    2141             :     {
    2142          22 :         lookup_descriptor($1, connection);
    2143          22 :         output_get_descr_header($1);
    2144          22 :         free($1);
    2145             :     }
    2146             :     | ECPGOpen
    2147             :     {
    2148             :         struct cursor *ptr;
    2149             : 
    2150          76 :         if ((ptr = add_additional_variables($1, true)) != NULL)
    2151             :         {
    2152          76 :             connection = ptr->connection ? mm_strdup(ptr->connection) : NULL;
    2153          76 :             output_statement(mm_strdup(ptr->command), 0, ECPGst_normal);
    2154          76 :             ptr->opened = true;
    2155             :         }
    2156             :     }
    2157             :     | ECPGSetAutocommit
    2158             :     {
    2159          24 :         fprintf(base_yyout, "{ ECPGsetcommit(__LINE__, \"%s\", %s);", $1, connection ? connection : "NULL");
    2160          24 :         whenever_action(2);
    2161          24 :         free($1);
    2162             :     }
    2163             :     | ECPGSetConnection
    2164             :     {
    2165           4 :         if (connection)
    2166           0 :             mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in SET CONNECTION statement");
    2167             : 
    2168           4 :         fprintf(base_yyout, "{ ECPGsetconn(__LINE__, %s);", $1);
    2169           4 :         whenever_action(2);
    2170           4 :         free($1);
    2171             :     }
    2172             :     | ECPGSetDescriptor
    2173             :     {
    2174          22 :         lookup_descriptor($1.name, connection);
    2175          22 :         output_set_descr($1.name, $1.str);
    2176          22 :         free($1.name);
    2177          22 :         free($1.str);
    2178             :     }
    2179             :     | ECPGSetDescriptorHeader
    2180             :     {
    2181           2 :         lookup_descriptor($1, connection);
    2182           2 :         output_set_descr_header($1);
    2183           2 :         free($1);
    2184             :     }
    2185             :     | ECPGTypedef
    2186             :     {
    2187          26 :         if (connection)
    2188           0 :             mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in TYPE statement");
    2189             : 
    2190          26 :         fprintf(base_yyout, "%s", $1);
    2191          26 :         free($1);
    2192          26 :         output_line_number();
    2193             :     }
    2194             :     | ECPGVar
    2195             :     {
    2196           4 :         if (connection)
    2197           0 :             mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in VAR statement");
    2198             : 
    2199           4 :         output_simple_statement($1, 0);
    2200             :     }
    2201             :     | ECPGWhenever
    2202             :     {
    2203         198 :         if (connection)
    2204           0 :             mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in WHENEVER statement");
    2205             : 
    2206         198 :         output_simple_statement($1, 0);
    2207             :     }
    2208             : | 
    2209           0 :  { $$ = NULL; }
    2210             : ;
    2211             : 
    2212             : 
    2213             :  opt_single_name:
    2214             :  ColId
    2215             :  { 
    2216           0 :  $$ = $1;
    2217             : }
    2218             : | 
    2219             :  { 
    2220           0 :  $$=EMPTY; }
    2221             : ;
    2222             : 
    2223             : 
    2224             :  opt_qualified_name:
    2225             :  any_name
    2226             :  { 
    2227           0 :  $$ = $1;
    2228             : }
    2229             : | 
    2230             :  { 
    2231           0 :  $$=EMPTY; }
    2232             : ;
    2233             : 
    2234             : 
    2235             :  opt_concurrently:
    2236             :  CONCURRENTLY
    2237             :  { 
    2238           0 :  $$ = mm_strdup("concurrently");
    2239             : }
    2240             : | 
    2241             :  { 
    2242           0 :  $$=EMPTY; }
    2243             : ;
    2244             : 
    2245             : 
    2246             :  opt_drop_behavior:
    2247             :  CASCADE
    2248             :  { 
    2249           0 :  $$ = mm_strdup("cascade");
    2250             : }
    2251             : |  RESTRICT
    2252             :  { 
    2253           0 :  $$ = mm_strdup("restrict");
    2254             : }
    2255             : | 
    2256             :  { 
    2257         122 :  $$=EMPTY; }
    2258             : ;
    2259             : 
    2260             : 
    2261             :  CallStmt:
    2262             :  CALL func_application
    2263             :  { 
    2264           0 :  $$ = cat_str(2,mm_strdup("call"),$2);
    2265             : }
    2266             : ;
    2267             : 
    2268             : 
    2269             :  CreateRoleStmt:
    2270             :  CREATE ROLE RoleId opt_with OptRoleList
    2271             :  { 
    2272           0 :  $$ = cat_str(4,mm_strdup("create role"),$3,$4,$5);
    2273             : }
    2274             : ;
    2275             : 
    2276             : 
    2277             :  opt_with:
    2278             :  WITH
    2279             :  { 
    2280           2 :  $$ = mm_strdup("with");
    2281             : }
    2282             : |  WITH_LA
    2283             :  { 
    2284           0 :  $$ = mm_strdup("with");
    2285             : }
    2286             : | 
    2287             :  { 
    2288           6 :  $$=EMPTY; }
    2289             : ;
    2290             : 
    2291             : 
    2292             :  OptRoleList:
    2293             :  OptRoleList CreateOptRoleElem
    2294             :  { 
    2295           0 :  $$ = cat_str(2,$1,$2);
    2296             : }
    2297             : | 
    2298             :  { 
    2299           0 :  $$=EMPTY; }
    2300             : ;
    2301             : 
    2302             : 
    2303             :  AlterOptRoleList:
    2304             :  AlterOptRoleList AlterOptRoleElem
    2305             :  { 
    2306           6 :  $$ = cat_str(2,$1,$2);
    2307             : }
    2308             : | 
    2309             :  { 
    2310           6 :  $$=EMPTY; }
    2311             : ;
    2312             : 
    2313             : 
    2314             :  AlterOptRoleElem:
    2315             :  PASSWORD ecpg_sconst
    2316             :  { 
    2317           0 :  $$ = cat_str(2,mm_strdup("password"),$2);
    2318             : }
    2319             : |  PASSWORD NULL_P
    2320             :  { 
    2321           0 :  $$ = mm_strdup("password null");
    2322             : }
    2323             : |  ENCRYPTED PASSWORD ecpg_sconst
    2324             :  { 
    2325           6 :  $$ = cat_str(2,mm_strdup("encrypted password"),$3);
    2326             : }
    2327             : |  UNENCRYPTED PASSWORD ecpg_sconst
    2328             :  { 
    2329           0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
    2330           0 :  $$ = cat_str(2,mm_strdup("unencrypted password"),$3);
    2331             : }
    2332             : |  INHERIT
    2333             :  { 
    2334           0 :  $$ = mm_strdup("inherit");
    2335             : }
    2336             : |  CONNECTION LIMIT SignedIconst
    2337             :  { 
    2338           0 :  $$ = cat_str(2,mm_strdup("connection limit"),$3);
    2339             : }
    2340             : |  VALID UNTIL ecpg_sconst
    2341             :  { 
    2342           0 :  $$ = cat_str(2,mm_strdup("valid until"),$3);
    2343             : }
    2344             : |  USER role_list
    2345             :  { 
    2346           0 :  $$ = cat_str(2,mm_strdup("user"),$2);
    2347             : }
    2348             : |  ecpg_ident
    2349             :  { 
    2350           0 :  $$ = $1;
    2351             : }
    2352             : ;
    2353             : 
    2354             : 
    2355             :  CreateOptRoleElem:
    2356             :  AlterOptRoleElem
    2357             :  { 
    2358           0 :  $$ = $1;
    2359             : }
    2360             : |  SYSID Iconst
    2361             :  { 
    2362           0 :  $$ = cat_str(2,mm_strdup("sysid"),$2);
    2363             : }
    2364             : |  ADMIN role_list
    2365             :  { 
    2366           0 :  $$ = cat_str(2,mm_strdup("admin"),$2);
    2367             : }
    2368             : |  ROLE role_list
    2369             :  { 
    2370           0 :  $$ = cat_str(2,mm_strdup("role"),$2);
    2371             : }
    2372             : |  IN_P ROLE role_list
    2373             :  { 
    2374           0 :  $$ = cat_str(2,mm_strdup("in role"),$3);
    2375             : }
    2376             : |  IN_P GROUP_P role_list
    2377             :  { 
    2378           0 :  $$ = cat_str(2,mm_strdup("in group"),$3);
    2379             : }
    2380             : ;
    2381             : 
    2382             : 
    2383             :  CreateUserStmt:
    2384             :  CREATE USER RoleId opt_with OptRoleList
    2385             :  { 
    2386           0 :  $$ = cat_str(4,mm_strdup("create user"),$3,$4,$5);
    2387             : }
    2388             : ;
    2389             : 
    2390             : 
    2391             :  AlterRoleStmt:
    2392             :  ALTER ROLE RoleSpec opt_with AlterOptRoleList
    2393             :  { 
    2394           0 :  $$ = cat_str(4,mm_strdup("alter role"),$3,$4,$5);
    2395             : }
    2396             : |  ALTER USER RoleSpec opt_with AlterOptRoleList
    2397             :  { 
    2398           6 :  $$ = cat_str(4,mm_strdup("alter user"),$3,$4,$5);
    2399             : }
    2400             : ;
    2401             : 
    2402             : 
    2403             :  opt_in_database:
    2404             : 
    2405             :  { 
    2406           0 :  $$=EMPTY; }
    2407             : |  IN_P DATABASE name
    2408             :  { 
    2409           0 :  $$ = cat_str(2,mm_strdup("in database"),$3);
    2410             : }
    2411             : ;
    2412             : 
    2413             : 
    2414             :  AlterRoleSetStmt:
    2415             :  ALTER ROLE RoleSpec opt_in_database SetResetClause
    2416             :  { 
    2417           0 :  $$ = cat_str(4,mm_strdup("alter role"),$3,$4,$5);
    2418             : }
    2419             : |  ALTER ROLE ALL opt_in_database SetResetClause
    2420             :  { 
    2421           0 :  $$ = cat_str(3,mm_strdup("alter role all"),$4,$5);
    2422             : }
    2423             : |  ALTER USER RoleSpec opt_in_database SetResetClause
    2424             :  { 
    2425           0 :  $$ = cat_str(4,mm_strdup("alter user"),$3,$4,$5);
    2426             : }
    2427             : |  ALTER USER ALL opt_in_database SetResetClause
    2428             :  { 
    2429           0 :  $$ = cat_str(3,mm_strdup("alter user all"),$4,$5);
    2430             : }
    2431             : ;
    2432             : 
    2433             : 
    2434             :  DropRoleStmt:
    2435             :  DROP ROLE role_list
    2436             :  { 
    2437           0 :  $$ = cat_str(2,mm_strdup("drop role"),$3);
    2438             : }
    2439             : |  DROP ROLE IF_P EXISTS role_list
    2440             :  { 
    2441           0 :  $$ = cat_str(2,mm_strdup("drop role if exists"),$5);
    2442             : }
    2443             : |  DROP USER role_list
    2444             :  { 
    2445           0 :  $$ = cat_str(2,mm_strdup("drop user"),$3);
    2446             : }
    2447             : |  DROP USER IF_P EXISTS role_list
    2448             :  { 
    2449           0 :  $$ = cat_str(2,mm_strdup("drop user if exists"),$5);
    2450             : }
    2451             : |  DROP GROUP_P role_list
    2452             :  { 
    2453           0 :  $$ = cat_str(2,mm_strdup("drop group"),$3);
    2454             : }
    2455             : |  DROP GROUP_P IF_P EXISTS role_list
    2456             :  { 
    2457           0 :  $$ = cat_str(2,mm_strdup("drop group if exists"),$5);
    2458             : }
    2459             : ;
    2460             : 
    2461             : 
    2462             :  CreateGroupStmt:
    2463             :  CREATE GROUP_P RoleId opt_with OptRoleList
    2464             :  { 
    2465           0 :  $$ = cat_str(4,mm_strdup("create group"),$3,$4,$5);
    2466             : }
    2467             : ;
    2468             : 
    2469             : 
    2470             :  AlterGroupStmt:
    2471             :  ALTER GROUP_P RoleSpec add_drop USER role_list
    2472             :  { 
    2473           0 :  $$ = cat_str(5,mm_strdup("alter group"),$3,$4,mm_strdup("user"),$6);
    2474             : }
    2475             : ;
    2476             : 
    2477             : 
    2478             :  add_drop:
    2479             :  ADD_P
    2480             :  { 
    2481           0 :  $$ = mm_strdup("add");
    2482             : }
    2483             : |  DROP
    2484             :  { 
    2485           0 :  $$ = mm_strdup("drop");
    2486             : }
    2487             : ;
    2488             : 
    2489             : 
    2490             :  CreateSchemaStmt:
    2491             :  CREATE SCHEMA opt_single_name AUTHORIZATION RoleSpec OptSchemaEltList
    2492             :  { 
    2493           0 :  $$ = cat_str(5,mm_strdup("create schema"),$3,mm_strdup("authorization"),$5,$6);
    2494             : }
    2495             : |  CREATE SCHEMA ColId OptSchemaEltList
    2496             :  { 
    2497           0 :  $$ = cat_str(3,mm_strdup("create schema"),$3,$4);
    2498             : }
    2499             : |  CREATE SCHEMA IF_P NOT EXISTS opt_single_name AUTHORIZATION RoleSpec OptSchemaEltList
    2500             :  { 
    2501           0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
    2502           0 :  $$ = cat_str(5,mm_strdup("create schema if not exists"),$6,mm_strdup("authorization"),$8,$9);
    2503             : }
    2504             : |  CREATE SCHEMA IF_P NOT EXISTS ColId OptSchemaEltList
    2505             :  { 
    2506           0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
    2507           0 :  $$ = cat_str(3,mm_strdup("create schema if not exists"),$6,$7);
    2508             : }
    2509             : ;
    2510             : 
    2511             : 
    2512             :  OptSchemaEltList:
    2513             :  OptSchemaEltList schema_stmt
    2514             :  { 
    2515           0 :  $$ = cat_str(2,$1,$2);
    2516             : }
    2517             : | 
    2518             :  { 
    2519           0 :  $$=EMPTY; }
    2520             : ;
    2521             : 
    2522             : 
    2523             :  schema_stmt:
    2524             :  CreateStmt
    2525             :  { 
    2526           0 :  $$ = $1;
    2527             : }
    2528             : |  IndexStmt
    2529             :  { 
    2530           0 :  $$ = $1;
    2531             : }
    2532             : |  CreateSeqStmt
    2533             :  { 
    2534           0 :  $$ = $1;
    2535             : }
    2536             : |  CreateTrigStmt
    2537             :  { 
    2538           0 :  $$ = $1;
    2539             : }
    2540             : |  GrantStmt
    2541             :  { 
    2542           0 :  $$ = $1;
    2543             : }
    2544             : |  ViewStmt
    2545             :  { 
    2546           0 :  $$ = $1;
    2547             : }
    2548             : ;
    2549             : 
    2550             : 
    2551             :  VariableSetStmt:
    2552             :  SET set_rest
    2553             :  { 
    2554          46 :  $$ = cat_str(2,mm_strdup("set"),$2);
    2555             : }
    2556             : |  SET LOCAL set_rest
    2557             :  { 
    2558           0 :  $$ = cat_str(2,mm_strdup("set local"),$3);
    2559             : }
    2560             : |  SET SESSION set_rest
    2561             :  { 
    2562           0 :  $$ = cat_str(2,mm_strdup("set session"),$3);
    2563             : }
    2564             : ;
    2565             : 
    2566             : 
    2567             :  set_rest:
    2568             :  TRANSACTION transaction_mode_list
    2569             :  { 
    2570           2 :  $$ = cat_str(2,mm_strdup("transaction"),$2);
    2571             : }
    2572             : |  SESSION CHARACTERISTICS AS TRANSACTION transaction_mode_list
    2573             :  { 
    2574           0 :  $$ = cat_str(2,mm_strdup("session characteristics as transaction"),$5);
    2575             : }
    2576             : |  set_rest_more
    2577             :  { 
    2578          44 :  $$ = $1;
    2579             : }
    2580             : ;
    2581             : 
    2582             : 
    2583             :  generic_set:
    2584             :  var_name TO var_list
    2585             :  { 
    2586          40 :  $$ = cat_str(3,$1,mm_strdup("to"),$3);
    2587             : }
    2588             : |  var_name '=' var_list
    2589             :  { 
    2590           2 :  $$ = cat_str(3,$1,mm_strdup("="),$3);
    2591             : }
    2592             : |  var_name TO DEFAULT
    2593             :  { 
    2594           0 :  $$ = cat_str(2,$1,mm_strdup("to default"));
    2595             : }
    2596             : |  var_name '=' DEFAULT
    2597             :  { 
    2598           0 :  $$ = cat_str(2,$1,mm_strdup("= default"));
    2599             : }
    2600             : ;
    2601             : 
    2602             : 
    2603             :  set_rest_more:
    2604             :  generic_set
    2605             :  { 
    2606          42 :  $$ = $1;
    2607             : }
    2608             : |  var_name FROM CURRENT_P
    2609             :  { 
    2610           0 :  $$ = cat_str(2,$1,mm_strdup("from current"));
    2611             : }
    2612             : |  TIME ZONE zone_value
    2613             :  { 
    2614           2 :  $$ = cat_str(2,mm_strdup("time zone"),$3);
    2615             : }
    2616             : |  CATALOG_P ecpg_sconst
    2617             :  { 
    2618           0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
    2619           0 :  $$ = cat_str(2,mm_strdup("catalog"),$2);
    2620             : }
    2621             : |  SCHEMA ecpg_sconst
    2622             :  { 
    2623           0 :  $$ = cat_str(2,mm_strdup("schema"),$2);
    2624             : }
    2625             : |  NAMES opt_encoding
    2626             :  { 
    2627           0 :  $$ = cat_str(2,mm_strdup("names"),$2);
    2628             : }
    2629             : |  ROLE NonReservedWord_or_Sconst
    2630             :  { 
    2631           0 :  $$ = cat_str(2,mm_strdup("role"),$2);
    2632             : }
    2633             : |  SESSION AUTHORIZATION NonReservedWord_or_Sconst
    2634             :  { 
    2635           0 :  $$ = cat_str(2,mm_strdup("session authorization"),$3);
    2636             : }
    2637             : |  SESSION AUTHORIZATION DEFAULT
    2638             :  { 
    2639           0 :  $$ = mm_strdup("session authorization default");
    2640             : }
    2641             : |  XML_P OPTION document_or_content
    2642             :  { 
    2643           0 :  $$ = cat_str(2,mm_strdup("xml option"),$3);
    2644             : }
    2645             : |  TRANSACTION SNAPSHOT ecpg_sconst
    2646             :  { 
    2647           0 :  $$ = cat_str(2,mm_strdup("transaction snapshot"),$3);
    2648             : }
    2649             : ;
    2650             : 
    2651             : 
    2652             :  var_name:
    2653             : ECPGColId
    2654             :  { 
    2655          52 :  $$ = $1;
    2656             : }
    2657             : |  var_name '.' ColId
    2658             :  { 
    2659           0 :  $$ = cat_str(3,$1,mm_strdup("."),$3);
    2660             : }
    2661             : ;
    2662             : 
    2663             : 
    2664             :  var_list:
    2665             :  var_value
    2666             :  { 
    2667          42 :  $$ = $1;
    2668             : }
    2669             : |  var_list ',' var_value
    2670             :  { 
    2671           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    2672             : }
    2673             : ;
    2674             : 
    2675             : 
    2676             :  var_value:
    2677             :  opt_boolean_or_string
    2678             :  { 
    2679          40 :  $$ = $1;
    2680             : }
    2681             : |  NumericOnly
    2682             :  { 
    2683           2 :         if ($1[0] == '$')
    2684             :         {
    2685           2 :             free($1);
    2686           2 :             $1 = mm_strdup("$0");
    2687             :         }
    2688             : 
    2689           2 :  $$ = $1;
    2690             : }
    2691             : ;
    2692             : 
    2693             : 
    2694             :  iso_level:
    2695             :  READ UNCOMMITTED
    2696             :  { 
    2697           0 :  $$ = mm_strdup("read uncommitted");
    2698             : }
    2699             : |  READ COMMITTED
    2700             :  { 
    2701           2 :  $$ = mm_strdup("read committed");
    2702             : }
    2703             : |  REPEATABLE READ
    2704             :  { 
    2705           0 :  $$ = mm_strdup("repeatable read");
    2706             : }
    2707             : |  SERIALIZABLE
    2708             :  { 
    2709           0 :  $$ = mm_strdup("serializable");
    2710             : }
    2711             : ;
    2712             : 
    2713             : 
    2714             :  opt_boolean_or_string:
    2715             :  TRUE_P
    2716             :  { 
    2717           0 :  $$ = mm_strdup("true");
    2718             : }
    2719             : |  FALSE_P
    2720             :  { 
    2721           0 :  $$ = mm_strdup("false");
    2722             : }
    2723             : |  ON
    2724             :  { 
    2725           4 :  $$ = mm_strdup("on");
    2726             : }
    2727             : |  NonReservedWord_or_Sconst
    2728             :  { 
    2729          36 :  $$ = $1;
    2730             : }
    2731             : ;
    2732             : 
    2733             : 
    2734             :  zone_value:
    2735             :  ecpg_sconst
    2736             :  { 
    2737           0 :  $$ = $1;
    2738             : }
    2739             : |  ecpg_ident
    2740             :  { 
    2741           2 :  $$ = $1;
    2742             : }
    2743             : |  ConstInterval ecpg_sconst opt_interval
    2744             :  { 
    2745           0 :  $$ = cat_str(3,$1,$2,$3);
    2746             : }
    2747             : |  ConstInterval '(' Iconst ')' ecpg_sconst
    2748             :  { 
    2749           0 :  $$ = cat_str(5,$1,mm_strdup("("),$3,mm_strdup(")"),$5);
    2750             : }
    2751             : |  NumericOnly
    2752             :  { 
    2753           0 :  $$ = $1;
    2754             : }
    2755             : |  DEFAULT
    2756             :  { 
    2757           0 :  $$ = mm_strdup("default");
    2758             : }
    2759             : |  LOCAL
    2760             :  { 
    2761           0 :  $$ = mm_strdup("local");
    2762             : }
    2763             : ;
    2764             : 
    2765             : 
    2766             :  opt_encoding:
    2767             :  ecpg_sconst
    2768             :  { 
    2769           0 :  $$ = $1;
    2770             : }
    2771             : |  DEFAULT
    2772             :  { 
    2773           0 :  $$ = mm_strdup("default");
    2774             : }
    2775             : | 
    2776             :  { 
    2777           0 :  $$=EMPTY; }
    2778             : ;
    2779             : 
    2780             : 
    2781             :  NonReservedWord_or_Sconst:
    2782             :  NonReservedWord
    2783             :  { 
    2784          32 :  $$ = $1;
    2785             : }
    2786             : |  ecpg_sconst
    2787             :  { 
    2788           6 :  $$ = $1;
    2789             : }
    2790             : ;
    2791             : 
    2792             : 
    2793             :  VariableResetStmt:
    2794             :  RESET reset_rest
    2795             :  { 
    2796           0 :  $$ = cat_str(2,mm_strdup("reset"),$2);
    2797             : }
    2798             : ;
    2799             : 
    2800             : 
    2801             :  reset_rest:
    2802             :  generic_reset
    2803             :  { 
    2804           0 :  $$ = $1;
    2805             : }
    2806             : |  TIME ZONE
    2807             :  { 
    2808           0 :  $$ = mm_strdup("time zone");
    2809             : }
    2810             : |  TRANSACTION ISOLATION LEVEL
    2811             :  { 
    2812           0 :  $$ = mm_strdup("transaction isolation level");
    2813             : }
    2814             : |  SESSION AUTHORIZATION
    2815             :  { 
    2816           0 :  $$ = mm_strdup("session authorization");
    2817             : }
    2818             : ;
    2819             : 
    2820             : 
    2821             :  generic_reset:
    2822             :  var_name
    2823             :  { 
    2824           0 :  $$ = $1;
    2825             : }
    2826             : |  ALL
    2827             :  { 
    2828           0 :  $$ = mm_strdup("all");
    2829             : }
    2830             : ;
    2831             : 
    2832             : 
    2833             :  SetResetClause:
    2834             :  SET set_rest
    2835             :  { 
    2836           0 :  $$ = cat_str(2,mm_strdup("set"),$2);
    2837             : }
    2838             : |  VariableResetStmt
    2839             :  { 
    2840           0 :  $$ = $1;
    2841             : }
    2842             : ;
    2843             : 
    2844             : 
    2845             :  FunctionSetResetClause:
    2846             :  SET set_rest_more
    2847             :  { 
    2848           0 :  $$ = cat_str(2,mm_strdup("set"),$2);
    2849             : }
    2850             : |  VariableResetStmt
    2851             :  { 
    2852           0 :  $$ = $1;
    2853             : }
    2854             : ;
    2855             : 
    2856             : 
    2857             :  VariableShowStmt:
    2858             : SHOW var_name ecpg_into
    2859             :  { 
    2860          10 :  $$ = cat_str(2,mm_strdup("show"),$2);
    2861             : }
    2862             : | SHOW TIME ZONE ecpg_into
    2863             :  { 
    2864           2 :  $$ = mm_strdup("show time zone");
    2865             : }
    2866             : | SHOW TRANSACTION ISOLATION LEVEL ecpg_into
    2867             :  { 
    2868           2 :  $$ = mm_strdup("show transaction isolation level");
    2869             : }
    2870             : | SHOW SESSION AUTHORIZATION ecpg_into
    2871             :  { 
    2872           0 :  $$ = mm_strdup("show session authorization");
    2873             : }
    2874             : |  SHOW ALL
    2875             :     {
    2876           0 :         mmerror(PARSE_ERROR, ET_ERROR, "SHOW ALL is not implemented");
    2877           0 :         $$ = EMPTY;
    2878             :     }
    2879             : ;
    2880             : 
    2881             : 
    2882             :  ConstraintsSetStmt:
    2883             :  SET CONSTRAINTS constraints_set_list constraints_set_mode
    2884             :  { 
    2885           0 :  $$ = cat_str(3,mm_strdup("set constraints"),$3,$4);
    2886             : }
    2887             : ;
    2888             : 
    2889             : 
    2890             :  constraints_set_list:
    2891             :  ALL
    2892             :  { 
    2893           0 :  $$ = mm_strdup("all");
    2894             : }
    2895             : |  qualified_name_list
    2896             :  { 
    2897           0 :  $$ = $1;
    2898             : }
    2899             : ;
    2900             : 
    2901             : 
    2902             :  constraints_set_mode:
    2903             :  DEFERRED
    2904             :  { 
    2905           0 :  $$ = mm_strdup("deferred");
    2906             : }
    2907             : |  IMMEDIATE
    2908             :  { 
    2909           0 :  $$ = mm_strdup("immediate");
    2910             : }
    2911             : ;
    2912             : 
    2913             : 
    2914             :  CheckPointStmt:
    2915             :  CHECKPOINT
    2916             :  { 
    2917           0 :  $$ = mm_strdup("checkpoint");
    2918             : }
    2919             : ;
    2920             : 
    2921             : 
    2922             :  DiscardStmt:
    2923             :  DISCARD ALL
    2924             :  { 
    2925           0 :  $$ = mm_strdup("discard all");
    2926             : }
    2927             : |  DISCARD TEMP
    2928             :  { 
    2929           0 :  $$ = mm_strdup("discard temp");
    2930             : }
    2931             : |  DISCARD TEMPORARY
    2932             :  { 
    2933           0 :  $$ = mm_strdup("discard temporary");
    2934             : }
    2935             : |  DISCARD PLANS
    2936             :  { 
    2937           0 :  $$ = mm_strdup("discard plans");
    2938             : }
    2939             : |  DISCARD SEQUENCES
    2940             :  { 
    2941           0 :  $$ = mm_strdup("discard sequences");
    2942             : }
    2943             : ;
    2944             : 
    2945             : 
    2946             :  AlterTableStmt:
    2947             :  ALTER TABLE relation_expr alter_table_cmds
    2948             :  { 
    2949           4 :  $$ = cat_str(3,mm_strdup("alter table"),$3,$4);
    2950             : }
    2951             : |  ALTER TABLE IF_P EXISTS relation_expr alter_table_cmds
    2952             :  { 
    2953           0 :  $$ = cat_str(3,mm_strdup("alter table if exists"),$5,$6);
    2954             : }
    2955             : |  ALTER TABLE relation_expr partition_cmd
    2956             :  { 
    2957           0 :  $$ = cat_str(3,mm_strdup("alter table"),$3,$4);
    2958             : }
    2959             : |  ALTER TABLE IF_P EXISTS relation_expr partition_cmd
    2960             :  { 
    2961           0 :  $$ = cat_str(3,mm_strdup("alter table if exists"),$5,$6);
    2962             : }
    2963             : |  ALTER TABLE ALL IN_P TABLESPACE name SET TABLESPACE name opt_nowait
    2964             :  { 
    2965           0 :  $$ = cat_str(5,mm_strdup("alter table all in tablespace"),$6,mm_strdup("set tablespace"),$9,$10);
    2966             : }
    2967             : |  ALTER TABLE ALL IN_P TABLESPACE name OWNED BY role_list SET TABLESPACE name opt_nowait
    2968             :  { 
    2969           0 :  $$ = cat_str(7,mm_strdup("alter table all in tablespace"),$6,mm_strdup("owned by"),$9,mm_strdup("set tablespace"),$12,$13);
    2970             : }
    2971             : |  ALTER INDEX qualified_name alter_table_cmds
    2972             :  { 
    2973           0 :  $$ = cat_str(3,mm_strdup("alter index"),$3,$4);
    2974             : }
    2975             : |  ALTER INDEX IF_P EXISTS qualified_name alter_table_cmds
    2976             :  { 
    2977           0 :  $$ = cat_str(3,mm_strdup("alter index if exists"),$5,$6);
    2978             : }
    2979             : |  ALTER INDEX qualified_name index_partition_cmd
    2980             :  { 
    2981           0 :  $$ = cat_str(3,mm_strdup("alter index"),$3,$4);
    2982             : }
    2983             : |  ALTER INDEX ALL IN_P TABLESPACE name SET TABLESPACE name opt_nowait
    2984             :  { 
    2985           0 :  $$ = cat_str(5,mm_strdup("alter index all in tablespace"),$6,mm_strdup("set tablespace"),$9,$10);
    2986             : }
    2987             : |  ALTER INDEX ALL IN_P TABLESPACE name OWNED BY role_list SET TABLESPACE name opt_nowait
    2988             :  { 
    2989           0 :  $$ = cat_str(7,mm_strdup("alter index all in tablespace"),$6,mm_strdup("owned by"),$9,mm_strdup("set tablespace"),$12,$13);
    2990             : }
    2991             : |  ALTER SEQUENCE qualified_name alter_table_cmds
    2992             :  { 
    2993           0 :  $$ = cat_str(3,mm_strdup("alter sequence"),$3,$4);
    2994             : }
    2995             : |  ALTER SEQUENCE IF_P EXISTS qualified_name alter_table_cmds
    2996             :  { 
    2997           0 :  $$ = cat_str(3,mm_strdup("alter sequence if exists"),$5,$6);
    2998             : }
    2999             : |  ALTER VIEW qualified_name alter_table_cmds
    3000             :  { 
    3001           0 :  $$ = cat_str(3,mm_strdup("alter view"),$3,$4);
    3002             : }
    3003             : |  ALTER VIEW IF_P EXISTS qualified_name alter_table_cmds
    3004             :  { 
    3005           0 :  $$ = cat_str(3,mm_strdup("alter view if exists"),$5,$6);
    3006             : }
    3007             : |  ALTER MATERIALIZED VIEW qualified_name alter_table_cmds
    3008             :  { 
    3009           0 :  $$ = cat_str(3,mm_strdup("alter materialized view"),$4,$5);
    3010             : }
    3011             : |  ALTER MATERIALIZED VIEW IF_P EXISTS qualified_name alter_table_cmds
    3012             :  { 
    3013           0 :  $$ = cat_str(3,mm_strdup("alter materialized view if exists"),$6,$7);
    3014             : }
    3015             : |  ALTER MATERIALIZED VIEW ALL IN_P TABLESPACE name SET TABLESPACE name opt_nowait
    3016             :  { 
    3017           0 :  $$ = cat_str(5,mm_strdup("alter materialized view all in tablespace"),$7,mm_strdup("set tablespace"),$10,$11);
    3018             : }
    3019             : |  ALTER MATERIALIZED VIEW ALL IN_P TABLESPACE name OWNED BY role_list SET TABLESPACE name opt_nowait
    3020             :  { 
    3021           0 :  $$ = cat_str(7,mm_strdup("alter materialized view all in tablespace"),$7,mm_strdup("owned by"),$10,mm_strdup("set tablespace"),$13,$14);
    3022             : }
    3023             : |  ALTER FOREIGN TABLE relation_expr alter_table_cmds
    3024             :  { 
    3025           0 :  $$ = cat_str(3,mm_strdup("alter foreign table"),$4,$5);
    3026             : }
    3027             : |  ALTER FOREIGN TABLE IF_P EXISTS relation_expr alter_table_cmds
    3028             :  { 
    3029           0 :  $$ = cat_str(3,mm_strdup("alter foreign table if exists"),$6,$7);
    3030             : }
    3031             : ;
    3032             : 
    3033             : 
    3034             :  alter_table_cmds:
    3035             :  alter_table_cmd
    3036             :  { 
    3037           4 :  $$ = $1;
    3038             : }
    3039             : |  alter_table_cmds ',' alter_table_cmd
    3040             :  { 
    3041           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    3042             : }
    3043             : ;
    3044             : 
    3045             : 
    3046             :  partition_cmd:
    3047             :  ATTACH PARTITION qualified_name PartitionBoundSpec
    3048             :  { 
    3049           0 :  $$ = cat_str(3,mm_strdup("attach partition"),$3,$4);
    3050             : }
    3051             : |  DETACH PARTITION qualified_name opt_concurrently
    3052             :  { 
    3053           0 :  $$ = cat_str(3,mm_strdup("detach partition"),$3,$4);
    3054             : }
    3055             : |  DETACH PARTITION qualified_name FINALIZE
    3056             :  { 
    3057           0 :  $$ = cat_str(3,mm_strdup("detach partition"),$3,mm_strdup("finalize"));
    3058             : }
    3059             : ;
    3060             : 
    3061             : 
    3062             :  index_partition_cmd:
    3063             :  ATTACH PARTITION qualified_name
    3064             :  { 
    3065           0 :  $$ = cat_str(2,mm_strdup("attach partition"),$3);
    3066             : }
    3067             : ;
    3068             : 
    3069             : 
    3070             :  alter_table_cmd:
    3071             :  ADD_P columnDef
    3072             :  { 
    3073           0 :  $$ = cat_str(2,mm_strdup("add"),$2);
    3074             : }
    3075             : |  ADD_P IF_P NOT EXISTS columnDef
    3076             :  { 
    3077           0 :  $$ = cat_str(2,mm_strdup("add if not exists"),$5);
    3078             : }
    3079             : |  ADD_P COLUMN columnDef
    3080             :  { 
    3081           0 :  $$ = cat_str(2,mm_strdup("add column"),$3);
    3082             : }
    3083             : |  ADD_P COLUMN IF_P NOT EXISTS columnDef
    3084             :  { 
    3085           0 :  $$ = cat_str(2,mm_strdup("add column if not exists"),$6);
    3086             : }
    3087             : |  ALTER opt_column ColId alter_column_default
    3088             :  { 
    3089           0 :  $$ = cat_str(4,mm_strdup("alter"),$2,$3,$4);
    3090             : }
    3091             : |  ALTER opt_column ColId DROP NOT NULL_P
    3092             :  { 
    3093           0 :  $$ = cat_str(4,mm_strdup("alter"),$2,$3,mm_strdup("drop not null"));
    3094             : }
    3095             : |  ALTER opt_column ColId SET NOT NULL_P
    3096             :  { 
    3097           0 :  $$ = cat_str(4,mm_strdup("alter"),$2,$3,mm_strdup("set not null"));
    3098             : }
    3099             : |  ALTER opt_column ColId SET EXPRESSION AS '(' a_expr ')'
    3100             :  { 
    3101           0 :  $$ = cat_str(6,mm_strdup("alter"),$2,$3,mm_strdup("set expression as ("),$8,mm_strdup(")"));
    3102             : }
    3103             : |  ALTER opt_column ColId DROP EXPRESSION
    3104             :  { 
    3105           0 :  $$ = cat_str(4,mm_strdup("alter"),$2,$3,mm_strdup("drop expression"));
    3106             : }
    3107             : |  ALTER opt_column ColId DROP EXPRESSION IF_P EXISTS
    3108             :  { 
    3109           0 :  $$ = cat_str(4,mm_strdup("alter"),$2,$3,mm_strdup("drop expression if exists"));
    3110             : }
    3111             : |  ALTER opt_column ColId SET STATISTICS set_statistics_value
    3112             :  { 
    3113           0 :  $$ = cat_str(5,mm_strdup("alter"),$2,$3,mm_strdup("set statistics"),$6);
    3114             : }
    3115             : |  ALTER opt_column Iconst SET STATISTICS set_statistics_value
    3116             :  { 
    3117           0 :  $$ = cat_str(5,mm_strdup("alter"),$2,$3,mm_strdup("set statistics"),$6);
    3118             : }
    3119             : |  ALTER opt_column ColId SET reloptions
    3120             :  { 
    3121           0 :  $$ = cat_str(5,mm_strdup("alter"),$2,$3,mm_strdup("set"),$5);
    3122             : }
    3123             : |  ALTER opt_column ColId RESET reloptions
    3124             :  { 
    3125           0 :  $$ = cat_str(5,mm_strdup("alter"),$2,$3,mm_strdup("reset"),$5);
    3126             : }
    3127             : |  ALTER opt_column ColId SET column_storage
    3128             :  { 
    3129           0 :  $$ = cat_str(5,mm_strdup("alter"),$2,$3,mm_strdup("set"),$5);
    3130             : }
    3131             : |  ALTER opt_column ColId SET column_compression
    3132             :  { 
    3133           0 :  $$ = cat_str(5,mm_strdup("alter"),$2,$3,mm_strdup("set"),$5);
    3134             : }
    3135             : |  ALTER opt_column ColId ADD_P GENERATED generated_when AS IDENTITY_P OptParenthesizedSeqOptList
    3136             :  { 
    3137           0 :  $$ = cat_str(7,mm_strdup("alter"),$2,$3,mm_strdup("add generated"),$6,mm_strdup("as identity"),$9);
    3138             : }
    3139             : |  ALTER opt_column ColId alter_identity_column_option_list
    3140             :  { 
    3141           0 :  $$ = cat_str(4,mm_strdup("alter"),$2,$3,$4);
    3142             : }
    3143             : |  ALTER opt_column ColId DROP IDENTITY_P
    3144             :  { 
    3145           0 :  $$ = cat_str(4,mm_strdup("alter"),$2,$3,mm_strdup("drop identity"));
    3146             : }
    3147             : |  ALTER opt_column ColId DROP IDENTITY_P IF_P EXISTS
    3148             :  { 
    3149           0 :  $$ = cat_str(4,mm_strdup("alter"),$2,$3,mm_strdup("drop identity if exists"));
    3150             : }
    3151             : |  DROP opt_column IF_P EXISTS ColId opt_drop_behavior
    3152             :  { 
    3153           0 :  $$ = cat_str(5,mm_strdup("drop"),$2,mm_strdup("if exists"),$5,$6);
    3154             : }
    3155             : |  DROP opt_column ColId opt_drop_behavior
    3156             :  { 
    3157           0 :  $$ = cat_str(4,mm_strdup("drop"),$2,$3,$4);
    3158             : }
    3159             : |  ALTER opt_column ColId opt_set_data TYPE_P Typename opt_collate_clause alter_using
    3160             :  { 
    3161           4 :  $$ = cat_str(8,mm_strdup("alter"),$2,$3,$4,mm_strdup("type"),$6,$7,$8);
    3162             : }
    3163             : |  ALTER opt_column ColId alter_generic_options
    3164             :  { 
    3165           0 :  $$ = cat_str(4,mm_strdup("alter"),$2,$3,$4);
    3166             : }
    3167             : |  ADD_P TableConstraint
    3168             :  { 
    3169           0 :  $$ = cat_str(2,mm_strdup("add"),$2);
    3170             : }
    3171             : |  ALTER CONSTRAINT name ConstraintAttributeSpec
    3172             :  { 
    3173           0 :  $$ = cat_str(3,mm_strdup("alter constraint"),$3,$4);
    3174             : }
    3175             : |  VALIDATE CONSTRAINT name
    3176             :  { 
    3177           0 :  $$ = cat_str(2,mm_strdup("validate constraint"),$3);
    3178             : }
    3179             : |  DROP CONSTRAINT IF_P EXISTS name opt_drop_behavior
    3180             :  { 
    3181           0 :  $$ = cat_str(3,mm_strdup("drop constraint if exists"),$5,$6);
    3182             : }
    3183             : |  DROP CONSTRAINT name opt_drop_behavior
    3184             :  { 
    3185           0 :  $$ = cat_str(3,mm_strdup("drop constraint"),$3,$4);
    3186             : }
    3187             : |  SET WITHOUT OIDS
    3188             :  { 
    3189           0 :  $$ = mm_strdup("set without oids");
    3190             : }
    3191             : |  CLUSTER ON name
    3192             :  { 
    3193           0 :  $$ = cat_str(2,mm_strdup("cluster on"),$3);
    3194             : }
    3195             : |  SET WITHOUT CLUSTER
    3196             :  { 
    3197           0 :  $$ = mm_strdup("set without cluster");
    3198             : }
    3199             : |  SET LOGGED
    3200             :  { 
    3201           0 :  $$ = mm_strdup("set logged");
    3202             : }
    3203             : |  SET UNLOGGED
    3204             :  { 
    3205           0 :  $$ = mm_strdup("set unlogged");
    3206             : }
    3207             : |  ENABLE_P TRIGGER name
    3208             :  { 
    3209           0 :  $$ = cat_str(2,mm_strdup("enable trigger"),$3);
    3210             : }
    3211             : |  ENABLE_P ALWAYS TRIGGER name
    3212             :  { 
    3213           0 :  $$ = cat_str(2,mm_strdup("enable always trigger"),$4);
    3214             : }
    3215             : |  ENABLE_P REPLICA TRIGGER name
    3216             :  { 
    3217           0 :  $$ = cat_str(2,mm_strdup("enable replica trigger"),$4);
    3218             : }
    3219             : |  ENABLE_P TRIGGER ALL
    3220             :  { 
    3221           0 :  $$ = mm_strdup("enable trigger all");
    3222             : }
    3223             : |  ENABLE_P TRIGGER USER
    3224             :  { 
    3225           0 :  $$ = mm_strdup("enable trigger user");
    3226             : }
    3227             : |  DISABLE_P TRIGGER name
    3228             :  { 
    3229           0 :  $$ = cat_str(2,mm_strdup("disable trigger"),$3);
    3230             : }
    3231             : |  DISABLE_P TRIGGER ALL
    3232             :  { 
    3233           0 :  $$ = mm_strdup("disable trigger all");
    3234             : }
    3235             : |  DISABLE_P TRIGGER USER
    3236             :  { 
    3237           0 :  $$ = mm_strdup("disable trigger user");
    3238             : }
    3239             : |  ENABLE_P RULE name
    3240             :  { 
    3241           0 :  $$ = cat_str(2,mm_strdup("enable rule"),$3);
    3242             : }
    3243             : |  ENABLE_P ALWAYS RULE name
    3244             :  { 
    3245           0 :  $$ = cat_str(2,mm_strdup("enable always rule"),$4);
    3246             : }
    3247             : |  ENABLE_P REPLICA RULE name
    3248             :  { 
    3249           0 :  $$ = cat_str(2,mm_strdup("enable replica rule"),$4);
    3250             : }
    3251             : |  DISABLE_P RULE name
    3252             :  { 
    3253           0 :  $$ = cat_str(2,mm_strdup("disable rule"),$3);
    3254             : }
    3255             : |  INHERIT qualified_name
    3256             :  { 
    3257           0 :  $$ = cat_str(2,mm_strdup("inherit"),$2);
    3258             : }
    3259             : |  NO INHERIT qualified_name
    3260             :  { 
    3261           0 :  $$ = cat_str(2,mm_strdup("no inherit"),$3);
    3262             : }
    3263             : |  OF any_name
    3264             :  { 
    3265           0 :  $$ = cat_str(2,mm_strdup("of"),$2);
    3266             : }
    3267             : |  NOT OF
    3268             :  { 
    3269           0 :  $$ = mm_strdup("not of");
    3270             : }
    3271             : |  OWNER TO RoleSpec
    3272             :  { 
    3273           0 :  $$ = cat_str(2,mm_strdup("owner to"),$3);
    3274             : }
    3275             : |  SET ACCESS METHOD set_access_method_name
    3276             :  { 
    3277           0 :  $$ = cat_str(2,mm_strdup("set access method"),$4);
    3278             : }
    3279             : |  SET TABLESPACE name
    3280             :  { 
    3281           0 :  $$ = cat_str(2,mm_strdup("set tablespace"),$3);
    3282             : }
    3283             : |  SET reloptions
    3284             :  { 
    3285           0 :  $$ = cat_str(2,mm_strdup("set"),$2);
    3286             : }
    3287             : |  RESET reloptions
    3288             :  { 
    3289           0 :  $$ = cat_str(2,mm_strdup("reset"),$2);
    3290             : }
    3291             : |  REPLICA IDENTITY_P replica_identity
    3292             :  { 
    3293           0 :  $$ = cat_str(2,mm_strdup("replica identity"),$3);
    3294             : }
    3295             : |  ENABLE_P ROW LEVEL SECURITY
    3296             :  { 
    3297           0 :  $$ = mm_strdup("enable row level security");
    3298             : }
    3299             : |  DISABLE_P ROW LEVEL SECURITY
    3300             :  { 
    3301           0 :  $$ = mm_strdup("disable row level security");
    3302             : }
    3303             : |  FORCE ROW LEVEL SECURITY
    3304             :  { 
    3305           0 :  $$ = mm_strdup("force row level security");
    3306             : }
    3307             : |  NO FORCE ROW LEVEL SECURITY
    3308             :  { 
    3309           0 :  $$ = mm_strdup("no force row level security");
    3310             : }
    3311             : |  alter_generic_options
    3312             :  { 
    3313           0 :  $$ = $1;
    3314             : }
    3315             : ;
    3316             : 
    3317             : 
    3318             :  alter_column_default:
    3319             :  SET DEFAULT a_expr
    3320             :  { 
    3321           0 :  $$ = cat_str(2,mm_strdup("set default"),$3);
    3322             : }
    3323             : |  DROP DEFAULT
    3324             :  { 
    3325           0 :  $$ = mm_strdup("drop default");
    3326             : }
    3327             : ;
    3328             : 
    3329             : 
    3330             :  opt_collate_clause:
    3331             :  COLLATE any_name
    3332             :  { 
    3333           0 :  $$ = cat_str(2,mm_strdup("collate"),$2);
    3334             : }
    3335             : | 
    3336             :  { 
    3337           4 :  $$=EMPTY; }
    3338             : ;
    3339             : 
    3340             : 
    3341             :  alter_using:
    3342             :  USING a_expr
    3343             :  { 
    3344           0 :  $$ = cat_str(2,mm_strdup("using"),$2);
    3345             : }
    3346             : | 
    3347             :  { 
    3348           4 :  $$=EMPTY; }
    3349             : ;
    3350             : 
    3351             : 
    3352             :  replica_identity:
    3353             :  NOTHING
    3354             :  { 
    3355           0 :  $$ = mm_strdup("nothing");
    3356             : }
    3357             : |  FULL
    3358             :  { 
    3359           0 :  $$ = mm_strdup("full");
    3360             : }
    3361             : |  DEFAULT
    3362             :  { 
    3363           0 :  $$ = mm_strdup("default");
    3364             : }
    3365             : |  USING INDEX name
    3366             :  { 
    3367           0 :  $$ = cat_str(2,mm_strdup("using index"),$3);
    3368             : }
    3369             : ;
    3370             : 
    3371             : 
    3372             :  reloptions:
    3373             :  '(' reloption_list ')'
    3374             :  { 
    3375           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
    3376             : }
    3377             : ;
    3378             : 
    3379             : 
    3380             :  opt_reloptions:
    3381             :  WITH reloptions
    3382             :  { 
    3383           0 :  $$ = cat_str(2,mm_strdup("with"),$2);
    3384             : }
    3385             : | 
    3386             :  { 
    3387           0 :  $$=EMPTY; }
    3388             : ;
    3389             : 
    3390             : 
    3391             :  reloption_list:
    3392             :  reloption_elem
    3393             :  { 
    3394           0 :  $$ = $1;
    3395             : }
    3396             : |  reloption_list ',' reloption_elem
    3397             :  { 
    3398           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    3399             : }
    3400             : ;
    3401             : 
    3402             : 
    3403             :  reloption_elem:
    3404             :  ColLabel '=' def_arg
    3405             :  { 
    3406           0 :  $$ = cat_str(3,$1,mm_strdup("="),$3);
    3407             : }
    3408             : |  ColLabel
    3409             :  { 
    3410           0 :  $$ = $1;
    3411             : }
    3412             : |  ColLabel '.' ColLabel '=' def_arg
    3413             :  { 
    3414           0 :  $$ = cat_str(5,$1,mm_strdup("."),$3,mm_strdup("="),$5);
    3415             : }
    3416             : |  ColLabel '.' ColLabel
    3417             :  { 
    3418           0 :  $$ = cat_str(3,$1,mm_strdup("."),$3);
    3419             : }
    3420             : ;
    3421             : 
    3422             : 
    3423             :  alter_identity_column_option_list:
    3424             :  alter_identity_column_option
    3425             :  { 
    3426           0 :  $$ = $1;
    3427             : }
    3428             : |  alter_identity_column_option_list alter_identity_column_option
    3429             :  { 
    3430           0 :  $$ = cat_str(2,$1,$2);
    3431             : }
    3432             : ;
    3433             : 
    3434             : 
    3435             :  alter_identity_column_option:
    3436             :  RESTART
    3437             :  { 
    3438           0 :  $$ = mm_strdup("restart");
    3439             : }
    3440             : |  RESTART opt_with NumericOnly
    3441             :  { 
    3442           0 :  $$ = cat_str(3,mm_strdup("restart"),$2,$3);
    3443             : }
    3444             : |  SET SeqOptElem
    3445             :  { 
    3446           0 :  $$ = cat_str(2,mm_strdup("set"),$2);
    3447             : }
    3448             : |  SET GENERATED generated_when
    3449             :  { 
    3450           0 :  $$ = cat_str(2,mm_strdup("set generated"),$3);
    3451             : }
    3452             : ;
    3453             : 
    3454             : 
    3455             :  set_statistics_value:
    3456             :  SignedIconst
    3457             :  { 
    3458           0 :  $$ = $1;
    3459             : }
    3460             : |  DEFAULT
    3461             :  { 
    3462           0 :  $$ = mm_strdup("default");
    3463             : }
    3464             : ;
    3465             : 
    3466             : 
    3467             :  set_access_method_name:
    3468             :  ColId
    3469             :  { 
    3470           0 :  $$ = $1;
    3471             : }
    3472             : |  DEFAULT
    3473             :  { 
    3474           0 :  $$ = mm_strdup("default");
    3475             : }
    3476             : ;
    3477             : 
    3478             : 
    3479             :  PartitionBoundSpec:
    3480             :  FOR VALUES WITH '(' hash_partbound ')'
    3481             :  { 
    3482           0 :  $$ = cat_str(3,mm_strdup("for values with ("),$5,mm_strdup(")"));
    3483             : }
    3484             : |  FOR VALUES IN_P '(' expr_list ')'
    3485             :  { 
    3486           0 :  $$ = cat_str(3,mm_strdup("for values in ("),$5,mm_strdup(")"));
    3487             : }
    3488             : |  FOR VALUES FROM '(' expr_list ')' TO '(' expr_list ')'
    3489             :  { 
    3490           0 :  $$ = cat_str(5,mm_strdup("for values from ("),$5,mm_strdup(") to ("),$9,mm_strdup(")"));
    3491             : }
    3492             : |  DEFAULT
    3493             :  { 
    3494           0 :  $$ = mm_strdup("default");
    3495             : }
    3496             : ;
    3497             : 
    3498             : 
    3499             :  hash_partbound_elem:
    3500             :  NonReservedWord Iconst
    3501             :  { 
    3502           0 :  $$ = cat_str(2,$1,$2);
    3503             : }
    3504             : ;
    3505             : 
    3506             : 
    3507             :  hash_partbound:
    3508             :  hash_partbound_elem
    3509             :  { 
    3510           0 :  $$ = $1;
    3511             : }
    3512             : |  hash_partbound ',' hash_partbound_elem
    3513             :  { 
    3514           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    3515             : }
    3516             : ;
    3517             : 
    3518             : 
    3519             :  AlterCompositeTypeStmt:
    3520             :  ALTER TYPE_P any_name alter_type_cmds
    3521             :  { 
    3522           0 :  $$ = cat_str(3,mm_strdup("alter type"),$3,$4);
    3523             : }
    3524             : ;
    3525             : 
    3526             : 
    3527             :  alter_type_cmds:
    3528             :  alter_type_cmd
    3529             :  { 
    3530           0 :  $$ = $1;
    3531             : }
    3532             : |  alter_type_cmds ',' alter_type_cmd
    3533             :  { 
    3534           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    3535             : }
    3536             : ;
    3537             : 
    3538             : 
    3539             :  alter_type_cmd:
    3540             :  ADD_P ATTRIBUTE TableFuncElement opt_drop_behavior
    3541             :  { 
    3542           0 :  $$ = cat_str(3,mm_strdup("add attribute"),$3,$4);
    3543             : }
    3544             : |  DROP ATTRIBUTE IF_P EXISTS ColId opt_drop_behavior
    3545             :  { 
    3546           0 :  $$ = cat_str(3,mm_strdup("drop attribute if exists"),$5,$6);
    3547             : }
    3548             : |  DROP ATTRIBUTE ColId opt_drop_behavior
    3549             :  { 
    3550           0 :  $$ = cat_str(3,mm_strdup("drop attribute"),$3,$4);
    3551             : }
    3552             : |  ALTER ATTRIBUTE ColId opt_set_data TYPE_P Typename opt_collate_clause opt_drop_behavior
    3553             :  { 
    3554           0 :  $$ = cat_str(7,mm_strdup("alter attribute"),$3,$4,mm_strdup("type"),$6,$7,$8);
    3555             : }
    3556             : ;
    3557             : 
    3558             : 
    3559             :  ClosePortalStmt:
    3560             :  CLOSE cursor_name
    3561             :     {
    3562          76 :         char *cursor_marker = $2[0] == ':' ? mm_strdup("$0") : $2;
    3563          76 :         struct cursor *ptr = NULL;
    3564          80 :         for (ptr = cur; ptr != NULL; ptr = ptr -> next)
    3565             :         {
    3566          76 :             if (strcmp($2, ptr -> name) == 0)
    3567             :             {
    3568          72 :                 if (ptr -> connection)
    3569          16 :                     connection = mm_strdup(ptr -> connection);
    3570             : 
    3571          72 :                 break;
    3572             :             }
    3573             :         }
    3574          76 :         $$ = cat2_str(mm_strdup("close"), cursor_marker);
    3575             :     }
    3576             : |  CLOSE ALL
    3577             :  { 
    3578           0 :  $$ = mm_strdup("close all");
    3579             : }
    3580             : ;
    3581             : 
    3582             : 
    3583             :  CopyStmt:
    3584             :  COPY opt_binary qualified_name opt_column_list copy_from opt_program copy_file_name copy_delimiter opt_with copy_options where_clause
    3585             :  { 
    3586           2 :             if (strcmp($6, "from") == 0 &&
    3587           0 :                (strcmp($7, "stdin") == 0 || strcmp($7, "stdout") == 0))
    3588           0 :                 mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented");
    3589             : 
    3590           2 :  $$ = cat_str(11,mm_strdup("copy"),$2,$3,$4,$5,$6,$7,$8,$9,$10,$11);
    3591             : }
    3592             : |  COPY '(' PreparableStmt ')' TO opt_program copy_file_name opt_with copy_options
    3593             :  { 
    3594           0 :  $$ = cat_str(7,mm_strdup("copy ("),$3,mm_strdup(") to"),$6,$7,$8,$9);
    3595             : }
    3596             : ;
    3597             : 
    3598             : 
    3599             :  copy_from:
    3600             :  FROM
    3601             :  { 
    3602           0 :  $$ = mm_strdup("from");
    3603             : }
    3604             : |  TO
    3605             :  { 
    3606           2 :  $$ = mm_strdup("to");
    3607             : }
    3608             : ;
    3609             : 
    3610             : 
    3611             :  opt_program:
    3612             :  PROGRAM
    3613             :  { 
    3614           0 :  $$ = mm_strdup("program");
    3615             : }
    3616             : | 
    3617             :  { 
    3618           2 :  $$=EMPTY; }
    3619             : ;
    3620             : 
    3621             : 
    3622             :  copy_file_name:
    3623             :  ecpg_sconst
    3624             :  { 
    3625           0 :  $$ = $1;
    3626             : }
    3627             : |  STDIN
    3628             :  { 
    3629           0 :  $$ = mm_strdup("stdin");
    3630             : }
    3631             : |  STDOUT
    3632             :  { 
    3633           2 :  $$ = mm_strdup("stdout");
    3634             : }
    3635             : ;
    3636             : 
    3637             : 
    3638             :  copy_options:
    3639             :  copy_opt_list
    3640             :  { 
    3641           2 :  $$ = $1;
    3642             : }
    3643             : |  '(' copy_generic_opt_list ')'
    3644             :  { 
    3645           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
    3646             : }
    3647             : ;
    3648             : 
    3649             : 
    3650             :  copy_opt_list:
    3651             :  copy_opt_list copy_opt_item
    3652             :  { 
    3653           2 :  $$ = cat_str(2,$1,$2);
    3654             : }
    3655             : | 
    3656             :  { 
    3657           2 :  $$=EMPTY; }
    3658             : ;
    3659             : 
    3660             : 
    3661             :  copy_opt_item:
    3662             :  BINARY
    3663             :  { 
    3664           0 :  $$ = mm_strdup("binary");
    3665             : }
    3666             : |  FREEZE
    3667             :  { 
    3668           0 :  $$ = mm_strdup("freeze");
    3669             : }
    3670             : |  DELIMITER opt_as ecpg_sconst
    3671             :  { 
    3672           2 :  $$ = cat_str(3,mm_strdup("delimiter"),$2,$3);
    3673             : }
    3674             : |  NULL_P opt_as ecpg_sconst
    3675             :  { 
    3676           0 :  $$ = cat_str(3,mm_strdup("null"),$2,$3);
    3677             : }
    3678             : |  CSV
    3679             :  { 
    3680           0 :  $$ = mm_strdup("csv");
    3681             : }
    3682             : |  HEADER_P
    3683             :  { 
    3684           0 :  $$ = mm_strdup("header");
    3685             : }
    3686             : |  QUOTE opt_as ecpg_sconst
    3687             :  { 
    3688           0 :  $$ = cat_str(3,mm_strdup("quote"),$2,$3);
    3689             : }
    3690             : |  ESCAPE opt_as ecpg_sconst
    3691             :  { 
    3692           0 :  $$ = cat_str(3,mm_strdup("escape"),$2,$3);
    3693             : }
    3694             : |  FORCE QUOTE columnList
    3695             :  { 
    3696           0 :  $$ = cat_str(2,mm_strdup("force quote"),$3);
    3697             : }
    3698             : |  FORCE QUOTE '*'
    3699             :  { 
    3700           0 :  $$ = mm_strdup("force quote *");
    3701             : }
    3702             : |  FORCE NOT NULL_P columnList
    3703             :  { 
    3704           0 :  $$ = cat_str(2,mm_strdup("force not null"),$4);
    3705             : }
    3706             : |  FORCE NOT NULL_P '*'
    3707             :  { 
    3708           0 :  $$ = mm_strdup("force not null *");
    3709             : }
    3710             : |  FORCE NULL_P columnList
    3711             :  { 
    3712           0 :  $$ = cat_str(2,mm_strdup("force null"),$3);
    3713             : }
    3714             : |  FORCE NULL_P '*'
    3715             :  { 
    3716           0 :  $$ = mm_strdup("force null *");
    3717             : }
    3718             : |  ENCODING ecpg_sconst
    3719             :  { 
    3720           0 :  $$ = cat_str(2,mm_strdup("encoding"),$2);
    3721             : }
    3722             : ;
    3723             : 
    3724             : 
    3725             :  opt_binary:
    3726             :  BINARY
    3727             :  { 
    3728           0 :  $$ = mm_strdup("binary");
    3729             : }
    3730             : | 
    3731             :  { 
    3732           2 :  $$=EMPTY; }
    3733             : ;
    3734             : 
    3735             : 
    3736             :  copy_delimiter:
    3737             :  opt_using DELIMITERS ecpg_sconst
    3738             :  { 
    3739           0 :  $$ = cat_str(3,$1,mm_strdup("delimiters"),$3);
    3740             : }
    3741             : | 
    3742             :  { 
    3743           2 :  $$=EMPTY; }
    3744             : ;
    3745             : 
    3746             : 
    3747             :  opt_using:
    3748             :  USING
    3749             :  { 
    3750           0 :  $$ = mm_strdup("using");
    3751             : }
    3752             : | 
    3753             :  { 
    3754           0 :  $$=EMPTY; }
    3755             : ;
    3756             : 
    3757             : 
    3758             :  copy_generic_opt_list:
    3759             :  copy_generic_opt_elem
    3760             :  { 
    3761           0 :  $$ = $1;
    3762             : }
    3763             : |  copy_generic_opt_list ',' copy_generic_opt_elem
    3764             :  { 
    3765           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    3766             : }
    3767             : ;
    3768             : 
    3769             : 
    3770             :  copy_generic_opt_elem:
    3771             :  ColLabel copy_generic_opt_arg
    3772             :  { 
    3773           0 :  $$ = cat_str(2,$1,$2);
    3774             : }
    3775             : ;
    3776             : 
    3777             : 
    3778             :  copy_generic_opt_arg:
    3779             :  opt_boolean_or_string
    3780             :  { 
    3781           0 :  $$ = $1;
    3782             : }
    3783             : |  NumericOnly
    3784             :  { 
    3785           0 :  $$ = $1;
    3786             : }
    3787             : |  '*'
    3788             :  { 
    3789           0 :  $$ = mm_strdup("*");
    3790             : }
    3791             : |  '(' copy_generic_opt_arg_list ')'
    3792             :  { 
    3793           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
    3794             : }
    3795             : | 
    3796             :  { 
    3797           0 :  $$=EMPTY; }
    3798             : ;
    3799             : 
    3800             : 
    3801             :  copy_generic_opt_arg_list:
    3802             :  copy_generic_opt_arg_list_item
    3803             :  { 
    3804           0 :  $$ = $1;
    3805             : }
    3806             : |  copy_generic_opt_arg_list ',' copy_generic_opt_arg_list_item
    3807             :  { 
    3808           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    3809             : }
    3810             : ;
    3811             : 
    3812             : 
    3813             :  copy_generic_opt_arg_list_item:
    3814             :  opt_boolean_or_string
    3815             :  { 
    3816           0 :  $$ = $1;
    3817             : }
    3818             : ;
    3819             : 
    3820             : 
    3821             :  CreateStmt:
    3822             :  CREATE OptTemp TABLE qualified_name '(' OptTableElementList ')' OptInherit OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace
    3823             :  { 
    3824          98 :  $$ = cat_str(13,mm_strdup("create"),$2,mm_strdup("table"),$4,mm_strdup("("),$6,mm_strdup(")"),$8,$9,$10,$11,$12,$13);
    3825             : }
    3826             : |  CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name '(' OptTableElementList ')' OptInherit OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace
    3827             :  { 
    3828           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);
    3829             : }
    3830             : |  CREATE OptTemp TABLE qualified_name OF any_name OptTypedTableElementList OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace
    3831             :  { 
    3832           0 :  $$ = cat_str(12,mm_strdup("create"),$2,mm_strdup("table"),$4,mm_strdup("of"),$6,$7,$8,$9,$10,$11,$12);
    3833             : }
    3834             : |  CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name OF any_name OptTypedTableElementList OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace
    3835             :  { 
    3836           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);
    3837             : }
    3838             : |  CREATE OptTemp TABLE qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace
    3839             :  { 
    3840           0 :  $$ = cat_str(13,mm_strdup("create"),$2,mm_strdup("table"),$4,mm_strdup("partition of"),$7,$8,$9,$10,$11,$12,$13,$14);
    3841             : }
    3842             : |  CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace
    3843             :  { 
    3844           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);
    3845             : }
    3846             : ;
    3847             : 
    3848             : 
    3849             :  OptTemp:
    3850             :  TEMPORARY
    3851             :  { 
    3852           0 :  $$ = mm_strdup("temporary");
    3853             : }
    3854             : |  TEMP
    3855             :  { 
    3856           0 :  $$ = mm_strdup("temp");
    3857             : }
    3858             : |  LOCAL TEMPORARY
    3859             :  { 
    3860           0 :  $$ = mm_strdup("local temporary");
    3861             : }
    3862             : |  LOCAL TEMP
    3863             :  { 
    3864           0 :  $$ = mm_strdup("local temp");
    3865             : }
    3866             : |  GLOBAL TEMPORARY
    3867             :  { 
    3868           0 :  $$ = mm_strdup("global temporary");
    3869             : }
    3870             : |  GLOBAL TEMP
    3871             :  { 
    3872           0 :  $$ = mm_strdup("global temp");
    3873             : }
    3874             : |  UNLOGGED
    3875             :  { 
    3876           0 :  $$ = mm_strdup("unlogged");
    3877             : }
    3878             : | 
    3879             :  { 
    3880         104 :  $$=EMPTY; }
    3881             : ;
    3882             : 
    3883             : 
    3884             :  OptTableElementList:
    3885             :  TableElementList
    3886             :  { 
    3887         100 :  $$ = $1;
    3888             : }
    3889             : | 
    3890             :  { 
    3891           0 :  $$=EMPTY; }
    3892             : ;
    3893             : 
    3894             : 
    3895             :  OptTypedTableElementList:
    3896             :  '(' TypedTableElementList ')'
    3897             :  { 
    3898           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
    3899             : }
    3900             : | 
    3901             :  { 
    3902           0 :  $$=EMPTY; }
    3903             : ;
    3904             : 
    3905             : 
    3906             :  TableElementList:
    3907             :  TableElement
    3908             :  { 
    3909         100 :  $$ = $1;
    3910             : }
    3911             : |  TableElementList ',' TableElement
    3912             :  { 
    3913         212 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    3914             : }
    3915             : ;
    3916             : 
    3917             : 
    3918             :  TypedTableElementList:
    3919             :  TypedTableElement
    3920             :  { 
    3921           0 :  $$ = $1;
    3922             : }
    3923             : |  TypedTableElementList ',' TypedTableElement
    3924             :  { 
    3925           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    3926             : }
    3927             : ;
    3928             : 
    3929             : 
    3930             :  TableElement:
    3931             :  columnDef
    3932             :  { 
    3933         308 :  $$ = $1;
    3934             : }
    3935             : |  TableLikeClause
    3936             :  { 
    3937           0 :  $$ = $1;
    3938             : }
    3939             : |  TableConstraint
    3940             :  { 
    3941           4 :  $$ = $1;
    3942             : }
    3943             : ;
    3944             : 
    3945             : 
    3946             :  TypedTableElement:
    3947             :  columnOptions
    3948             :  { 
    3949           0 :  $$ = $1;
    3950             : }
    3951             : |  TableConstraint
    3952             :  { 
    3953           0 :  $$ = $1;
    3954             : }
    3955             : ;
    3956             : 
    3957             : 
    3958             :  columnDef:
    3959             :  ColId Typename opt_column_storage opt_column_compression create_generic_options ColQualList
    3960             :  { 
    3961         308 :  $$ = cat_str(6,$1,$2,$3,$4,$5,$6);
    3962             : }
    3963             : ;
    3964             : 
    3965             : 
    3966             :  columnOptions:
    3967             :  ColId ColQualList
    3968             :  { 
    3969           0 :  $$ = cat_str(2,$1,$2);
    3970             : }
    3971             : |  ColId WITH OPTIONS ColQualList
    3972             :  { 
    3973           0 :  $$ = cat_str(3,$1,mm_strdup("with options"),$4);
    3974             : }
    3975             : ;
    3976             : 
    3977             : 
    3978             :  column_compression:
    3979             :  COMPRESSION ColId
    3980             :  { 
    3981           0 :  $$ = cat_str(2,mm_strdup("compression"),$2);
    3982             : }
    3983             : |  COMPRESSION DEFAULT
    3984             :  { 
    3985           0 :  $$ = mm_strdup("compression default");
    3986             : }
    3987             : ;
    3988             : 
    3989             : 
    3990             :  opt_column_compression:
    3991             :  column_compression
    3992             :  { 
    3993           0 :  $$ = $1;
    3994             : }
    3995             : | 
    3996             :  { 
    3997         308 :  $$=EMPTY; }
    3998             : ;
    3999             : 
    4000             : 
    4001             :  column_storage:
    4002             :  STORAGE ColId
    4003             :  { 
    4004           0 :  $$ = cat_str(2,mm_strdup("storage"),$2);
    4005             : }
    4006             : |  STORAGE DEFAULT
    4007             :  { 
    4008           0 :  $$ = mm_strdup("storage default");
    4009             : }
    4010             : ;
    4011             : 
    4012             : 
    4013             :  opt_column_storage:
    4014             :  column_storage
    4015             :  { 
    4016           0 :  $$ = $1;
    4017             : }
    4018             : | 
    4019             :  { 
    4020         308 :  $$=EMPTY; }
    4021             : ;
    4022             : 
    4023             : 
    4024             :  ColQualList:
    4025             :  ColQualList ColConstraint
    4026             :  { 
    4027          38 :  $$ = cat_str(2,$1,$2);
    4028             : }
    4029             : | 
    4030             :  { 
    4031         308 :  $$=EMPTY; }
    4032             : ;
    4033             : 
    4034             : 
    4035             :  ColConstraint:
    4036             :  CONSTRAINT name ColConstraintElem
    4037             :  { 
    4038           0 :  $$ = cat_str(3,mm_strdup("constraint"),$2,$3);
    4039             : }
    4040             : |  ColConstraintElem
    4041             :  { 
    4042          38 :  $$ = $1;
    4043             : }
    4044             : |  ConstraintAttr
    4045             :  { 
    4046           0 :  $$ = $1;
    4047             : }
    4048             : |  COLLATE any_name
    4049             :  { 
    4050           0 :  $$ = cat_str(2,mm_strdup("collate"),$2);
    4051             : }
    4052             : ;
    4053             : 
    4054             : 
    4055             :  ColConstraintElem:
    4056             :  NOT NULL_P opt_no_inherit
    4057             :  { 
    4058          16 :  $$ = cat_str(2,mm_strdup("not null"),$3);
    4059             : }
    4060             : |  NULL_P
    4061             :  { 
    4062           2 :  $$ = mm_strdup("null");
    4063             : }
    4064             : |  UNIQUE opt_unique_null_treatment opt_definition OptConsTableSpace
    4065             :  { 
    4066           0 :  $$ = cat_str(4,mm_strdup("unique"),$2,$3,$4);
    4067             : }
    4068             : |  PRIMARY KEY opt_definition OptConsTableSpace
    4069             :  { 
    4070          16 :  $$ = cat_str(3,mm_strdup("primary key"),$3,$4);
    4071             : }
    4072             : |  CHECK '(' a_expr ')' opt_no_inherit
    4073             :  { 
    4074           0 :  $$ = cat_str(4,mm_strdup("check ("),$3,mm_strdup(")"),$5);
    4075             : }
    4076             : |  DEFAULT b_expr
    4077             :  { 
    4078           4 :  $$ = cat_str(2,mm_strdup("default"),$2);
    4079             : }
    4080             : |  GENERATED generated_when AS IDENTITY_P OptParenthesizedSeqOptList
    4081             :  { 
    4082           0 :  $$ = cat_str(4,mm_strdup("generated"),$2,mm_strdup("as identity"),$5);
    4083             : }
    4084             : |  GENERATED generated_when AS '(' a_expr ')' STORED
    4085             :  { 
    4086           0 :  $$ = cat_str(5,mm_strdup("generated"),$2,mm_strdup("as ("),$5,mm_strdup(") stored"));
    4087             : }
    4088             : |  REFERENCES qualified_name opt_column_list key_match key_actions
    4089             :  { 
    4090           0 :  $$ = cat_str(5,mm_strdup("references"),$2,$3,$4,$5);
    4091             : }
    4092             : ;
    4093             : 
    4094             : 
    4095             :  opt_unique_null_treatment:
    4096             :  NULLS_P DISTINCT
    4097             :  { 
    4098           0 :  $$ = mm_strdup("nulls distinct");
    4099             : }
    4100             : |  NULLS_P NOT DISTINCT
    4101             :  { 
    4102           0 :  $$ = mm_strdup("nulls not distinct");
    4103             : }
    4104             : | 
    4105             :  { 
    4106           0 :  $$=EMPTY; }
    4107             : ;
    4108             : 
    4109             : 
    4110             :  generated_when:
    4111             :  ALWAYS
    4112             :  { 
    4113           0 :  $$ = mm_strdup("always");
    4114             : }
    4115             : |  BY DEFAULT
    4116             :  { 
    4117           0 :  $$ = mm_strdup("by default");
    4118             : }
    4119             : ;
    4120             : 
    4121             : 
    4122             :  ConstraintAttr:
    4123             :  DEFERRABLE
    4124             :  { 
    4125           0 :  $$ = mm_strdup("deferrable");
    4126             : }
    4127             : |  NOT DEFERRABLE
    4128             :  { 
    4129           0 :  $$ = mm_strdup("not deferrable");
    4130             : }
    4131             : |  INITIALLY DEFERRED
    4132             :  { 
    4133           0 :  $$ = mm_strdup("initially deferred");
    4134             : }
    4135             : |  INITIALLY IMMEDIATE
    4136             :  { 
    4137           0 :  $$ = mm_strdup("initially immediate");
    4138             : }
    4139             : ;
    4140             : 
    4141             : 
    4142             :  TableLikeClause:
    4143             :  LIKE qualified_name TableLikeOptionList
    4144             :  { 
    4145           0 :  $$ = cat_str(3,mm_strdup("like"),$2,$3);
    4146             : }
    4147             : ;
    4148             : 
    4149             : 
    4150             :  TableLikeOptionList:
    4151             :  TableLikeOptionList INCLUDING TableLikeOption
    4152             :  { 
    4153           0 :  $$ = cat_str(3,$1,mm_strdup("including"),$3);
    4154             : }
    4155             : |  TableLikeOptionList EXCLUDING TableLikeOption
    4156             :  { 
    4157           0 :  $$ = cat_str(3,$1,mm_strdup("excluding"),$3);
    4158             : }
    4159             : | 
    4160             :  { 
    4161           0 :  $$=EMPTY; }
    4162             : ;
    4163             : 
    4164             : 
    4165             :  TableLikeOption:
    4166             :  COMMENTS
    4167             :  { 
    4168           0 :  $$ = mm_strdup("comments");
    4169             : }
    4170             : |  COMPRESSION
    4171             :  { 
    4172           0 :  $$ = mm_strdup("compression");
    4173             : }
    4174             : |  CONSTRAINTS
    4175             :  { 
    4176           0 :  $$ = mm_strdup("constraints");
    4177             : }
    4178             : |  DEFAULTS
    4179             :  { 
    4180           0 :  $$ = mm_strdup("defaults");
    4181             : }
    4182             : |  IDENTITY_P
    4183             :  { 
    4184           0 :  $$ = mm_strdup("identity");
    4185             : }
    4186             : |  GENERATED
    4187             :  { 
    4188           0 :  $$ = mm_strdup("generated");
    4189             : }
    4190             : |  INDEXES
    4191             :  { 
    4192           0 :  $$ = mm_strdup("indexes");
    4193             : }
    4194             : |  STATISTICS
    4195             :  { 
    4196           0 :  $$ = mm_strdup("statistics");
    4197             : }
    4198             : |  STORAGE
    4199             :  { 
    4200           0 :  $$ = mm_strdup("storage");
    4201             : }
    4202             : |  ALL
    4203             :  { 
    4204           0 :  $$ = mm_strdup("all");
    4205             : }
    4206             : ;
    4207             : 
    4208             : 
    4209             :  TableConstraint:
    4210             :  CONSTRAINT name ConstraintElem
    4211             :  { 
    4212           0 :  $$ = cat_str(3,mm_strdup("constraint"),$2,$3);
    4213             : }
    4214             : |  ConstraintElem
    4215             :  { 
    4216           4 :  $$ = $1;
    4217             : }
    4218             : ;
    4219             : 
    4220             : 
    4221             :  ConstraintElem:
    4222             :  CHECK '(' a_expr ')' ConstraintAttributeSpec
    4223             :  { 
    4224           0 :  $$ = cat_str(4,mm_strdup("check ("),$3,mm_strdup(")"),$5);
    4225             : }
    4226             : |  NOT NULL_P ColId ConstraintAttributeSpec
    4227             :  { 
    4228           0 :  $$ = cat_str(3,mm_strdup("not null"),$3,$4);
    4229             : }
    4230             : |  UNIQUE opt_unique_null_treatment '(' columnList opt_without_overlaps ')' opt_c_include opt_definition OptConsTableSpace ConstraintAttributeSpec
    4231             :  { 
    4232           0 :  $$ = cat_str(10,mm_strdup("unique"),$2,mm_strdup("("),$4,$5,mm_strdup(")"),$7,$8,$9,$10);
    4233             : }
    4234             : |  UNIQUE ExistingIndex ConstraintAttributeSpec
    4235             :  { 
    4236           0 :  $$ = cat_str(3,mm_strdup("unique"),$2,$3);
    4237             : }
    4238             : |  PRIMARY KEY '(' columnList opt_without_overlaps ')' opt_c_include opt_definition OptConsTableSpace ConstraintAttributeSpec
    4239             :  { 
    4240           4 :  $$ = cat_str(8,mm_strdup("primary key ("),$4,$5,mm_strdup(")"),$7,$8,$9,$10);
    4241             : }
    4242             : |  PRIMARY KEY ExistingIndex ConstraintAttributeSpec
    4243             :  { 
    4244           0 :  $$ = cat_str(3,mm_strdup("primary key"),$3,$4);
    4245             : }
    4246             : |  EXCLUDE access_method_clause '(' ExclusionConstraintList ')' opt_c_include opt_definition OptConsTableSpace OptWhereClause ConstraintAttributeSpec
    4247             :  { 
    4248           0 :  $$ = cat_str(10,mm_strdup("exclude"),$2,mm_strdup("("),$4,mm_strdup(")"),$6,$7,$8,$9,$10);
    4249             : }
    4250             : |  FOREIGN KEY '(' columnList optionalPeriodName ')' REFERENCES qualified_name opt_column_and_period_list key_match key_actions ConstraintAttributeSpec
    4251             :  { 
    4252           0 :  $$ = cat_str(9,mm_strdup("foreign key ("),$4,$5,mm_strdup(") references"),$8,$9,$10,$11,$12);
    4253             : }
    4254             : ;
    4255             : 
    4256             : 
    4257             :  opt_no_inherit:
    4258             :  NO INHERIT
    4259             :  { 
    4260           0 :  $$ = mm_strdup("no inherit");
    4261             : }
    4262             : | 
    4263             :  { 
    4264          16 :  $$=EMPTY; }
    4265             : ;
    4266             : 
    4267             : 
    4268             :  opt_without_overlaps:
    4269             :  WITHOUT OVERLAPS
    4270             :  { 
    4271           0 :  $$ = mm_strdup("without overlaps");
    4272             : }
    4273             : | 
    4274             :  { 
    4275           4 :  $$=EMPTY; }
    4276             : ;
    4277             : 
    4278             : 
    4279             :  opt_column_list:
    4280             :  '(' columnList ')'
    4281             :  { 
    4282           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
    4283             : }
    4284             : | 
    4285             :  { 
    4286           6 :  $$=EMPTY; }
    4287             : ;
    4288             : 
    4289             : 
    4290             :  columnList:
    4291             :  columnElem
    4292             :  { 
    4293           4 :  $$ = $1;
    4294             : }
    4295             : |  columnList ',' columnElem
    4296             :  { 
    4297           4 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    4298             : }
    4299             : ;
    4300             : 
    4301             : 
    4302             :  optionalPeriodName:
    4303             :  ',' PERIOD columnElem
    4304             :  { 
    4305           0 :  $$ = cat_str(2,mm_strdup(", period"),$3);
    4306             : }
    4307             : | 
    4308             :  { 
    4309           0 :  $$=EMPTY; }
    4310             : ;
    4311             : 
    4312             : 
    4313             :  opt_column_and_period_list:
    4314             :  '(' columnList optionalPeriodName ')'
    4315             :  { 
    4316           0 :  $$ = cat_str(4,mm_strdup("("),$2,$3,mm_strdup(")"));
    4317             : }
    4318             : | 
    4319             :  { 
    4320           0 :  $$=EMPTY; }
    4321             : ;
    4322             : 
    4323             : 
    4324             :  columnElem:
    4325             :  ColId
    4326             :  { 
    4327           8 :  $$ = $1;
    4328             : }
    4329             : ;
    4330             : 
    4331             : 
    4332             :  opt_c_include:
    4333             :  INCLUDE '(' columnList ')'
    4334             :  { 
    4335           0 :  $$ = cat_str(3,mm_strdup("include ("),$3,mm_strdup(")"));
    4336             : }
    4337             : | 
    4338             :  { 
    4339           4 :  $$=EMPTY; }
    4340             : ;
    4341             : 
    4342             : 
    4343             :  key_match:
    4344             :  MATCH FULL
    4345             :  { 
    4346           0 :  $$ = mm_strdup("match full");
    4347             : }
    4348             : |  MATCH PARTIAL
    4349             :  { 
    4350           0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
    4351           0 :  $$ = mm_strdup("match partial");
    4352             : }
    4353             : |  MATCH SIMPLE
    4354             :  { 
    4355           0 :  $$ = mm_strdup("match simple");
    4356             : }
    4357             : | 
    4358             :  { 
    4359           0 :  $$=EMPTY; }
    4360             : ;
    4361             : 
    4362             : 
    4363             :  ExclusionConstraintList:
    4364             :  ExclusionConstraintElem
    4365             :  { 
    4366           0 :  $$ = $1;
    4367             : }
    4368             : |  ExclusionConstraintList ',' ExclusionConstraintElem
    4369             :  { 
    4370           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    4371             : }
    4372             : ;
    4373             : 
    4374             : 
    4375             :  ExclusionConstraintElem:
    4376             :  index_elem WITH any_operator
    4377             :  { 
    4378           0 :  $$ = cat_str(3,$1,mm_strdup("with"),$3);
    4379             : }
    4380             : |  index_elem WITH OPERATOR '(' any_operator ')'
    4381             :  { 
    4382           0 :  $$ = cat_str(4,$1,mm_strdup("with operator ("),$5,mm_strdup(")"));
    4383             : }
    4384             : ;
    4385             : 
    4386             : 
    4387             :  OptWhereClause:
    4388             :  WHERE '(' a_expr ')'
    4389             :  { 
    4390           0 :  $$ = cat_str(3,mm_strdup("where ("),$3,mm_strdup(")"));
    4391             : }
    4392             : | 
    4393             :  { 
    4394           0 :  $$=EMPTY; }
    4395             : ;
    4396             : 
    4397             : 
    4398             :  key_actions:
    4399             :  key_update
    4400             :  { 
    4401           0 :  $$ = $1;
    4402             : }
    4403             : |  key_delete
    4404             :  { 
    4405           0 :  $$ = $1;
    4406             : }
    4407             : |  key_update key_delete
    4408             :  { 
    4409           0 :  $$ = cat_str(2,$1,$2);
    4410             : }
    4411             : |  key_delete key_update
    4412             :  { 
    4413           0 :  $$ = cat_str(2,$1,$2);
    4414             : }
    4415             : | 
    4416             :  { 
    4417           0 :  $$=EMPTY; }
    4418             : ;
    4419             : 
    4420             : 
    4421             :  key_update:
    4422             :  ON UPDATE key_action
    4423             :  { 
    4424           0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
    4425           0 :  $$ = cat_str(2,mm_strdup("on update"),$3);
    4426             : }
    4427             : ;
    4428             : 
    4429             : 
    4430             :  key_delete:
    4431             :  ON DELETE_P key_action
    4432             :  { 
    4433           0 :  $$ = cat_str(2,mm_strdup("on delete"),$3);
    4434             : }
    4435             : ;
    4436             : 
    4437             : 
    4438             :  key_action:
    4439             :  NO ACTION
    4440             :  { 
    4441           0 :  $$ = mm_strdup("no action");
    4442             : }
    4443             : |  RESTRICT
    4444             :  { 
    4445           0 :  $$ = mm_strdup("restrict");
    4446             : }
    4447             : |  CASCADE
    4448             :  { 
    4449           0 :  $$ = mm_strdup("cascade");
    4450             : }
    4451             : |  SET NULL_P opt_column_list
    4452             :  { 
    4453           0 :  $$ = cat_str(2,mm_strdup("set null"),$3);
    4454             : }
    4455             : |  SET DEFAULT opt_column_list
    4456             :  { 
    4457           0 :  $$ = cat_str(2,mm_strdup("set default"),$3);
    4458             : }
    4459             : ;
    4460             : 
    4461             : 
    4462             :  OptInherit:
    4463             :  INHERITS '(' qualified_name_list ')'
    4464             :  { 
    4465           0 :  $$ = cat_str(3,mm_strdup("inherits ("),$3,mm_strdup(")"));
    4466             : }
    4467             : | 
    4468             :  { 
    4469         100 :  $$=EMPTY; }
    4470             : ;
    4471             : 
    4472             : 
    4473             :  OptPartitionSpec:
    4474             :  PartitionSpec
    4475             :  { 
    4476           0 :  $$ = $1;
    4477             : }
    4478             : | 
    4479             :  { 
    4480         100 :  $$=EMPTY; }
    4481             : ;
    4482             : 
    4483             : 
    4484             :  PartitionSpec:
    4485             :  PARTITION BY ColId '(' part_params ')'
    4486             :  { 
    4487           0 :  $$ = cat_str(5,mm_strdup("partition by"),$3,mm_strdup("("),$5,mm_strdup(")"));
    4488             : }
    4489             : ;
    4490             : 
    4491             : 
    4492             :  part_params:
    4493             :  part_elem
    4494             :  { 
    4495           0 :  $$ = $1;
    4496             : }
    4497             : |  part_params ',' part_elem
    4498             :  { 
    4499           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    4500             : }
    4501             : ;
    4502             : 
    4503             : 
    4504             :  part_elem:
    4505             :  ColId opt_collate opt_qualified_name
    4506             :  { 
    4507           0 :  $$ = cat_str(3,$1,$2,$3);
    4508             : }
    4509             : |  func_expr_windowless opt_collate opt_qualified_name
    4510             :  { 
    4511           0 :  $$ = cat_str(3,$1,$2,$3);
    4512             : }
    4513             : |  '(' a_expr ')' opt_collate opt_qualified_name
    4514             :  { 
    4515           0 :  $$ = cat_str(5,mm_strdup("("),$2,mm_strdup(")"),$4,$5);
    4516             : }
    4517             : ;
    4518             : 
    4519             : 
    4520             :  table_access_method_clause:
    4521             :  USING name
    4522             :  { 
    4523           0 :  $$ = cat_str(2,mm_strdup("using"),$2);
    4524             : }
    4525             : | 
    4526             :  { 
    4527         104 :  $$=EMPTY; }
    4528             : ;
    4529             : 
    4530             : 
    4531             :  OptWith:
    4532             :  WITH reloptions
    4533             :  { 
    4534           0 :  $$ = cat_str(2,mm_strdup("with"),$2);
    4535             : }
    4536             : |  WITHOUT OIDS
    4537             :  { 
    4538           0 :  $$ = mm_strdup("without oids");
    4539             : }
    4540             : | 
    4541             :  { 
    4542         104 :  $$=EMPTY; }
    4543             : ;
    4544             : 
    4545             : 
    4546             :  OnCommitOption:
    4547             :  ON COMMIT DROP
    4548             :  { 
    4549           0 :  $$ = mm_strdup("on commit drop");
    4550             : }
    4551             : |  ON COMMIT DELETE_P ROWS
    4552             :  { 
    4553           0 :  $$ = mm_strdup("on commit delete rows");
    4554             : }
    4555             : |  ON COMMIT PRESERVE ROWS
    4556             :  { 
    4557           0 :  $$ = mm_strdup("on commit preserve rows");
    4558             : }
    4559             : | 
    4560             :  { 
    4561         104 :  $$=EMPTY; }
    4562             : ;
    4563             : 
    4564             : 
    4565             :  OptTableSpace:
    4566             :  TABLESPACE name
    4567             :  { 
    4568           0 :  $$ = cat_str(2,mm_strdup("tablespace"),$2);
    4569             : }
    4570             : | 
    4571             :  { 
    4572         104 :  $$=EMPTY; }
    4573             : ;
    4574             : 
    4575             : 
    4576             :  OptConsTableSpace:
    4577             :  USING INDEX TABLESPACE name
    4578             :  { 
    4579           0 :  $$ = cat_str(2,mm_strdup("using index tablespace"),$4);
    4580             : }
    4581             : | 
    4582             :  { 
    4583          20 :  $$=EMPTY; }
    4584             : ;
    4585             : 
    4586             : 
    4587             :  ExistingIndex:
    4588             :  USING INDEX name
    4589             :  { 
    4590           0 :  $$ = cat_str(2,mm_strdup("using index"),$3);
    4591             : }
    4592             : ;
    4593             : 
    4594             : 
    4595             :  CreateStatsStmt:
    4596             :  CREATE STATISTICS opt_qualified_name opt_name_list ON stats_params FROM from_list
    4597             :  { 
    4598           0 :  $$ = cat_str(7,mm_strdup("create statistics"),$3,$4,mm_strdup("on"),$6,mm_strdup("from"),$8);
    4599             : }
    4600             : |  CREATE STATISTICS IF_P NOT EXISTS any_name opt_name_list ON stats_params FROM from_list
    4601             :  { 
    4602           0 :  $$ = cat_str(7,mm_strdup("create statistics if not exists"),$6,$7,mm_strdup("on"),$9,mm_strdup("from"),$11);
    4603             : }
    4604             : ;
    4605             : 
    4606             : 
    4607             :  stats_params:
    4608             :  stats_param
    4609             :  { 
    4610           0 :  $$ = $1;
    4611             : }
    4612             : |  stats_params ',' stats_param
    4613             :  { 
    4614           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    4615             : }
    4616             : ;
    4617             : 
    4618             : 
    4619             :  stats_param:
    4620             :  ColId
    4621             :  { 
    4622           0 :  $$ = $1;
    4623             : }
    4624             : |  func_expr_windowless
    4625             :  { 
    4626           0 :  $$ = $1;
    4627             : }
    4628             : |  '(' a_expr ')'
    4629             :  { 
    4630           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
    4631             : }
    4632             : ;
    4633             : 
    4634             : 
    4635             :  AlterStatsStmt:
    4636             :  ALTER STATISTICS any_name SET STATISTICS set_statistics_value
    4637             :  { 
    4638           0 :  $$ = cat_str(4,mm_strdup("alter statistics"),$3,mm_strdup("set statistics"),$6);
    4639             : }
    4640             : |  ALTER STATISTICS IF_P EXISTS any_name SET STATISTICS set_statistics_value
    4641             :  { 
    4642           0 :  $$ = cat_str(4,mm_strdup("alter statistics if exists"),$5,mm_strdup("set statistics"),$8);
    4643             : }
    4644             : ;
    4645             : 
    4646             : 
    4647             :  create_as_target:
    4648             :  qualified_name opt_column_list table_access_method_clause OptWith OnCommitOption OptTableSpace
    4649             :  { 
    4650           4 :  $$ = cat_str(6,$1,$2,$3,$4,$5,$6);
    4651             : }
    4652             : ;
    4653             : 
    4654             : 
    4655             :  opt_with_data:
    4656             :  WITH DATA_P
    4657             :  { 
    4658           0 :  $$ = mm_strdup("with data");
    4659             : }
    4660             : |  WITH NO DATA_P
    4661             :  { 
    4662           2 :  $$ = mm_strdup("with no data");
    4663             : }
    4664             : | 
    4665             :  { 
    4666           2 :  $$=EMPTY; }
    4667             : ;
    4668             : 
    4669             : 
    4670             :  CreateMatViewStmt:
    4671             :  CREATE OptNoLog MATERIALIZED VIEW create_mv_target AS SelectStmt opt_with_data
    4672             :  { 
    4673           0 :  $$ = cat_str(7,mm_strdup("create"),$2,mm_strdup("materialized view"),$5,mm_strdup("as"),$7,$8);
    4674             : }
    4675             : |  CREATE OptNoLog MATERIALIZED VIEW IF_P NOT EXISTS create_mv_target AS SelectStmt opt_with_data
    4676             :  { 
    4677           0 :  $$ = cat_str(7,mm_strdup("create"),$2,mm_strdup("materialized view if not exists"),$8,mm_strdup("as"),$10,$11);
    4678             : }
    4679             : ;
    4680             : 
    4681             : 
    4682             :  create_mv_target:
    4683             :  qualified_name opt_column_list table_access_method_clause opt_reloptions OptTableSpace
    4684             :  { 
    4685           0 :  $$ = cat_str(5,$1,$2,$3,$4,$5);
    4686             : }
    4687             : ;
    4688             : 
    4689             : 
    4690             :  OptNoLog:
    4691             :  UNLOGGED
    4692             :  { 
    4693           0 :  $$ = mm_strdup("unlogged");
    4694             : }
    4695             : | 
    4696             :  { 
    4697           0 :  $$=EMPTY; }
    4698             : ;
    4699             : 
    4700             : 
    4701             :  RefreshMatViewStmt:
    4702             :  REFRESH MATERIALIZED VIEW opt_concurrently qualified_name opt_with_data
    4703             :  { 
    4704           0 :  $$ = cat_str(4,mm_strdup("refresh materialized view"),$4,$5,$6);
    4705             : }
    4706             : ;
    4707             : 
    4708             : 
    4709             :  CreateSeqStmt:
    4710             :  CREATE OptTemp SEQUENCE qualified_name OptSeqOptList
    4711             :  { 
    4712           0 :  $$ = cat_str(5,mm_strdup("create"),$2,mm_strdup("sequence"),$4,$5);
    4713             : }
    4714             : |  CREATE OptTemp SEQUENCE IF_P NOT EXISTS qualified_name OptSeqOptList
    4715             :  { 
    4716           0 :  $$ = cat_str(5,mm_strdup("create"),$2,mm_strdup("sequence if not exists"),$7,$8);
    4717             : }
    4718             : ;
    4719             : 
    4720             : 
    4721             :  AlterSeqStmt:
    4722             :  ALTER SEQUENCE qualified_name SeqOptList
    4723             :  { 
    4724           0 :  $$ = cat_str(3,mm_strdup("alter sequence"),$3,$4);
    4725             : }
    4726             : |  ALTER SEQUENCE IF_P EXISTS qualified_name SeqOptList
    4727             :  { 
    4728           0 :  $$ = cat_str(3,mm_strdup("alter sequence if exists"),$5,$6);
    4729             : }
    4730             : ;
    4731             : 
    4732             : 
    4733             :  OptSeqOptList:
    4734             :  SeqOptList
    4735             :  { 
    4736           0 :  $$ = $1;
    4737             : }
    4738             : | 
    4739             :  { 
    4740           0 :  $$=EMPTY; }
    4741             : ;
    4742             : 
    4743             : 
    4744             :  OptParenthesizedSeqOptList:
    4745             :  '(' SeqOptList ')'
    4746             :  { 
    4747           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
    4748             : }
    4749             : | 
    4750             :  { 
    4751           0 :  $$=EMPTY; }
    4752             : ;
    4753             : 
    4754             : 
    4755             :  SeqOptList:
    4756             :  SeqOptElem
    4757             :  { 
    4758           0 :  $$ = $1;
    4759             : }
    4760             : |  SeqOptList SeqOptElem
    4761             :  { 
    4762           0 :  $$ = cat_str(2,$1,$2);
    4763             : }
    4764             : ;
    4765             : 
    4766             : 
    4767             :  SeqOptElem:
    4768             :  AS SimpleTypename
    4769             :  { 
    4770           0 :  $$ = cat_str(2,mm_strdup("as"),$2);
    4771             : }
    4772             : |  CACHE NumericOnly
    4773             :  { 
    4774           0 :  $$ = cat_str(2,mm_strdup("cache"),$2);
    4775             : }
    4776             : |  CYCLE
    4777             :  { 
    4778           0 :  $$ = mm_strdup("cycle");
    4779             : }
    4780             : |  NO CYCLE
    4781             :  { 
    4782           0 :  $$ = mm_strdup("no cycle");
    4783             : }
    4784             : |  INCREMENT opt_by NumericOnly
    4785             :  { 
    4786           0 :  $$ = cat_str(3,mm_strdup("increment"),$2,$3);
    4787             : }
    4788             : |  MAXVALUE NumericOnly
    4789             :  { 
    4790           0 :  $$ = cat_str(2,mm_strdup("maxvalue"),$2);
    4791             : }
    4792             : |  MINVALUE NumericOnly
    4793             :  { 
    4794           0 :  $$ = cat_str(2,mm_strdup("minvalue"),$2);
    4795             : }
    4796             : |  NO MAXVALUE
    4797             :  { 
    4798           0 :  $$ = mm_strdup("no maxvalue");
    4799             : }
    4800             : |  NO MINVALUE
    4801             :  { 
    4802           0 :  $$ = mm_strdup("no minvalue");
    4803             : }
    4804             : |  OWNED BY any_name
    4805             :  { 
    4806           0 :  $$ = cat_str(2,mm_strdup("owned by"),$3);
    4807             : }
    4808             : |  SEQUENCE NAME_P any_name
    4809             :  { 
    4810           0 :  $$ = cat_str(2,mm_strdup("sequence name"),$3);
    4811             : }
    4812             : |  START opt_with NumericOnly
    4813             :  { 
    4814           0 :  $$ = cat_str(3,mm_strdup("start"),$2,$3);
    4815             : }
    4816             : |  RESTART
    4817             :  { 
    4818           0 :  $$ = mm_strdup("restart");
    4819             : }
    4820             : |  RESTART opt_with NumericOnly
    4821             :  { 
    4822           0 :  $$ = cat_str(3,mm_strdup("restart"),$2,$3);
    4823             : }
    4824             : ;
    4825             : 
    4826             : 
    4827             :  opt_by:
    4828             :  BY
    4829             :  { 
    4830           0 :  $$ = mm_strdup("by");
    4831             : }
    4832             : | 
    4833             :  { 
    4834           0 :  $$=EMPTY; }
    4835             : ;
    4836             : 
    4837             : 
    4838             :  NumericOnly:
    4839             :  ecpg_fconst
    4840             :  { 
    4841           0 :  $$ = $1;
    4842             : }
    4843             : |  '+' ecpg_fconst
    4844             :  { 
    4845           0 :  $$ = cat_str(2,mm_strdup("+"),$2);
    4846             : }
    4847             : |  '-' ecpg_fconst
    4848             :  { 
    4849           0 :  $$ = cat_str(2,mm_strdup("-"),$2);
    4850             : }
    4851             : |  SignedIconst
    4852             :  { 
    4853           6 :  $$ = $1;
    4854             : }
    4855             : ;
    4856             : 
    4857             : 
    4858             :  NumericOnly_list:
    4859             :  NumericOnly
    4860             :  { 
    4861           0 :  $$ = $1;
    4862             : }
    4863             : |  NumericOnly_list ',' NumericOnly
    4864             :  { 
    4865           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    4866             : }
    4867             : ;
    4868             : 
    4869             : 
    4870             :  CreatePLangStmt:
    4871             :  CREATE opt_or_replace opt_trusted opt_procedural LANGUAGE name
    4872             :  { 
    4873           0 :  $$ = cat_str(6,mm_strdup("create"),$2,$3,$4,mm_strdup("language"),$6);
    4874             : }
    4875             : |  CREATE opt_or_replace opt_trusted opt_procedural LANGUAGE name HANDLER handler_name opt_inline_handler opt_validator
    4876             :  { 
    4877           0 :  $$ = cat_str(10,mm_strdup("create"),$2,$3,$4,mm_strdup("language"),$6,mm_strdup("handler"),$8,$9,$10);
    4878             : }
    4879             : ;
    4880             : 
    4881             : 
    4882             :  opt_trusted:
    4883             :  TRUSTED
    4884             :  { 
    4885           0 :  $$ = mm_strdup("trusted");
    4886             : }
    4887             : | 
    4888             :  { 
    4889           0 :  $$=EMPTY; }
    4890             : ;
    4891             : 
    4892             : 
    4893             :  handler_name:
    4894             :  name
    4895             :  { 
    4896           0 :  $$ = $1;
    4897             : }
    4898             : |  name attrs
    4899             :  { 
    4900           0 :  $$ = cat_str(2,$1,$2);
    4901             : }
    4902             : ;
    4903             : 
    4904             : 
    4905             :  opt_inline_handler:
    4906             :  INLINE_P handler_name
    4907             :  { 
    4908           0 :  $$ = cat_str(2,mm_strdup("inline"),$2);
    4909             : }
    4910             : | 
    4911             :  { 
    4912           0 :  $$=EMPTY; }
    4913             : ;
    4914             : 
    4915             : 
    4916             :  validator_clause:
    4917             :  VALIDATOR handler_name
    4918             :  { 
    4919           0 :  $$ = cat_str(2,mm_strdup("validator"),$2);
    4920             : }
    4921             : |  NO VALIDATOR
    4922             :  { 
    4923           0 :  $$ = mm_strdup("no validator");
    4924             : }
    4925             : ;
    4926             : 
    4927             : 
    4928             :  opt_validator:
    4929             :  validator_clause
    4930             :  { 
    4931           0 :  $$ = $1;
    4932             : }
    4933             : | 
    4934             :  { 
    4935           0 :  $$=EMPTY; }
    4936             : ;
    4937             : 
    4938             : 
    4939             :  opt_procedural:
    4940             :  PROCEDURAL
    4941             :  { 
    4942           0 :  $$ = mm_strdup("procedural");
    4943             : }
    4944             : | 
    4945             :  { 
    4946           0 :  $$=EMPTY; }
    4947             : ;
    4948             : 
    4949             : 
    4950             :  CreateTableSpaceStmt:
    4951             :  CREATE TABLESPACE name OptTableSpaceOwner LOCATION ecpg_sconst opt_reloptions
    4952             :  { 
    4953           0 :  $$ = cat_str(6,mm_strdup("create tablespace"),$3,$4,mm_strdup("location"),$6,$7);
    4954             : }
    4955             : ;
    4956             : 
    4957             : 
    4958             :  OptTableSpaceOwner:
    4959             :  OWNER RoleSpec
    4960             :  { 
    4961           0 :  $$ = cat_str(2,mm_strdup("owner"),$2);
    4962             : }
    4963             : | 
    4964             :  { 
    4965           0 :  $$=EMPTY; }
    4966             : ;
    4967             : 
    4968             : 
    4969             :  DropTableSpaceStmt:
    4970             :  DROP TABLESPACE name
    4971             :  { 
    4972           0 :  $$ = cat_str(2,mm_strdup("drop tablespace"),$3);
    4973             : }
    4974             : |  DROP TABLESPACE IF_P EXISTS name
    4975             :  { 
    4976           0 :  $$ = cat_str(2,mm_strdup("drop tablespace if exists"),$5);
    4977             : }
    4978             : ;
    4979             : 
    4980             : 
    4981             :  CreateExtensionStmt:
    4982             :  CREATE EXTENSION name opt_with create_extension_opt_list
    4983             :  { 
    4984           0 :  $$ = cat_str(4,mm_strdup("create extension"),$3,$4,$5);
    4985             : }
    4986             : |  CREATE EXTENSION IF_P NOT EXISTS name opt_with create_extension_opt_list
    4987             :  { 
    4988           0 :  $$ = cat_str(4,mm_strdup("create extension if not exists"),$6,$7,$8);
    4989             : }
    4990             : ;
    4991             : 
    4992             : 
    4993             :  create_extension_opt_list:
    4994             :  create_extension_opt_list create_extension_opt_item
    4995             :  { 
    4996           0 :  $$ = cat_str(2,$1,$2);
    4997             : }
    4998             : | 
    4999             :  { 
    5000           0 :  $$=EMPTY; }
    5001             : ;
    5002             : 
    5003             : 
    5004             :  create_extension_opt_item:
    5005             :  SCHEMA name
    5006             :  { 
    5007           0 :  $$ = cat_str(2,mm_strdup("schema"),$2);
    5008             : }
    5009             : |  VERSION_P NonReservedWord_or_Sconst
    5010             :  { 
    5011           0 :  $$ = cat_str(2,mm_strdup("version"),$2);
    5012             : }
    5013             : |  FROM NonReservedWord_or_Sconst
    5014             :  { 
    5015           0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
    5016           0 :  $$ = cat_str(2,mm_strdup("from"),$2);
    5017             : }
    5018             : |  CASCADE
    5019             :  { 
    5020           0 :  $$ = mm_strdup("cascade");
    5021             : }
    5022             : ;
    5023             : 
    5024             : 
    5025             :  AlterExtensionStmt:
    5026             :  ALTER EXTENSION name UPDATE alter_extension_opt_list
    5027             :  { 
    5028           0 :  $$ = cat_str(4,mm_strdup("alter extension"),$3,mm_strdup("update"),$5);
    5029             : }
    5030             : ;
    5031             : 
    5032             : 
    5033             :  alter_extension_opt_list:
    5034             :  alter_extension_opt_list alter_extension_opt_item
    5035             :  { 
    5036           0 :  $$ = cat_str(2,$1,$2);
    5037             : }
    5038             : | 
    5039             :  { 
    5040           0 :  $$=EMPTY; }
    5041             : ;
    5042             : 
    5043             : 
    5044             :  alter_extension_opt_item:
    5045             :  TO NonReservedWord_or_Sconst
    5046             :  { 
    5047           0 :  $$ = cat_str(2,mm_strdup("to"),$2);
    5048             : }
    5049             : ;
    5050             : 
    5051             : 
    5052             :  AlterExtensionContentsStmt:
    5053             :  ALTER EXTENSION name add_drop object_type_name name
    5054             :  { 
    5055           0 :  $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,$5,$6);
    5056             : }
    5057             : |  ALTER EXTENSION name add_drop object_type_any_name any_name
    5058             :  { 
    5059           0 :  $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,$5,$6);
    5060             : }
    5061             : |  ALTER EXTENSION name add_drop AGGREGATE aggregate_with_argtypes
    5062             :  { 
    5063           0 :  $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,mm_strdup("aggregate"),$6);
    5064             : }
    5065             : |  ALTER EXTENSION name add_drop CAST '(' Typename AS Typename ')'
    5066             :  { 
    5067           0 :  $$ = cat_str(8,mm_strdup("alter extension"),$3,$4,mm_strdup("cast ("),$7,mm_strdup("as"),$9,mm_strdup(")"));
    5068             : }
    5069             : |  ALTER EXTENSION name add_drop DOMAIN_P Typename
    5070             :  { 
    5071           0 :  $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,mm_strdup("domain"),$6);
    5072             : }
    5073             : |  ALTER EXTENSION name add_drop FUNCTION function_with_argtypes
    5074             :  { 
    5075           0 :  $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,mm_strdup("function"),$6);
    5076             : }
    5077             : |  ALTER EXTENSION name add_drop OPERATOR operator_with_argtypes
    5078             :  { 
    5079           0 :  $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,mm_strdup("operator"),$6);
    5080             : }
    5081             : |  ALTER EXTENSION name add_drop OPERATOR CLASS any_name USING name
    5082             :  { 
    5083           0 :  $$ = cat_str(7,mm_strdup("alter extension"),$3,$4,mm_strdup("operator class"),$7,mm_strdup("using"),$9);
    5084             : }
    5085             : |  ALTER EXTENSION name add_drop OPERATOR FAMILY any_name USING name
    5086             :  { 
    5087           0 :  $$ = cat_str(7,mm_strdup("alter extension"),$3,$4,mm_strdup("operator family"),$7,mm_strdup("using"),$9);
    5088             : }
    5089             : |  ALTER EXTENSION name add_drop PROCEDURE function_with_argtypes
    5090             :  { 
    5091           0 :  $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,mm_strdup("procedure"),$6);
    5092             : }
    5093             : |  ALTER EXTENSION name add_drop ROUTINE function_with_argtypes
    5094             :  { 
    5095           0 :  $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,mm_strdup("routine"),$6);
    5096             : }
    5097             : |  ALTER EXTENSION name add_drop TRANSFORM FOR Typename LANGUAGE name
    5098             :  { 
    5099           0 :  $$ = cat_str(7,mm_strdup("alter extension"),$3,$4,mm_strdup("transform for"),$7,mm_strdup("language"),$9);
    5100             : }
    5101             : |  ALTER EXTENSION name add_drop TYPE_P Typename
    5102             :  { 
    5103           0 :  $$ = cat_str(5,mm_strdup("alter extension"),$3,$4,mm_strdup("type"),$6);
    5104             : }
    5105             : ;
    5106             : 
    5107             : 
    5108             :  CreateFdwStmt:
    5109             :  CREATE FOREIGN DATA_P WRAPPER name opt_fdw_options create_generic_options
    5110             :  { 
    5111           0 :  $$ = cat_str(4,mm_strdup("create foreign data wrapper"),$5,$6,$7);
    5112             : }
    5113             : ;
    5114             : 
    5115             : 
    5116             :  fdw_option:
    5117             :  HANDLER handler_name
    5118             :  { 
    5119           0 :  $$ = cat_str(2,mm_strdup("handler"),$2);
    5120             : }
    5121             : |  NO HANDLER
    5122             :  { 
    5123           0 :  $$ = mm_strdup("no handler");
    5124             : }
    5125             : |  VALIDATOR handler_name
    5126             :  { 
    5127           0 :  $$ = cat_str(2,mm_strdup("validator"),$2);
    5128             : }
    5129             : |  NO VALIDATOR
    5130             :  { 
    5131           0 :  $$ = mm_strdup("no validator");
    5132             : }
    5133             : ;
    5134             : 
    5135             : 
    5136             :  fdw_options:
    5137             :  fdw_option
    5138             :  { 
    5139           0 :  $$ = $1;
    5140             : }
    5141             : |  fdw_options fdw_option
    5142             :  { 
    5143           0 :  $$ = cat_str(2,$1,$2);
    5144             : }
    5145             : ;
    5146             : 
    5147             : 
    5148             :  opt_fdw_options:
    5149             :  fdw_options
    5150             :  { 
    5151           0 :  $$ = $1;
    5152             : }
    5153             : | 
    5154             :  { 
    5155           0 :  $$=EMPTY; }
    5156             : ;
    5157             : 
    5158             : 
    5159             :  AlterFdwStmt:
    5160             :  ALTER FOREIGN DATA_P WRAPPER name opt_fdw_options alter_generic_options
    5161             :  { 
    5162           0 :  $$ = cat_str(4,mm_strdup("alter foreign data wrapper"),$5,$6,$7);
    5163             : }
    5164             : |  ALTER FOREIGN DATA_P WRAPPER name fdw_options
    5165             :  { 
    5166           0 :  $$ = cat_str(3,mm_strdup("alter foreign data wrapper"),$5,$6);
    5167             : }
    5168             : ;
    5169             : 
    5170             : 
    5171             :  create_generic_options:
    5172             :  OPTIONS '(' generic_option_list ')'
    5173             :  { 
    5174           0 :  $$ = cat_str(3,mm_strdup("options ("),$3,mm_strdup(")"));
    5175             : }
    5176             : | 
    5177             :  { 
    5178         308 :  $$=EMPTY; }
    5179             : ;
    5180             : 
    5181             : 
    5182             :  generic_option_list:
    5183             :  generic_option_elem
    5184             :  { 
    5185           0 :  $$ = $1;
    5186             : }
    5187             : |  generic_option_list ',' generic_option_elem
    5188             :  { 
    5189           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    5190             : }
    5191             : ;
    5192             : 
    5193             : 
    5194             :  alter_generic_options:
    5195             :  OPTIONS '(' alter_generic_option_list ')'
    5196             :  { 
    5197           0 :  $$ = cat_str(3,mm_strdup("options ("),$3,mm_strdup(")"));
    5198             : }
    5199             : ;
    5200             : 
    5201             : 
    5202             :  alter_generic_option_list:
    5203             :  alter_generic_option_elem
    5204             :  { 
    5205           0 :  $$ = $1;
    5206             : }
    5207             : |  alter_generic_option_list ',' alter_generic_option_elem
    5208             :  { 
    5209           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    5210             : }
    5211             : ;
    5212             : 
    5213             : 
    5214             :  alter_generic_option_elem:
    5215             :  generic_option_elem
    5216             :  { 
    5217           0 :  $$ = $1;
    5218             : }
    5219             : |  SET generic_option_elem
    5220             :  { 
    5221           0 :  $$ = cat_str(2,mm_strdup("set"),$2);
    5222             : }
    5223             : |  ADD_P generic_option_elem
    5224             :  { 
    5225           0 :  $$ = cat_str(2,mm_strdup("add"),$2);
    5226             : }
    5227             : |  DROP generic_option_name
    5228             :  { 
    5229           0 :  $$ = cat_str(2,mm_strdup("drop"),$2);
    5230             : }
    5231             : ;
    5232             : 
    5233             : 
    5234             :  generic_option_elem:
    5235             :  generic_option_name generic_option_arg
    5236             :  { 
    5237           0 :  $$ = cat_str(2,$1,$2);
    5238             : }
    5239             : ;
    5240             : 
    5241             : 
    5242             :  generic_option_name:
    5243             :  ColLabel
    5244             :  { 
    5245           0 :  $$ = $1;
    5246             : }
    5247             : ;
    5248             : 
    5249             : 
    5250             :  generic_option_arg:
    5251             :  ecpg_sconst
    5252             :  { 
    5253           0 :  $$ = $1;
    5254             : }
    5255             : ;
    5256             : 
    5257             : 
    5258             :  CreateForeignServerStmt:
    5259             :  CREATE SERVER name opt_type opt_foreign_server_version FOREIGN DATA_P WRAPPER name create_generic_options
    5260             :  { 
    5261           0 :  $$ = cat_str(7,mm_strdup("create server"),$3,$4,$5,mm_strdup("foreign data wrapper"),$9,$10);
    5262             : }
    5263             : |  CREATE SERVER IF_P NOT EXISTS name opt_type opt_foreign_server_version FOREIGN DATA_P WRAPPER name create_generic_options
    5264             :  { 
    5265           0 :  $$ = cat_str(7,mm_strdup("create server if not exists"),$6,$7,$8,mm_strdup("foreign data wrapper"),$12,$13);
    5266             : }
    5267             : ;
    5268             : 
    5269             : 
    5270             :  opt_type:
    5271             :  TYPE_P ecpg_sconst
    5272             :  { 
    5273           0 :  $$ = cat_str(2,mm_strdup("type"),$2);
    5274             : }
    5275             : | 
    5276             :  { 
    5277           0 :  $$=EMPTY; }
    5278             : ;
    5279             : 
    5280             : 
    5281             :  foreign_server_version:
    5282             :  VERSION_P ecpg_sconst
    5283             :  { 
    5284           0 :  $$ = cat_str(2,mm_strdup("version"),$2);
    5285             : }
    5286             : |  VERSION_P NULL_P
    5287             :  { 
    5288           0 :  $$ = mm_strdup("version null");
    5289             : }
    5290             : ;
    5291             : 
    5292             : 
    5293             :  opt_foreign_server_version:
    5294             :  foreign_server_version
    5295             :  { 
    5296           0 :  $$ = $1;
    5297             : }
    5298             : | 
    5299             :  { 
    5300           0 :  $$=EMPTY; }
    5301             : ;
    5302             : 
    5303             : 
    5304             :  AlterForeignServerStmt:
    5305             :  ALTER SERVER name foreign_server_version alter_generic_options
    5306             :  { 
    5307           0 :  $$ = cat_str(4,mm_strdup("alter server"),$3,$4,$5);
    5308             : }
    5309             : |  ALTER SERVER name foreign_server_version
    5310             :  { 
    5311           0 :  $$ = cat_str(3,mm_strdup("alter server"),$3,$4);
    5312             : }
    5313             : |  ALTER SERVER name alter_generic_options
    5314             :  { 
    5315           0 :  $$ = cat_str(3,mm_strdup("alter server"),$3,$4);
    5316             : }
    5317             : ;
    5318             : 
    5319             : 
    5320             :  CreateForeignTableStmt:
    5321             :  CREATE FOREIGN TABLE qualified_name '(' OptTableElementList ')' OptInherit SERVER name create_generic_options
    5322             :  { 
    5323           0 :  $$ = cat_str(9,mm_strdup("create foreign table"),$4,mm_strdup("("),$6,mm_strdup(")"),$8,mm_strdup("server"),$10,$11);
    5324             : }
    5325             : |  CREATE FOREIGN TABLE IF_P NOT EXISTS qualified_name '(' OptTableElementList ')' OptInherit SERVER name create_generic_options
    5326             :  { 
    5327           0 :  $$ = cat_str(9,mm_strdup("create foreign table if not exists"),$7,mm_strdup("("),$9,mm_strdup(")"),$11,mm_strdup("server"),$13,$14);
    5328             : }
    5329             : |  CREATE FOREIGN TABLE qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec SERVER name create_generic_options
    5330             :  { 
    5331           0 :  $$ = cat_str(9,mm_strdup("create foreign table"),$4,mm_strdup("partition of"),$7,$8,$9,mm_strdup("server"),$11,$12);
    5332             : }
    5333             : |  CREATE FOREIGN TABLE IF_P NOT EXISTS qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec SERVER name create_generic_options
    5334             :  { 
    5335           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);
    5336             : }
    5337             : ;
    5338             : 
    5339             : 
    5340             :  ImportForeignSchemaStmt:
    5341             :  IMPORT_P FOREIGN SCHEMA name import_qualification FROM SERVER name INTO name create_generic_options
    5342             :  { 
    5343           0 :  $$ = cat_str(8,mm_strdup("import foreign schema"),$4,$5,mm_strdup("from server"),$8,mm_strdup("into"),$10,$11);
    5344             : }
    5345             : ;
    5346             : 
    5347             : 
    5348             :  import_qualification_type:
    5349             :  LIMIT TO
    5350             :  { 
    5351           0 :  $$ = mm_strdup("limit to");
    5352             : }
    5353             : |  EXCEPT
    5354             :  { 
    5355           0 :  $$ = mm_strdup("except");
    5356             : }
    5357             : ;
    5358             : 
    5359             : 
    5360             :  import_qualification:
    5361             :  import_qualification_type '(' relation_expr_list ')'
    5362             :  { 
    5363           0 :  $$ = cat_str(4,$1,mm_strdup("("),$3,mm_strdup(")"));
    5364             : }
    5365             : | 
    5366             :  { 
    5367           0 :  $$=EMPTY; }
    5368             : ;
    5369             : 
    5370             : 
    5371             :  CreateUserMappingStmt:
    5372             :  CREATE USER MAPPING FOR auth_ident SERVER name create_generic_options
    5373             :  { 
    5374           0 :  $$ = cat_str(5,mm_strdup("create user mapping for"),$5,mm_strdup("server"),$7,$8);
    5375             : }
    5376             : |  CREATE USER MAPPING IF_P NOT EXISTS FOR auth_ident SERVER name create_generic_options
    5377             :  { 
    5378           0 :  $$ = cat_str(5,mm_strdup("create user mapping if not exists for"),$8,mm_strdup("server"),$10,$11);
    5379             : }
    5380             : ;
    5381             : 
    5382             : 
    5383             :  auth_ident:
    5384             :  RoleSpec
    5385             :  { 
    5386           0 :  $$ = $1;
    5387             : }
    5388             : |  USER
    5389             :  { 
    5390           0 :  $$ = mm_strdup("user");
    5391             : }
    5392             : ;
    5393             : 
    5394             : 
    5395             :  DropUserMappingStmt:
    5396             :  DROP USER MAPPING FOR auth_ident SERVER name
    5397             :  { 
    5398           0 :  $$ = cat_str(4,mm_strdup("drop user mapping for"),$5,mm_strdup("server"),$7);
    5399             : }
    5400             : |  DROP USER MAPPING IF_P EXISTS FOR auth_ident SERVER name
    5401             :  { 
    5402           0 :  $$ = cat_str(4,mm_strdup("drop user mapping if exists for"),$7,mm_strdup("server"),$9);
    5403             : }
    5404             : ;
    5405             : 
    5406             : 
    5407             :  AlterUserMappingStmt:
    5408             :  ALTER USER MAPPING FOR auth_ident SERVER name alter_generic_options
    5409             :  { 
    5410           0 :  $$ = cat_str(5,mm_strdup("alter user mapping for"),$5,mm_strdup("server"),$7,$8);
    5411             : }
    5412             : ;
    5413             : 
    5414             : 
    5415             :  CreatePolicyStmt:
    5416             :  CREATE POLICY name ON qualified_name RowSecurityDefaultPermissive RowSecurityDefaultForCmd RowSecurityDefaultToRole RowSecurityOptionalExpr RowSecurityOptionalWithCheck
    5417             :  { 
    5418           0 :  $$ = cat_str(9,mm_strdup("create policy"),$3,mm_strdup("on"),$5,$6,$7,$8,$9,$10);
    5419             : }
    5420             : ;
    5421             : 
    5422             : 
    5423             :  AlterPolicyStmt:
    5424             :  ALTER POLICY name ON qualified_name RowSecurityOptionalToRole RowSecurityOptionalExpr RowSecurityOptionalWithCheck
    5425             :  { 
    5426           0 :  $$ = cat_str(7,mm_strdup("alter policy"),$3,mm_strdup("on"),$5,$6,$7,$8);
    5427             : }
    5428             : ;
    5429             : 
    5430             : 
    5431             :  RowSecurityOptionalExpr:
    5432             :  USING '(' a_expr ')'
    5433             :  { 
    5434           0 :  $$ = cat_str(3,mm_strdup("using ("),$3,mm_strdup(")"));
    5435             : }
    5436             : | 
    5437             :  { 
    5438           0 :  $$=EMPTY; }
    5439             : ;
    5440             : 
    5441             : 
    5442             :  RowSecurityOptionalWithCheck:
    5443             :  WITH CHECK '(' a_expr ')'
    5444             :  { 
    5445           0 :  $$ = cat_str(3,mm_strdup("with check ("),$4,mm_strdup(")"));
    5446             : }
    5447             : | 
    5448             :  { 
    5449           0 :  $$=EMPTY; }
    5450             : ;
    5451             : 
    5452             : 
    5453             :  RowSecurityDefaultToRole:
    5454             :  TO role_list
    5455             :  { 
    5456           0 :  $$ = cat_str(2,mm_strdup("to"),$2);
    5457             : }
    5458             : | 
    5459             :  { 
    5460           0 :  $$=EMPTY; }
    5461             : ;
    5462             : 
    5463             : 
    5464             :  RowSecurityOptionalToRole:
    5465             :  TO role_list
    5466             :  { 
    5467           0 :  $$ = cat_str(2,mm_strdup("to"),$2);
    5468             : }
    5469             : | 
    5470             :  { 
    5471           0 :  $$=EMPTY; }
    5472             : ;
    5473             : 
    5474             : 
    5475             :  RowSecurityDefaultPermissive:
    5476             :  AS ecpg_ident
    5477             :  { 
    5478           0 :  $$ = cat_str(2,mm_strdup("as"),$2);
    5479             : }
    5480             : | 
    5481             :  { 
    5482           0 :  $$=EMPTY; }
    5483             : ;
    5484             : 
    5485             : 
    5486             :  RowSecurityDefaultForCmd:
    5487             :  FOR row_security_cmd
    5488             :  { 
    5489           0 :  $$ = cat_str(2,mm_strdup("for"),$2);
    5490             : }
    5491             : | 
    5492             :  { 
    5493           0 :  $$=EMPTY; }
    5494             : ;
    5495             : 
    5496             : 
    5497             :  row_security_cmd:
    5498             :  ALL
    5499             :  { 
    5500           0 :  $$ = mm_strdup("all");
    5501             : }
    5502             : |  SELECT
    5503             :  { 
    5504           0 :  $$ = mm_strdup("select");
    5505             : }
    5506             : |  INSERT
    5507             :  { 
    5508           0 :  $$ = mm_strdup("insert");
    5509             : }
    5510             : |  UPDATE
    5511             :  { 
    5512           0 :  $$ = mm_strdup("update");
    5513             : }
    5514             : |  DELETE_P
    5515             :  { 
    5516           0 :  $$ = mm_strdup("delete");
    5517             : }
    5518             : ;
    5519             : 
    5520             : 
    5521             :  CreateAmStmt:
    5522             :  CREATE ACCESS METHOD name TYPE_P am_type HANDLER handler_name
    5523             :  { 
    5524           0 :  $$ = cat_str(6,mm_strdup("create access method"),$4,mm_strdup("type"),$6,mm_strdup("handler"),$8);
    5525             : }
    5526             : ;
    5527             : 
    5528             : 
    5529             :  am_type:
    5530             :  INDEX
    5531             :  { 
    5532           0 :  $$ = mm_strdup("index");
    5533             : }
    5534             : |  TABLE
    5535             :  { 
    5536           0 :  $$ = mm_strdup("table");
    5537             : }
    5538             : ;
    5539             : 
    5540             : 
    5541             :  CreateTrigStmt:
    5542             :  CREATE opt_or_replace TRIGGER name TriggerActionTime TriggerEvents ON qualified_name TriggerReferencing TriggerForSpec TriggerWhen EXECUTE FUNCTION_or_PROCEDURE func_name '(' TriggerFuncArgs ')'
    5543             :  { 
    5544           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(")"));
    5545             : }
    5546             : |  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 ')'
    5547             :  { 
    5548           0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
    5549           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(")"));
    5550             : }
    5551             : ;
    5552             : 
    5553             : 
    5554             :  TriggerActionTime:
    5555             :  BEFORE
    5556             :  { 
    5557           2 :  $$ = mm_strdup("before");
    5558             : }
    5559             : |  AFTER
    5560             :  { 
    5561           0 :  $$ = mm_strdup("after");
    5562             : }
    5563             : |  INSTEAD OF
    5564             :  { 
    5565           0 :  $$ = mm_strdup("instead of");
    5566             : }
    5567             : ;
    5568             : 
    5569             : 
    5570             :  TriggerEvents:
    5571             :  TriggerOneEvent
    5572             :  { 
    5573           2 :  $$ = $1;
    5574             : }
    5575             : |  TriggerEvents OR TriggerOneEvent
    5576             :  { 
    5577           0 :  $$ = cat_str(3,$1,mm_strdup("or"),$3);
    5578             : }
    5579             : ;
    5580             : 
    5581             : 
    5582             :  TriggerOneEvent:
    5583             :  INSERT
    5584             :  { 
    5585           2 :  $$ = mm_strdup("insert");
    5586             : }
    5587             : |  DELETE_P
    5588             :  { 
    5589           0 :  $$ = mm_strdup("delete");
    5590             : }
    5591             : |  UPDATE
    5592             :  { 
    5593           0 :  $$ = mm_strdup("update");
    5594             : }
    5595             : |  UPDATE OF columnList
    5596             :  { 
    5597           0 :  $$ = cat_str(2,mm_strdup("update of"),$3);
    5598             : }
    5599             : |  TRUNCATE
    5600             :  { 
    5601           0 :  $$ = mm_strdup("truncate");
    5602             : }
    5603             : ;
    5604             : 
    5605             : 
    5606             :  TriggerReferencing:
    5607             :  REFERENCING TriggerTransitions
    5608             :  { 
    5609           0 :  $$ = cat_str(2,mm_strdup("referencing"),$2);
    5610             : }
    5611             : | 
    5612             :  { 
    5613           2 :  $$=EMPTY; }
    5614             : ;
    5615             : 
    5616             : 
    5617             :  TriggerTransitions:
    5618             :  TriggerTransition
    5619             :  { 
    5620           0 :  $$ = $1;
    5621             : }
    5622             : |  TriggerTransitions TriggerTransition
    5623             :  { 
    5624           0 :  $$ = cat_str(2,$1,$2);
    5625             : }
    5626             : ;
    5627             : 
    5628             : 
    5629             :  TriggerTransition:
    5630             :  TransitionOldOrNew TransitionRowOrTable opt_as TransitionRelName
    5631             :  { 
    5632           0 :  $$ = cat_str(4,$1,$2,$3,$4);
    5633             : }
    5634             : ;
    5635             : 
    5636             : 
    5637             :  TransitionOldOrNew:
    5638             :  NEW
    5639             :  { 
    5640           0 :  $$ = mm_strdup("new");
    5641             : }
    5642             : |  OLD
    5643             :  { 
    5644           0 :  $$ = mm_strdup("old");
    5645             : }
    5646             : ;
    5647             : 
    5648             : 
    5649             :  TransitionRowOrTable:
    5650             :  TABLE
    5651             :  { 
    5652           0 :  $$ = mm_strdup("table");
    5653             : }
    5654             : |  ROW
    5655             :  { 
    5656           0 :  $$ = mm_strdup("row");
    5657             : }
    5658             : ;
    5659             : 
    5660             : 
    5661             :  TransitionRelName:
    5662             :  ColId
    5663             :  { 
    5664           0 :  $$ = $1;
    5665             : }
    5666             : ;
    5667             : 
    5668             : 
    5669             :  TriggerForSpec:
    5670             :  FOR TriggerForOptEach TriggerForType
    5671             :  { 
    5672           2 :  $$ = cat_str(3,mm_strdup("for"),$2,$3);
    5673             : }
    5674             : | 
    5675             :  { 
    5676           0 :  $$=EMPTY; }
    5677             : ;
    5678             : 
    5679             : 
    5680             :  TriggerForOptEach:
    5681             :  EACH
    5682             :  { 
    5683           2 :  $$ = mm_strdup("each");
    5684             : }
    5685             : | 
    5686             :  { 
    5687           0 :  $$=EMPTY; }
    5688             : ;
    5689             : 
    5690             : 
    5691             :  TriggerForType:
    5692             :  ROW
    5693             :  { 
    5694           2 :  $$ = mm_strdup("row");
    5695             : }
    5696             : |  STATEMENT
    5697             :  { 
    5698           0 :  $$ = mm_strdup("statement");
    5699             : }
    5700             : ;
    5701             : 
    5702             : 
    5703             :  TriggerWhen:
    5704             :  WHEN '(' a_expr ')'
    5705             :  { 
    5706           0 :  $$ = cat_str(3,mm_strdup("when ("),$3,mm_strdup(")"));
    5707             : }
    5708             : | 
    5709             :  { 
    5710           2 :  $$=EMPTY; }
    5711             : ;
    5712             : 
    5713             : 
    5714             :  FUNCTION_or_PROCEDURE:
    5715             :  FUNCTION
    5716             :  { 
    5717           0 :  $$ = mm_strdup("function");
    5718             : }
    5719             : |  PROCEDURE
    5720             :  { 
    5721           2 :  $$ = mm_strdup("procedure");
    5722             : }
    5723             : ;
    5724             : 
    5725             : 
    5726             :  TriggerFuncArgs:
    5727             :  TriggerFuncArg
    5728             :  { 
    5729           0 :  $$ = $1;
    5730             : }
    5731             : |  TriggerFuncArgs ',' TriggerFuncArg
    5732             :  { 
    5733           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    5734             : }
    5735             : | 
    5736             :  { 
    5737           2 :  $$=EMPTY; }
    5738             : ;
    5739             : 
    5740             : 
    5741             :  TriggerFuncArg:
    5742             :  Iconst
    5743             :  { 
    5744           0 :  $$ = $1;
    5745             : }
    5746             : |  ecpg_fconst
    5747             :  { 
    5748           0 :  $$ = $1;
    5749             : }
    5750             : |  ecpg_sconst
    5751             :  { 
    5752           0 :  $$ = $1;
    5753             : }
    5754             : |  ColLabel
    5755             :  { 
    5756           0 :  $$ = $1;
    5757             : }
    5758             : ;
    5759             : 
    5760             : 
    5761             :  OptConstrFromTable:
    5762             :  FROM qualified_name
    5763             :  { 
    5764           0 :  $$ = cat_str(2,mm_strdup("from"),$2);
    5765             : }
    5766             : | 
    5767             :  { 
    5768           0 :  $$=EMPTY; }
    5769             : ;
    5770             : 
    5771             : 
    5772             :  ConstraintAttributeSpec:
    5773             : 
    5774             :  { 
    5775           4 :  $$=EMPTY; }
    5776             : |  ConstraintAttributeSpec ConstraintAttributeElem
    5777             :  { 
    5778           0 :  $$ = cat_str(2,$1,$2);
    5779             : }
    5780             : ;
    5781             : 
    5782             : 
    5783             :  ConstraintAttributeElem:
    5784             :  NOT DEFERRABLE
    5785             :  { 
    5786           0 :  $$ = mm_strdup("not deferrable");
    5787             : }
    5788             : |  DEFERRABLE
    5789             :  { 
    5790           0 :  $$ = mm_strdup("deferrable");
    5791             : }
    5792             : |  INITIALLY IMMEDIATE
    5793             :  { 
    5794           0 :  $$ = mm_strdup("initially immediate");
    5795             : }
    5796             : |  INITIALLY DEFERRED
    5797             :  { 
    5798           0 :  $$ = mm_strdup("initially deferred");
    5799             : }
    5800             : |  NOT VALID
    5801             :  { 
    5802           0 :  $$ = mm_strdup("not valid");
    5803             : }
    5804             : |  NO INHERIT
    5805             :  { 
    5806           0 :  $$ = mm_strdup("no inherit");
    5807             : }
    5808             : ;
    5809             : 
    5810             : 
    5811             :  CreateEventTrigStmt:
    5812             :  CREATE EVENT TRIGGER name ON ColLabel EXECUTE FUNCTION_or_PROCEDURE func_name '(' ')'
    5813             :  { 
    5814           0 :  $$ = cat_str(8,mm_strdup("create event trigger"),$4,mm_strdup("on"),$6,mm_strdup("execute"),$8,$9,mm_strdup("( )"));
    5815             : }
    5816             : |  CREATE EVENT TRIGGER name ON ColLabel WHEN event_trigger_when_list EXECUTE FUNCTION_or_PROCEDURE func_name '(' ')'
    5817             :  { 
    5818           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("( )"));
    5819             : }
    5820             : ;
    5821             : 
    5822             : 
    5823             :  event_trigger_when_list:
    5824             :  event_trigger_when_item
    5825             :  { 
    5826           0 :  $$ = $1;
    5827             : }
    5828             : |  event_trigger_when_list AND event_trigger_when_item
    5829             :  { 
    5830           0 :  $$ = cat_str(3,$1,mm_strdup("and"),$3);
    5831             : }
    5832             : ;
    5833             : 
    5834             : 
    5835             :  event_trigger_when_item:
    5836             :  ColId IN_P '(' event_trigger_value_list ')'
    5837             :  { 
    5838           0 :  $$ = cat_str(4,$1,mm_strdup("in ("),$4,mm_strdup(")"));
    5839             : }
    5840             : ;
    5841             : 
    5842             : 
    5843             :  event_trigger_value_list:
    5844             :  SCONST
    5845             :  { 
    5846           0 :  $$ = mm_strdup("sconst");
    5847             : }
    5848             : |  event_trigger_value_list ',' SCONST
    5849             :  { 
    5850           0 :  $$ = cat_str(2,$1,mm_strdup(", sconst"));
    5851             : }
    5852             : ;
    5853             : 
    5854             : 
    5855             :  AlterEventTrigStmt:
    5856             :  ALTER EVENT TRIGGER name enable_trigger
    5857             :  { 
    5858           0 :  $$ = cat_str(3,mm_strdup("alter event trigger"),$4,$5);
    5859             : }
    5860             : ;
    5861             : 
    5862             : 
    5863             :  enable_trigger:
    5864             :  ENABLE_P
    5865             :  { 
    5866           0 :  $$ = mm_strdup("enable");
    5867             : }
    5868             : |  ENABLE_P REPLICA
    5869             :  { 
    5870           0 :  $$ = mm_strdup("enable replica");
    5871             : }
    5872             : |  ENABLE_P ALWAYS
    5873             :  { 
    5874           0 :  $$ = mm_strdup("enable always");
    5875             : }
    5876             : |  DISABLE_P
    5877             :  { 
    5878           0 :  $$ = mm_strdup("disable");
    5879             : }
    5880             : ;
    5881             : 
    5882             : 
    5883             :  CreateAssertionStmt:
    5884             :  CREATE ASSERTION any_name CHECK '(' a_expr ')' ConstraintAttributeSpec
    5885             :  { 
    5886           0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
    5887           0 :  $$ = cat_str(6,mm_strdup("create assertion"),$3,mm_strdup("check ("),$6,mm_strdup(")"),$8);
    5888             : }
    5889             : ;
    5890             : 
    5891             : 
    5892             :  DefineStmt:
    5893             :  CREATE opt_or_replace AGGREGATE func_name aggr_args definition
    5894             :  { 
    5895           0 :  $$ = cat_str(6,mm_strdup("create"),$2,mm_strdup("aggregate"),$4,$5,$6);
    5896             : }
    5897             : |  CREATE opt_or_replace AGGREGATE func_name old_aggr_definition
    5898             :  { 
    5899           0 :  $$ = cat_str(5,mm_strdup("create"),$2,mm_strdup("aggregate"),$4,$5);
    5900             : }
    5901             : |  CREATE OPERATOR any_operator definition
    5902             :  { 
    5903           0 :  $$ = cat_str(3,mm_strdup("create operator"),$3,$4);
    5904             : }
    5905             : |  CREATE TYPE_P any_name definition
    5906             :  { 
    5907           0 :  $$ = cat_str(3,mm_strdup("create type"),$3,$4);
    5908             : }
    5909             : |  CREATE TYPE_P any_name
    5910             :  { 
    5911           0 :  $$ = cat_str(2,mm_strdup("create type"),$3);
    5912             : }
    5913             : |  CREATE TYPE_P any_name AS '(' OptTableFuncElementList ')'
    5914             :  { 
    5915           0 :  $$ = cat_str(5,mm_strdup("create type"),$3,mm_strdup("as ("),$6,mm_strdup(")"));
    5916             : }
    5917             : |  CREATE TYPE_P any_name AS ENUM_P '(' opt_enum_val_list ')'
    5918             :  { 
    5919           0 :  $$ = cat_str(5,mm_strdup("create type"),$3,mm_strdup("as enum ("),$7,mm_strdup(")"));
    5920             : }
    5921             : |  CREATE TYPE_P any_name AS RANGE definition
    5922             :  { 
    5923           0 :  $$ = cat_str(4,mm_strdup("create type"),$3,mm_strdup("as range"),$6);
    5924             : }
    5925             : |  CREATE TEXT_P SEARCH PARSER any_name definition
    5926             :  { 
    5927           0 :  $$ = cat_str(3,mm_strdup("create text search parser"),$5,$6);
    5928             : }
    5929             : |  CREATE TEXT_P SEARCH DICTIONARY any_name definition
    5930             :  { 
    5931           0 :  $$ = cat_str(3,mm_strdup("create text search dictionary"),$5,$6);
    5932             : }
    5933             : |  CREATE TEXT_P SEARCH TEMPLATE any_name definition
    5934             :  { 
    5935           0 :  $$ = cat_str(3,mm_strdup("create text search template"),$5,$6);
    5936             : }
    5937             : |  CREATE TEXT_P SEARCH CONFIGURATION any_name definition
    5938             :  { 
    5939           0 :  $$ = cat_str(3,mm_strdup("create text search configuration"),$5,$6);
    5940             : }
    5941             : |  CREATE COLLATION any_name definition
    5942             :  { 
    5943           0 :  $$ = cat_str(3,mm_strdup("create collation"),$3,$4);
    5944             : }
    5945             : |  CREATE COLLATION IF_P NOT EXISTS any_name definition
    5946             :  { 
    5947           0 :  $$ = cat_str(3,mm_strdup("create collation if not exists"),$6,$7);
    5948             : }
    5949             : |  CREATE COLLATION any_name FROM any_name
    5950             :  { 
    5951           0 :  $$ = cat_str(4,mm_strdup("create collation"),$3,mm_strdup("from"),$5);
    5952             : }
    5953             : |  CREATE COLLATION IF_P NOT EXISTS any_name FROM any_name
    5954             :  { 
    5955           0 :  $$ = cat_str(4,mm_strdup("create collation if not exists"),$6,mm_strdup("from"),$8);
    5956             : }
    5957             : ;
    5958             : 
    5959             : 
    5960             :  definition:
    5961             :  '(' def_list ')'
    5962             :  { 
    5963           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
    5964             : }
    5965             : ;
    5966             : 
    5967             : 
    5968             :  def_list:
    5969             :  def_elem
    5970             :  { 
    5971           0 :  $$ = $1;
    5972             : }
    5973             : |  def_list ',' def_elem
    5974             :  { 
    5975           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    5976             : }
    5977             : ;
    5978             : 
    5979             : 
    5980             :  def_elem:
    5981             :  ColLabel '=' def_arg
    5982             :  { 
    5983           0 :  $$ = cat_str(3,$1,mm_strdup("="),$3);
    5984             : }
    5985             : |  ColLabel
    5986             :  { 
    5987           0 :  $$ = $1;
    5988             : }
    5989             : ;
    5990             : 
    5991             : 
    5992             :  def_arg:
    5993             :  func_type
    5994             :  { 
    5995           0 :  $$ = $1;
    5996             : }
    5997             : |  reserved_keyword
    5998             :  { 
    5999           0 :  $$ = $1;
    6000             : }
    6001             : |  qual_all_Op
    6002             :  { 
    6003           0 :  $$ = $1;
    6004             : }
    6005             : |  NumericOnly
    6006             :  { 
    6007           0 :  $$ = $1;
    6008             : }
    6009             : |  ecpg_sconst
    6010             :  { 
    6011           0 :  $$ = $1;
    6012             : }
    6013             : |  NONE
    6014             :  { 
    6015           0 :  $$ = mm_strdup("none");
    6016             : }
    6017             : ;
    6018             : 
    6019             : 
    6020             :  old_aggr_definition:
    6021             :  '(' old_aggr_list ')'
    6022             :  { 
    6023           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
    6024             : }
    6025             : ;
    6026             : 
    6027             : 
    6028             :  old_aggr_list:
    6029             :  old_aggr_elem
    6030             :  { 
    6031           0 :  $$ = $1;
    6032             : }
    6033             : |  old_aggr_list ',' old_aggr_elem
    6034             :  { 
    6035           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    6036             : }
    6037             : ;
    6038             : 
    6039             : 
    6040             :  old_aggr_elem:
    6041             :  ecpg_ident '=' def_arg
    6042             :  { 
    6043           0 :  $$ = cat_str(3,$1,mm_strdup("="),$3);
    6044             : }
    6045             : ;
    6046             : 
    6047             : 
    6048             :  opt_enum_val_list:
    6049             :  enum_val_list
    6050             :  { 
    6051           0 :  $$ = $1;
    6052             : }
    6053             : | 
    6054             :  { 
    6055           0 :  $$=EMPTY; }
    6056             : ;
    6057             : 
    6058             : 
    6059             :  enum_val_list:
    6060             :  ecpg_sconst
    6061             :  { 
    6062           0 :  $$ = $1;
    6063             : }
    6064             : |  enum_val_list ',' ecpg_sconst
    6065             :  { 
    6066           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    6067             : }
    6068             : ;
    6069             : 
    6070             : 
    6071             :  AlterEnumStmt:
    6072             :  ALTER TYPE_P any_name ADD_P VALUE_P opt_if_not_exists ecpg_sconst
    6073             :  { 
    6074           0 :  $$ = cat_str(5,mm_strdup("alter type"),$3,mm_strdup("add value"),$6,$7);
    6075             : }
    6076             : |  ALTER TYPE_P any_name ADD_P VALUE_P opt_if_not_exists ecpg_sconst BEFORE ecpg_sconst
    6077             :  { 
    6078           0 :  $$ = cat_str(7,mm_strdup("alter type"),$3,mm_strdup("add value"),$6,$7,mm_strdup("before"),$9);
    6079             : }
    6080             : |  ALTER TYPE_P any_name ADD_P VALUE_P opt_if_not_exists ecpg_sconst AFTER ecpg_sconst
    6081             :  { 
    6082           0 :  $$ = cat_str(7,mm_strdup("alter type"),$3,mm_strdup("add value"),$6,$7,mm_strdup("after"),$9);
    6083             : }
    6084             : |  ALTER TYPE_P any_name RENAME VALUE_P ecpg_sconst TO ecpg_sconst
    6085             :  { 
    6086           0 :  $$ = cat_str(6,mm_strdup("alter type"),$3,mm_strdup("rename value"),$6,mm_strdup("to"),$8);
    6087             : }
    6088             : |  ALTER TYPE_P any_name DROP VALUE_P ecpg_sconst
    6089             :  { 
    6090           0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
    6091           0 :  $$ = cat_str(4,mm_strdup("alter type"),$3,mm_strdup("drop value"),$6);
    6092             : }
    6093             : ;
    6094             : 
    6095             : 
    6096             :  opt_if_not_exists:
    6097             :  IF_P NOT EXISTS
    6098             :  { 
    6099           0 :  $$ = mm_strdup("if not exists");
    6100             : }
    6101             : | 
    6102             :  { 
    6103           0 :  $$=EMPTY; }
    6104             : ;
    6105             : 
    6106             : 
    6107             :  CreateOpClassStmt:
    6108             :  CREATE OPERATOR CLASS any_name opt_default FOR TYPE_P Typename USING name opt_opfamily AS opclass_item_list
    6109             :  { 
    6110           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);
    6111             : }
    6112             : ;
    6113             : 
    6114             : 
    6115             :  opclass_item_list:
    6116             :  opclass_item
    6117             :  { 
    6118           0 :  $$ = $1;
    6119             : }
    6120             : |  opclass_item_list ',' opclass_item
    6121             :  { 
    6122           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    6123             : }
    6124             : ;
    6125             : 
    6126             : 
    6127             :  opclass_item:
    6128             :  OPERATOR Iconst any_operator opclass_purpose opt_recheck
    6129             :  { 
    6130           0 :  $$ = cat_str(5,mm_strdup("operator"),$2,$3,$4,$5);
    6131             : }
    6132             : |  OPERATOR Iconst operator_with_argtypes opclass_purpose opt_recheck
    6133             :  { 
    6134           0 :  $$ = cat_str(5,mm_strdup("operator"),$2,$3,$4,$5);
    6135             : }
    6136             : |  FUNCTION Iconst function_with_argtypes
    6137             :  { 
    6138           0 :  $$ = cat_str(3,mm_strdup("function"),$2,$3);
    6139             : }
    6140             : |  FUNCTION Iconst '(' type_list ')' function_with_argtypes
    6141             :  { 
    6142           0 :  $$ = cat_str(6,mm_strdup("function"),$2,mm_strdup("("),$4,mm_strdup(")"),$6);
    6143             : }
    6144             : |  STORAGE Typename
    6145             :  { 
    6146           0 :  $$ = cat_str(2,mm_strdup("storage"),$2);
    6147             : }
    6148             : ;
    6149             : 
    6150             : 
    6151             :  opt_default:
    6152             :  DEFAULT
    6153             :  { 
    6154           0 :  $$ = mm_strdup("default");
    6155             : }
    6156             : | 
    6157             :  { 
    6158           0 :  $$=EMPTY; }
    6159             : ;
    6160             : 
    6161             : 
    6162             :  opt_opfamily:
    6163             :  FAMILY any_name
    6164             :  { 
    6165           0 :  $$ = cat_str(2,mm_strdup("family"),$2);
    6166             : }
    6167             : | 
    6168             :  { 
    6169           0 :  $$=EMPTY; }
    6170             : ;
    6171             : 
    6172             : 
    6173             :  opclass_purpose:
    6174             :  FOR SEARCH
    6175             :  { 
    6176           0 :  $$ = mm_strdup("for search");
    6177             : }
    6178             : |  FOR ORDER BY any_name
    6179             :  { 
    6180           0 :  $$ = cat_str(2,mm_strdup("for order by"),$4);
    6181             : }
    6182             : | 
    6183             :  { 
    6184           0 :  $$=EMPTY; }
    6185             : ;
    6186             : 
    6187             : 
    6188             :  opt_recheck:
    6189             :  RECHECK
    6190             :  { 
    6191           0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
    6192           0 :  $$ = mm_strdup("recheck");
    6193             : }
    6194             : | 
    6195             :  { 
    6196           0 :  $$=EMPTY; }
    6197             : ;
    6198             : 
    6199             : 
    6200             :  CreateOpFamilyStmt:
    6201             :  CREATE OPERATOR FAMILY any_name USING name
    6202             :  { 
    6203           0 :  $$ = cat_str(4,mm_strdup("create operator family"),$4,mm_strdup("using"),$6);
    6204             : }
    6205             : ;
    6206             : 
    6207             : 
    6208             :  AlterOpFamilyStmt:
    6209             :  ALTER OPERATOR FAMILY any_name USING name ADD_P opclass_item_list
    6210             :  { 
    6211           0 :  $$ = cat_str(6,mm_strdup("alter operator family"),$4,mm_strdup("using"),$6,mm_strdup("add"),$8);
    6212             : }
    6213             : |  ALTER OPERATOR FAMILY any_name USING name DROP opclass_drop_list
    6214             :  { 
    6215           0 :  $$ = cat_str(6,mm_strdup("alter operator family"),$4,mm_strdup("using"),$6,mm_strdup("drop"),$8);
    6216             : }
    6217             : ;
    6218             : 
    6219             : 
    6220             :  opclass_drop_list:
    6221             :  opclass_drop
    6222             :  { 
    6223           0 :  $$ = $1;
    6224             : }
    6225             : |  opclass_drop_list ',' opclass_drop
    6226             :  { 
    6227           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    6228             : }
    6229             : ;
    6230             : 
    6231             : 
    6232             :  opclass_drop:
    6233             :  OPERATOR Iconst '(' type_list ')'
    6234             :  { 
    6235           0 :  $$ = cat_str(5,mm_strdup("operator"),$2,mm_strdup("("),$4,mm_strdup(")"));
    6236             : }
    6237             : |  FUNCTION Iconst '(' type_list ')'
    6238             :  { 
    6239           0 :  $$ = cat_str(5,mm_strdup("function"),$2,mm_strdup("("),$4,mm_strdup(")"));
    6240             : }
    6241             : ;
    6242             : 
    6243             : 
    6244             :  DropOpClassStmt:
    6245             :  DROP OPERATOR CLASS any_name USING name opt_drop_behavior
    6246             :  { 
    6247           0 :  $$ = cat_str(5,mm_strdup("drop operator class"),$4,mm_strdup("using"),$6,$7);
    6248             : }
    6249             : |  DROP OPERATOR CLASS IF_P EXISTS any_name USING name opt_drop_behavior
    6250             :  { 
    6251           0 :  $$ = cat_str(5,mm_strdup("drop operator class if exists"),$6,mm_strdup("using"),$8,$9);
    6252             : }
    6253             : ;
    6254             : 
    6255             : 
    6256             :  DropOpFamilyStmt:
    6257             :  DROP OPERATOR FAMILY any_name USING name opt_drop_behavior
    6258             :  { 
    6259           0 :  $$ = cat_str(5,mm_strdup("drop operator family"),$4,mm_strdup("using"),$6,$7);
    6260             : }
    6261             : |  DROP OPERATOR FAMILY IF_P EXISTS any_name USING name opt_drop_behavior
    6262             :  { 
    6263           0 :  $$ = cat_str(5,mm_strdup("drop operator family if exists"),$6,mm_strdup("using"),$8,$9);
    6264             : }
    6265             : ;
    6266             : 
    6267             : 
    6268             :  DropOwnedStmt:
    6269             :  DROP OWNED BY role_list opt_drop_behavior
    6270             :  { 
    6271           0 :  $$ = cat_str(3,mm_strdup("drop owned by"),$4,$5);
    6272             : }
    6273             : ;
    6274             : 
    6275             : 
    6276             :  ReassignOwnedStmt:
    6277             :  REASSIGN OWNED BY role_list TO RoleSpec
    6278             :  { 
    6279           0 :  $$ = cat_str(4,mm_strdup("reassign owned by"),$4,mm_strdup("to"),$6);
    6280             : }
    6281             : ;
    6282             : 
    6283             : 
    6284             :  DropStmt:
    6285             :  DROP object_type_any_name IF_P EXISTS any_name_list opt_drop_behavior
    6286             :  { 
    6287           6 :  $$ = cat_str(5,mm_strdup("drop"),$2,mm_strdup("if exists"),$5,$6);
    6288             : }
    6289             : |  DROP object_type_any_name any_name_list opt_drop_behavior
    6290             :  { 
    6291          68 :  $$ = cat_str(4,mm_strdup("drop"),$2,$3,$4);
    6292             : }
    6293             : |  DROP drop_type_name IF_P EXISTS name_list opt_drop_behavior
    6294             :  { 
    6295           0 :  $$ = cat_str(5,mm_strdup("drop"),$2,mm_strdup("if exists"),$5,$6);
    6296             : }
    6297             : |  DROP drop_type_name name_list opt_drop_behavior
    6298             :  { 
    6299           0 :  $$ = cat_str(4,mm_strdup("drop"),$2,$3,$4);
    6300             : }
    6301             : |  DROP object_type_name_on_any_name name ON any_name opt_drop_behavior
    6302             :  { 
    6303           2 :  $$ = cat_str(6,mm_strdup("drop"),$2,$3,mm_strdup("on"),$5,$6);
    6304             : }
    6305             : |  DROP object_type_name_on_any_name IF_P EXISTS name ON any_name opt_drop_behavior
    6306             :  { 
    6307           0 :  $$ = cat_str(7,mm_strdup("drop"),$2,mm_strdup("if exists"),$5,mm_strdup("on"),$7,$8);
    6308             : }
    6309             : |  DROP TYPE_P type_name_list opt_drop_behavior
    6310             :  { 
    6311           0 :  $$ = cat_str(3,mm_strdup("drop type"),$3,$4);
    6312             : }
    6313             : |  DROP TYPE_P IF_P EXISTS type_name_list opt_drop_behavior
    6314             :  { 
    6315           0 :  $$ = cat_str(3,mm_strdup("drop type if exists"),$5,$6);
    6316             : }
    6317             : |  DROP DOMAIN_P type_name_list opt_drop_behavior
    6318             :  { 
    6319           0 :  $$ = cat_str(3,mm_strdup("drop domain"),$3,$4);
    6320             : }
    6321             : |  DROP DOMAIN_P IF_P EXISTS type_name_list opt_drop_behavior
    6322             :  { 
    6323           0 :  $$ = cat_str(3,mm_strdup("drop domain if exists"),$5,$6);
    6324             : }
    6325             : |  DROP INDEX CONCURRENTLY any_name_list opt_drop_behavior
    6326             :  { 
    6327           0 :  $$ = cat_str(3,mm_strdup("drop index concurrently"),$4,$5);
    6328             : }
    6329             : |  DROP INDEX CONCURRENTLY IF_P EXISTS any_name_list opt_drop_behavior
    6330             :  { 
    6331           0 :  $$ = cat_str(3,mm_strdup("drop index concurrently if exists"),$6,$7);
    6332             : }
    6333             : ;
    6334             : 
    6335             : 
    6336             :  object_type_any_name:
    6337             :  TABLE
    6338             :  { 
    6339          74 :  $$ = mm_strdup("table");
    6340             : }
    6341             : |  SEQUENCE
    6342             :  { 
    6343           0 :  $$ = mm_strdup("sequence");
    6344             : }
    6345             : |  VIEW
    6346             :  { 
    6347           0 :  $$ = mm_strdup("view");
    6348             : }
    6349             : |  MATERIALIZED VIEW
    6350             :  { 
    6351           0 :  $$ = mm_strdup("materialized view");
    6352             : }
    6353             : |  INDEX
    6354             :  { 
    6355           0 :  $$ = mm_strdup("index");
    6356             : }
    6357             : |  FOREIGN TABLE
    6358             :  { 
    6359           0 :  $$ = mm_strdup("foreign table");
    6360             : }
    6361             : |  COLLATION
    6362             :  { 
    6363           0 :  $$ = mm_strdup("collation");
    6364             : }
    6365             : |  CONVERSION_P
    6366             :  { 
    6367           0 :  $$ = mm_strdup("conversion");
    6368             : }
    6369             : |  STATISTICS
    6370             :  { 
    6371           0 :  $$ = mm_strdup("statistics");
    6372             : }
    6373             : |  TEXT_P SEARCH PARSER
    6374             :  { 
    6375           0 :  $$ = mm_strdup("text search parser");
    6376             : }
    6377             : |  TEXT_P SEARCH DICTIONARY
    6378             :  { 
    6379           0 :  $$ = mm_strdup("text search dictionary");
    6380             : }
    6381             : |  TEXT_P SEARCH TEMPLATE
    6382             :  { 
    6383           0 :  $$ = mm_strdup("text search template");
    6384             : }
    6385             : |  TEXT_P SEARCH CONFIGURATION
    6386             :  { 
    6387           0 :  $$ = mm_strdup("text search configuration");
    6388             : }
    6389             : ;
    6390             : 
    6391             : 
    6392             :  object_type_name:
    6393             :  drop_type_name
    6394             :  { 
    6395           0 :  $$ = $1;
    6396             : }
    6397             : |  DATABASE
    6398             :  { 
    6399           0 :  $$ = mm_strdup("database");
    6400             : }
    6401             : |  ROLE
    6402             :  { 
    6403           0 :  $$ = mm_strdup("role");
    6404             : }
    6405             : |  SUBSCRIPTION
    6406             :  { 
    6407           0 :  $$ = mm_strdup("subscription");
    6408             : }
    6409             : |  TABLESPACE
    6410             :  { 
    6411           0 :  $$ = mm_strdup("tablespace");
    6412             : }
    6413             : ;
    6414             : 
    6415             : 
    6416             :  drop_type_name:
    6417             :  ACCESS METHOD
    6418             :  { 
    6419           0 :  $$ = mm_strdup("access method");
    6420             : }
    6421             : |  EVENT TRIGGER
    6422             :  { 
    6423           0 :  $$ = mm_strdup("event trigger");
    6424             : }
    6425             : |  EXTENSION
    6426             :  { 
    6427           0 :  $$ = mm_strdup("extension");
    6428             : }
    6429             : |  FOREIGN DATA_P WRAPPER
    6430             :  { 
    6431           0 :  $$ = mm_strdup("foreign data wrapper");
    6432             : }
    6433             : |  opt_procedural LANGUAGE
    6434             :  { 
    6435           0 :  $$ = cat_str(2,$1,mm_strdup("language"));
    6436             : }
    6437             : |  PUBLICATION
    6438             :  { 
    6439           0 :  $$ = mm_strdup("publication");
    6440             : }
    6441             : |  SCHEMA
    6442             :  { 
    6443           0 :  $$ = mm_strdup("schema");
    6444             : }
    6445             : |  SERVER
    6446             :  { 
    6447           0 :  $$ = mm_strdup("server");
    6448             : }
    6449             : ;
    6450             : 
    6451             : 
    6452             :  object_type_name_on_any_name:
    6453             :  POLICY
    6454             :  { 
    6455           0 :  $$ = mm_strdup("policy");
    6456             : }
    6457             : |  RULE
    6458             :  { 
    6459           0 :  $$ = mm_strdup("rule");
    6460             : }
    6461             : |  TRIGGER
    6462             :  { 
    6463           2 :  $$ = mm_strdup("trigger");
    6464             : }
    6465             : ;
    6466             : 
    6467             : 
    6468             :  any_name_list:
    6469             :  any_name
    6470             :  { 
    6471          74 :  $$ = $1;
    6472             : }
    6473             : |  any_name_list ',' any_name
    6474             :  { 
    6475           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    6476             : }
    6477             : ;
    6478             : 
    6479             : 
    6480             :  any_name:
    6481             :  ColId
    6482             :  { 
    6483          78 :  $$ = $1;
    6484             : }
    6485             : |  ColId attrs
    6486             :  { 
    6487           0 :  $$ = cat_str(2,$1,$2);
    6488             : }
    6489             : ;
    6490             : 
    6491             : 
    6492             :  attrs:
    6493             :  '.' attr_name
    6494             :  { 
    6495           0 :  $$ = cat_str(2,mm_strdup("."),$2);
    6496             : }
    6497             : |  attrs '.' attr_name
    6498             :  { 
    6499           0 :  $$ = cat_str(3,$1,mm_strdup("."),$3);
    6500             : }
    6501             : ;
    6502             : 
    6503             : 
    6504             :  type_name_list:
    6505             :  Typename
    6506             :  { 
    6507           0 :  $$ = $1;
    6508             : }
    6509             : |  type_name_list ',' Typename
    6510             :  { 
    6511           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    6512             : }
    6513             : ;
    6514             : 
    6515             : 
    6516             :  TruncateStmt:
    6517             :  TRUNCATE opt_table relation_expr_list opt_restart_seqs opt_drop_behavior
    6518             :  { 
    6519          44 :  $$ = cat_str(5,mm_strdup("truncate"),$2,$3,$4,$5);
    6520             : }
    6521             : ;
    6522             : 
    6523             : 
    6524             :  opt_restart_seqs:
    6525             :  CONTINUE_P IDENTITY_P
    6526             :  { 
    6527           0 :  $$ = mm_strdup("continue identity");
    6528             : }
    6529             : |  RESTART IDENTITY_P
    6530             :  { 
    6531           0 :  $$ = mm_strdup("restart identity");
    6532             : }
    6533             : | 
    6534             :  { 
    6535          44 :  $$=EMPTY; }
    6536             : ;
    6537             : 
    6538             : 
    6539             :  CommentStmt:
    6540             :  COMMENT ON object_type_any_name any_name IS comment_text
    6541             :  { 
    6542           0 :  $$ = cat_str(5,mm_strdup("comment on"),$3,$4,mm_strdup("is"),$6);
    6543             : }
    6544             : |  COMMENT ON COLUMN any_name IS comment_text
    6545             :  { 
    6546           0 :  $$ = cat_str(4,mm_strdup("comment on column"),$4,mm_strdup("is"),$6);
    6547             : }
    6548             : |  COMMENT ON object_type_name name IS comment_text
    6549             :  { 
    6550           0 :  $$ = cat_str(5,mm_strdup("comment on"),$3,$4,mm_strdup("is"),$6);
    6551             : }
    6552             : |  COMMENT ON TYPE_P Typename IS comment_text
    6553             :  { 
    6554           0 :  $$ = cat_str(4,mm_strdup("comment on type"),$4,mm_strdup("is"),$6);
    6555             : }
    6556             : |  COMMENT ON DOMAIN_P Typename IS comment_text
    6557             :  { 
    6558           0 :  $$ = cat_str(4,mm_strdup("comment on domain"),$4,mm_strdup("is"),$6);
    6559             : }
    6560             : |  COMMENT ON AGGREGATE aggregate_with_argtypes IS comment_text
    6561             :  { 
    6562           0 :  $$ = cat_str(4,mm_strdup("comment on aggregate"),$4,mm_strdup("is"),$6);
    6563             : }
    6564             : |  COMMENT ON FUNCTION function_with_argtypes IS comment_text
    6565             :  { 
    6566           0 :  $$ = cat_str(4,mm_strdup("comment on function"),$4,mm_strdup("is"),$6);
    6567             : }
    6568             : |  COMMENT ON OPERATOR operator_with_argtypes IS comment_text
    6569             :  { 
    6570           0 :  $$ = cat_str(4,mm_strdup("comment on operator"),$4,mm_strdup("is"),$6);
    6571             : }
    6572             : |  COMMENT ON CONSTRAINT name ON any_name IS comment_text
    6573             :  { 
    6574           0 :  $$ = cat_str(6,mm_strdup("comment on constraint"),$4,mm_strdup("on"),$6,mm_strdup("is"),$8);
    6575             : }
    6576             : |  COMMENT ON CONSTRAINT name ON DOMAIN_P any_name IS comment_text
    6577             :  { 
    6578           0 :  $$ = cat_str(6,mm_strdup("comment on constraint"),$4,mm_strdup("on domain"),$7,mm_strdup("is"),$9);
    6579             : }
    6580             : |  COMMENT ON object_type_name_on_any_name name ON any_name IS comment_text
    6581             :  { 
    6582           0 :  $$ = cat_str(7,mm_strdup("comment on"),$3,$4,mm_strdup("on"),$6,mm_strdup("is"),$8);
    6583             : }
    6584             : |  COMMENT ON PROCEDURE function_with_argtypes IS comment_text
    6585             :  { 
    6586           0 :  $$ = cat_str(4,mm_strdup("comment on procedure"),$4,mm_strdup("is"),$6);
    6587             : }
    6588             : |  COMMENT ON ROUTINE function_with_argtypes IS comment_text
    6589             :  { 
    6590           0 :  $$ = cat_str(4,mm_strdup("comment on routine"),$4,mm_strdup("is"),$6);
    6591             : }
    6592             : |  COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text
    6593             :  { 
    6594           0 :  $$ = cat_str(6,mm_strdup("comment on transform for"),$5,mm_strdup("language"),$7,mm_strdup("is"),$9);
    6595             : }
    6596             : |  COMMENT ON OPERATOR CLASS any_name USING name IS comment_text
    6597             :  { 
    6598           0 :  $$ = cat_str(6,mm_strdup("comment on operator class"),$5,mm_strdup("using"),$7,mm_strdup("is"),$9);
    6599             : }
    6600             : |  COMMENT ON OPERATOR FAMILY any_name USING name IS comment_text
    6601             :  { 
    6602           0 :  $$ = cat_str(6,mm_strdup("comment on operator family"),$5,mm_strdup("using"),$7,mm_strdup("is"),$9);
    6603             : }
    6604             : |  COMMENT ON LARGE_P OBJECT_P NumericOnly IS comment_text
    6605             :  { 
    6606           0 :  $$ = cat_str(4,mm_strdup("comment on large object"),$5,mm_strdup("is"),$7);
    6607             : }
    6608             : |  COMMENT ON CAST '(' Typename AS Typename ')' IS comment_text
    6609             :  { 
    6610           0 :  $$ = cat_str(6,mm_strdup("comment on cast ("),$5,mm_strdup("as"),$7,mm_strdup(") is"),$10);
    6611             : }
    6612             : ;
    6613             : 
    6614             : 
    6615             :  comment_text:
    6616             :  ecpg_sconst
    6617             :  { 
    6618           0 :  $$ = $1;
    6619             : }
    6620             : |  NULL_P
    6621             :  { 
    6622           0 :  $$ = mm_strdup("null");
    6623             : }
    6624             : ;
    6625             : 
    6626             : 
    6627             :  SecLabelStmt:
    6628             :  SECURITY LABEL opt_provider ON object_type_any_name any_name IS security_label
    6629             :  { 
    6630           0 :  $$ = cat_str(7,mm_strdup("security label"),$3,mm_strdup("on"),$5,$6,mm_strdup("is"),$8);
    6631             : }
    6632             : |  SECURITY LABEL opt_provider ON COLUMN any_name IS security_label
    6633             :  { 
    6634           0 :  $$ = cat_str(6,mm_strdup("security label"),$3,mm_strdup("on column"),$6,mm_strdup("is"),$8);
    6635             : }
    6636             : |  SECURITY LABEL opt_provider ON object_type_name name IS security_label
    6637             :  { 
    6638           0 :  $$ = cat_str(7,mm_strdup("security label"),$3,mm_strdup("on"),$5,$6,mm_strdup("is"),$8);
    6639             : }
    6640             : |  SECURITY LABEL opt_provider ON TYPE_P Typename IS security_label
    6641             :  { 
    6642           0 :  $$ = cat_str(6,mm_strdup("security label"),$3,mm_strdup("on type"),$6,mm_strdup("is"),$8);
    6643             : }
    6644             : |  SECURITY LABEL opt_provider ON DOMAIN_P Typename IS security_label
    6645             :  { 
    6646           0 :  $$ = cat_str(6,mm_strdup("security label"),$3,mm_strdup("on domain"),$6,mm_strdup("is"),$8);
    6647             : }
    6648             : |  SECURITY LABEL opt_provider ON AGGREGATE aggregate_with_argtypes IS security_label
    6649             :  { 
    6650           0 :  $$ = cat_str(6,mm_strdup("security label"),$3,mm_strdup("on aggregate"),$6,mm_strdup("is"),$8);
    6651             : }
    6652             : |  SECURITY LABEL opt_provider ON FUNCTION function_with_argtypes IS security_label
    6653             :  { 
    6654           0 :  $$ = cat_str(6,mm_strdup("security label"),$3,mm_strdup("on function"),$6,mm_strdup("is"),$8);
    6655             : }
    6656             : |  SECURITY LABEL opt_provider ON LARGE_P OBJECT_P NumericOnly IS security_label
    6657             :  { 
    6658           0 :  $$ = cat_str(6,mm_strdup("security label"),$3,mm_strdup("on large object"),$7,mm_strdup("is"),$9);
    6659             : }
    6660             : |  SECURITY LABEL opt_provider ON PROCEDURE function_with_argtypes IS security_label
    6661             :  { 
    6662           0 :  $$ = cat_str(6,mm_strdup("security label"),$3,mm_strdup("on procedure"),$6,mm_strdup("is"),$8);
    6663             : }
    6664             : |  SECURITY LABEL opt_provider ON ROUTINE function_with_argtypes IS security_label
    6665             :  { 
    6666           0 :  $$ = cat_str(6,mm_strdup("security label"),$3,mm_strdup("on routine"),$6,mm_strdup("is"),$8);
    6667             : }
    6668             : ;
    6669             : 
    6670             : 
    6671             :  opt_provider:
    6672             :  FOR NonReservedWord_or_Sconst
    6673             :  { 
    6674           0 :  $$ = cat_str(2,mm_strdup("for"),$2);
    6675             : }
    6676             : | 
    6677             :  { 
    6678           0 :  $$=EMPTY; }
    6679             : ;
    6680             : 
    6681             : 
    6682             :  security_label:
    6683             :  ecpg_sconst
    6684             :  { 
    6685           0 :  $$ = $1;
    6686             : }
    6687             : |  NULL_P
    6688             :  { 
    6689           0 :  $$ = mm_strdup("null");
    6690             : }
    6691             : ;
    6692             : 
    6693             : 
    6694             :  FetchStmt:
    6695             :  FETCH fetch_args
    6696             :  { 
    6697          14 :  $$ = cat_str(2,mm_strdup("fetch"),$2);
    6698             : }
    6699             : |  MOVE fetch_args
    6700             :  { 
    6701          10 :  $$ = cat_str(2,mm_strdup("move"),$2);
    6702             : }
    6703             :     | FETCH fetch_args ecpg_fetch_into
    6704             :     {
    6705          96 :         $$ = cat2_str(mm_strdup("fetch"), $2);
    6706             :     }
    6707             :     | FETCH FORWARD cursor_name opt_ecpg_fetch_into
    6708             :     {
    6709           4 :         char *cursor_marker = $3[0] == ':' ? mm_strdup("$0") : $3;
    6710           4 :         struct cursor *ptr = add_additional_variables($3, false);
    6711           4 :         if (ptr -> connection)
    6712           2 :             connection = mm_strdup(ptr -> connection);
    6713             : 
    6714           4 :         $$ = cat_str(2, mm_strdup("fetch forward"), cursor_marker);
    6715             :     }
    6716             :     | FETCH FORWARD from_in cursor_name opt_ecpg_fetch_into
    6717             :     {
    6718           2 :         char *cursor_marker = $4[0] == ':' ? mm_strdup("$0") : $4;
    6719           2 :         struct cursor *ptr = add_additional_variables($4, false);
    6720           2 :             if (ptr -> connection)
    6721           2 :                 connection = mm_strdup(ptr -> connection);
    6722             : 
    6723           2 :         $$ = cat_str(2, mm_strdup("fetch forward from"), cursor_marker);
    6724             :     }
    6725             :     | FETCH BACKWARD cursor_name opt_ecpg_fetch_into
    6726             :     {
    6727           0 :         char *cursor_marker = $3[0] == ':' ? mm_strdup("$0") : $3;
    6728           0 :         struct cursor *ptr = add_additional_variables($3, false);
    6729           0 :         if (ptr -> connection)
    6730           0 :             connection = mm_strdup(ptr -> connection);
    6731             : 
    6732           0 :         $$ = cat_str(2, mm_strdup("fetch backward"), cursor_marker);
    6733             :     }
    6734             :     | FETCH BACKWARD from_in cursor_name opt_ecpg_fetch_into
    6735             :     {
    6736           0 :         char *cursor_marker = $4[0] == ':' ? mm_strdup("$0") : $4;
    6737           0 :         struct cursor *ptr = add_additional_variables($4, false);
    6738           0 :         if (ptr -> connection)
    6739           0 :             connection = mm_strdup(ptr -> connection);
    6740             : 
    6741           0 :         $$ = cat_str(2, mm_strdup("fetch backward from"), cursor_marker);
    6742             :     }
    6743             :     | MOVE FORWARD cursor_name
    6744             :     {
    6745           0 :         char *cursor_marker = $3[0] == ':' ? mm_strdup("$0") : $3;
    6746           0 :         struct cursor *ptr = add_additional_variables($3, false);
    6747           0 :         if (ptr -> connection)
    6748           0 :             connection = mm_strdup(ptr -> connection);
    6749             : 
    6750           0 :         $$ = cat_str(2, mm_strdup("move forward"), cursor_marker);
    6751             :     }
    6752             :     | MOVE FORWARD from_in cursor_name
    6753             :     {
    6754           0 :         char *cursor_marker = $4[0] == ':' ? mm_strdup("$0") : $4;
    6755           0 :         struct cursor *ptr = add_additional_variables($4, false);
    6756           0 :         if (ptr -> connection)
    6757           0 :             connection = mm_strdup(ptr -> connection);
    6758             : 
    6759           0 :         $$ = cat_str(2, mm_strdup("move forward from"), cursor_marker);
    6760             :     }
    6761             :     | MOVE BACKWARD cursor_name
    6762             :     {
    6763           0 :         char *cursor_marker = $3[0] == ':' ? mm_strdup("$0") : $3;
    6764           0 :         struct cursor *ptr = add_additional_variables($3, false);
    6765           0 :         if (ptr -> connection)
    6766           0 :             connection = mm_strdup(ptr -> connection);
    6767             : 
    6768           0 :         $$ = cat_str(2, mm_strdup("move backward"), cursor_marker);
    6769             :     }
    6770             :     | MOVE BACKWARD from_in cursor_name
    6771             :     {
    6772           0 :         char *cursor_marker = $4[0] == ':' ? mm_strdup("$0") : $4;
    6773           0 :         struct cursor *ptr = add_additional_variables($4, false);
    6774           0 :         if (ptr -> connection)
    6775           0 :             connection = mm_strdup(ptr -> connection);
    6776             : 
    6777           0 :         $$ = cat_str(2, mm_strdup("move backward from"), cursor_marker);
    6778             :     }
    6779             : ;
    6780             : 
    6781             : 
    6782             :  fetch_args:
    6783             :  cursor_name
    6784             :  { 
    6785          32 :         struct cursor *ptr = add_additional_variables($1, false);
    6786          32 :         if (ptr -> connection)
    6787          12 :             connection = mm_strdup(ptr -> connection);
    6788             : 
    6789          32 :         if ($1[0] == ':')
    6790             :         {
    6791           6 :             free($1);
    6792           6 :             $1 = mm_strdup("$0");
    6793             :         }
    6794             : 
    6795          32 :  $$ = $1;
    6796             : }
    6797             : |  from_in cursor_name
    6798             :  { 
    6799          22 :         struct cursor *ptr = add_additional_variables($2, false);
    6800          22 :         if (ptr -> connection)
    6801           6 :             connection = mm_strdup(ptr -> connection);
    6802             : 
    6803          22 :         if ($2[0] == ':')
    6804             :         {
    6805           6 :             free($2);
    6806           6 :             $2 = mm_strdup("$0");
    6807             :         }
    6808             : 
    6809          22 :  $$ = cat_str(2,$1,$2);
    6810             : }
    6811             : |  NEXT opt_from_in cursor_name
    6812             :  { 
    6813           6 :         struct cursor *ptr = add_additional_variables($3, false);
    6814           6 :         if (ptr -> connection)
    6815           0 :             connection = mm_strdup(ptr -> connection);
    6816             : 
    6817           6 :         if ($3[0] == ':')
    6818             :         {
    6819           0 :             free($3);
    6820           0 :             $3 = mm_strdup("$0");
    6821             :         }
    6822             : 
    6823           6 :  $$ = cat_str(3,mm_strdup("next"),$2,$3);
    6824             : }
    6825             : |  PRIOR opt_from_in cursor_name
    6826             :  { 
    6827           0 :         struct cursor *ptr = add_additional_variables($3, false);
    6828           0 :         if (ptr -> connection)
    6829           0 :             connection = mm_strdup(ptr -> connection);
    6830             : 
    6831           0 :         if ($3[0] == ':')
    6832             :         {
    6833           0 :             free($3);
    6834           0 :             $3 = mm_strdup("$0");
    6835             :         }
    6836             : 
    6837           0 :  $$ = cat_str(3,mm_strdup("prior"),$2,$3);
    6838             : }
    6839             : |  FIRST_P opt_from_in cursor_name
    6840             :  { 
    6841           0 :         struct cursor *ptr = add_additional_variables($3, false);
    6842           0 :         if (ptr -> connection)
    6843           0 :             connection = mm_strdup(ptr -> connection);
    6844             : 
    6845           0 :         if ($3[0] == ':')
    6846             :         {
    6847           0 :             free($3);
    6848           0 :             $3 = mm_strdup("$0");
    6849             :         }
    6850             : 
    6851           0 :  $$ = cat_str(3,mm_strdup("first"),$2,$3);
    6852             : }
    6853             : |  LAST_P opt_from_in cursor_name
    6854             :  { 
    6855           0 :         struct cursor *ptr = add_additional_variables($3, false);
    6856           0 :         if (ptr -> connection)
    6857           0 :             connection = mm_strdup(ptr -> connection);
    6858             : 
    6859           0 :         if ($3[0] == ':')
    6860             :         {
    6861           0 :             free($3);
    6862           0 :             $3 = mm_strdup("$0");
    6863             :         }
    6864             : 
    6865           0 :  $$ = cat_str(3,mm_strdup("last"),$2,$3);
    6866             : }
    6867             : |  ABSOLUTE_P SignedIconst opt_from_in cursor_name
    6868             :  { 
    6869           8 :         struct cursor *ptr = add_additional_variables($4, false);
    6870           8 :         if (ptr -> connection)
    6871           8 :             connection = mm_strdup(ptr -> connection);
    6872             : 
    6873           8 :         if ($4[0] == ':')
    6874             :         {
    6875           8 :             free($4);
    6876           8 :             $4 = mm_strdup("$0");
    6877             :         }
    6878           8 :         if ($2[0] == '$')
    6879             :         {
    6880           0 :             free($2);
    6881           0 :             $2 = mm_strdup("$0");
    6882             :         }
    6883             : 
    6884           8 :  $$ = cat_str(4,mm_strdup("absolute"),$2,$3,$4);
    6885             : }
    6886             : |  RELATIVE_P SignedIconst opt_from_in cursor_name
    6887             :  { 
    6888           0 :         struct cursor *ptr = add_additional_variables($4, false);
    6889           0 :         if (ptr -> connection)
    6890           0 :             connection = mm_strdup(ptr -> connection);
    6891             : 
    6892           0 :         if ($4[0] == ':')
    6893             :         {
    6894           0 :             free($4);
    6895           0 :             $4 = mm_strdup("$0");
    6896             :         }
    6897           0 :         if ($2[0] == '$')
    6898             :         {
    6899           0 :             free($2);
    6900           0 :             $2 = mm_strdup("$0");
    6901             :         }
    6902             : 
    6903           0 :  $$ = cat_str(4,mm_strdup("relative"),$2,$3,$4);
    6904             : }
    6905             : |  SignedIconst opt_from_in cursor_name
    6906             :  { 
    6907          48 :         struct cursor *ptr = add_additional_variables($3, false);
    6908          48 :         if (ptr -> connection)
    6909          32 :             connection = mm_strdup(ptr -> connection);
    6910             : 
    6911          48 :         if ($3[0] == ':')
    6912             :         {
    6913          32 :             free($3);
    6914          32 :             $3 = mm_strdup("$0");
    6915             :         }
    6916          48 :         if ($1[0] == '$')
    6917             :         {
    6918          18 :             free($1);
    6919          18 :             $1 = mm_strdup("$0");
    6920             :         }
    6921             : 
    6922          48 :  $$ = cat_str(3,$1,$2,$3);
    6923             : }
    6924             : |  ALL opt_from_in cursor_name
    6925             :  { 
    6926           2 :         struct cursor *ptr = add_additional_variables($3, false);
    6927           2 :         if (ptr -> connection)
    6928           0 :             connection = mm_strdup(ptr -> connection);
    6929             : 
    6930           2 :         if ($3[0] == ':')
    6931             :         {
    6932           0 :             free($3);
    6933           0 :             $3 = mm_strdup("$0");
    6934             :         }
    6935             : 
    6936           2 :  $$ = cat_str(3,mm_strdup("all"),$2,$3);
    6937             : }
    6938             : |  FORWARD SignedIconst opt_from_in cursor_name
    6939             :  { 
    6940           0 :         struct cursor *ptr = add_additional_variables($4, false);
    6941           0 :         if (ptr -> connection)
    6942           0 :             connection = mm_strdup(ptr -> connection);
    6943             : 
    6944           0 :         if ($4[0] == ':')
    6945             :         {
    6946           0 :             free($4);
    6947           0 :             $4 = mm_strdup("$0");
    6948             :         }
    6949           0 :         if ($2[0] == '$')
    6950             :         {
    6951           0 :             free($2);
    6952           0 :             $2 = mm_strdup("$0");
    6953             :         }
    6954             : 
    6955           0 :  $$ = cat_str(4,mm_strdup("forward"),$2,$3,$4);
    6956             : }
    6957             : |  FORWARD ALL opt_from_in cursor_name
    6958             :  { 
    6959           0 :         struct cursor *ptr = add_additional_variables($4, false);
    6960           0 :         if (ptr -> connection)
    6961           0 :             connection = mm_strdup(ptr -> connection);
    6962             : 
    6963           0 :         if ($4[0] == ':')
    6964             :         {
    6965           0 :             free($4);
    6966           0 :             $4 = mm_strdup("$0");
    6967             :         }
    6968             : 
    6969           0 :  $$ = cat_str(3,mm_strdup("forward all"),$3,$4);
    6970             : }
    6971             : |  BACKWARD SignedIconst opt_from_in cursor_name
    6972             :  { 
    6973           2 :         struct cursor *ptr = add_additional_variables($4, false);
    6974           2 :         if (ptr -> connection)
    6975           0 :             connection = mm_strdup(ptr -> connection);
    6976             : 
    6977           2 :         if ($4[0] == ':')
    6978             :         {
    6979           0 :             free($4);
    6980           0 :             $4 = mm_strdup("$0");
    6981             :         }
    6982           2 :         if ($2[0] == '$')
    6983             :         {
    6984           0 :             free($2);
    6985           0 :             $2 = mm_strdup("$0");
    6986             :         }
    6987             : 
    6988           2 :  $$ = cat_str(4,mm_strdup("backward"),$2,$3,$4);
    6989             : }
    6990             : |  BACKWARD ALL opt_from_in cursor_name
    6991             :  { 
    6992           0 :         struct cursor *ptr = add_additional_variables($4, false);
    6993           0 :         if (ptr -> connection)
    6994           0 :             connection = mm_strdup(ptr -> connection);
    6995             : 
    6996           0 :         if ($4[0] == ':')
    6997             :         {
    6998           0 :             free($4);
    6999           0 :             $4 = mm_strdup("$0");
    7000             :         }
    7001             : 
    7002           0 :  $$ = cat_str(3,mm_strdup("backward all"),$3,$4);
    7003             : }
    7004             : ;
    7005             : 
    7006             : 
    7007             :  from_in:
    7008             :  FROM
    7009             :  { 
    7010          46 :  $$ = mm_strdup("from");
    7011             : }
    7012             : |  IN_P
    7013             :  { 
    7014          22 :  $$ = mm_strdup("in");
    7015             : }
    7016             : ;
    7017             : 
    7018             : 
    7019             :  opt_from_in:
    7020             :  from_in
    7021             :  { 
    7022          44 :  $$ = $1;
    7023             : }
    7024             : | 
    7025             :  { 
    7026          22 :  $$=EMPTY; }
    7027             : ;
    7028             : 
    7029             : 
    7030             :  GrantStmt:
    7031             :  GRANT privileges ON privilege_target TO grantee_list opt_grant_grant_option opt_granted_by
    7032             :  { 
    7033           0 :  $$ = cat_str(8,mm_strdup("grant"),$2,mm_strdup("on"),$4,mm_strdup("to"),$6,$7,$8);
    7034             : }
    7035             : ;
    7036             : 
    7037             : 
    7038             :  RevokeStmt:
    7039             :  REVOKE privileges ON privilege_target FROM grantee_list opt_granted_by opt_drop_behavior
    7040             :  { 
    7041           0 :  $$ = cat_str(8,mm_strdup("revoke"),$2,mm_strdup("on"),$4,mm_strdup("from"),$6,$7,$8);
    7042             : }
    7043             : |  REVOKE GRANT OPTION FOR privileges ON privilege_target FROM grantee_list opt_granted_by opt_drop_behavior
    7044             :  { 
    7045           0 :  $$ = cat_str(8,mm_strdup("revoke grant option for"),$5,mm_strdup("on"),$7,mm_strdup("from"),$9,$10,$11);
    7046             : }
    7047             : ;
    7048             : 
    7049             : 
    7050             :  privileges:
    7051             :  privilege_list
    7052             :  { 
    7053           0 :  $$ = $1;
    7054             : }
    7055             : |  ALL
    7056             :  { 
    7057           0 :  $$ = mm_strdup("all");
    7058             : }
    7059             : |  ALL PRIVILEGES
    7060             :  { 
    7061           0 :  $$ = mm_strdup("all privileges");
    7062             : }
    7063             : |  ALL '(' columnList ')'
    7064             :  { 
    7065           0 :  $$ = cat_str(3,mm_strdup("all ("),$3,mm_strdup(")"));
    7066             : }
    7067             : |  ALL PRIVILEGES '(' columnList ')'
    7068             :  { 
    7069           0 :  $$ = cat_str(3,mm_strdup("all privileges ("),$4,mm_strdup(")"));
    7070             : }
    7071             : ;
    7072             : 
    7073             : 
    7074             :  privilege_list:
    7075             :  privilege
    7076             :  { 
    7077           0 :  $$ = $1;
    7078             : }
    7079             : |  privilege_list ',' privilege
    7080             :  { 
    7081           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    7082             : }
    7083             : ;
    7084             : 
    7085             : 
    7086             :  privilege:
    7087             :  SELECT opt_column_list
    7088             :  { 
    7089           0 :  $$ = cat_str(2,mm_strdup("select"),$2);
    7090             : }
    7091             : |  REFERENCES opt_column_list
    7092             :  { 
    7093           0 :  $$ = cat_str(2,mm_strdup("references"),$2);
    7094             : }
    7095             : |  CREATE opt_column_list
    7096             :  { 
    7097           0 :  $$ = cat_str(2,mm_strdup("create"),$2);
    7098             : }
    7099             : |  ALTER SYSTEM_P
    7100             :  { 
    7101           0 :  $$ = mm_strdup("alter system");
    7102             : }
    7103             : |  ColId opt_column_list
    7104             :  { 
    7105           0 :  $$ = cat_str(2,$1,$2);
    7106             : }
    7107             : ;
    7108             : 
    7109             : 
    7110             :  parameter_name_list:
    7111             :  parameter_name
    7112             :  { 
    7113           0 :  $$ = $1;
    7114             : }
    7115             : |  parameter_name_list ',' parameter_name
    7116             :  { 
    7117           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    7118             : }
    7119             : ;
    7120             : 
    7121             : 
    7122             :  parameter_name:
    7123             :  ColId
    7124             :  { 
    7125           0 :  $$ = $1;
    7126             : }
    7127             : |  parameter_name '.' ColId
    7128             :  { 
    7129           0 :  $$ = cat_str(3,$1,mm_strdup("."),$3);
    7130             : }
    7131             : ;
    7132             : 
    7133             : 
    7134             :  privilege_target:
    7135             :  qualified_name_list
    7136             :  { 
    7137           0 :  $$ = $1;
    7138             : }
    7139             : |  TABLE qualified_name_list
    7140             :  { 
    7141           0 :  $$ = cat_str(2,mm_strdup("table"),$2);
    7142             : }
    7143             : |  SEQUENCE qualified_name_list
    7144             :  { 
    7145           0 :  $$ = cat_str(2,mm_strdup("sequence"),$2);
    7146             : }
    7147             : |  FOREIGN DATA_P WRAPPER name_list
    7148             :  { 
    7149           0 :  $$ = cat_str(2,mm_strdup("foreign data wrapper"),$4);
    7150             : }
    7151             : |  FOREIGN SERVER name_list
    7152             :  { 
    7153           0 :  $$ = cat_str(2,mm_strdup("foreign server"),$3);
    7154             : }
    7155             : |  FUNCTION function_with_argtypes_list
    7156             :  { 
    7157           0 :  $$ = cat_str(2,mm_strdup("function"),$2);
    7158             : }
    7159             : |  PROCEDURE function_with_argtypes_list
    7160             :  { 
    7161           0 :  $$ = cat_str(2,mm_strdup("procedure"),$2);
    7162             : }
    7163             : |  ROUTINE function_with_argtypes_list
    7164             :  { 
    7165           0 :  $$ = cat_str(2,mm_strdup("routine"),$2);
    7166             : }
    7167             : |  DATABASE name_list
    7168             :  { 
    7169           0 :  $$ = cat_str(2,mm_strdup("database"),$2);
    7170             : }
    7171             : |  DOMAIN_P any_name_list
    7172             :  { 
    7173           0 :  $$ = cat_str(2,mm_strdup("domain"),$2);
    7174             : }
    7175             : |  LANGUAGE name_list
    7176             :  { 
    7177           0 :  $$ = cat_str(2,mm_strdup("language"),$2);
    7178             : }
    7179             : |  LARGE_P OBJECT_P NumericOnly_list
    7180             :  { 
    7181           0 :  $$ = cat_str(2,mm_strdup("large object"),$3);
    7182             : }
    7183             : |  PARAMETER parameter_name_list
    7184             :  { 
    7185           0 :  $$ = cat_str(2,mm_strdup("parameter"),$2);
    7186             : }
    7187             : |  SCHEMA name_list
    7188             :  { 
    7189           0 :  $$ = cat_str(2,mm_strdup("schema"),$2);
    7190             : }
    7191             : |  TABLESPACE name_list
    7192             :  { 
    7193           0 :  $$ = cat_str(2,mm_strdup("tablespace"),$2);
    7194             : }
    7195             : |  TYPE_P any_name_list
    7196             :  { 
    7197           0 :  $$ = cat_str(2,mm_strdup("type"),$2);
    7198             : }
    7199             : |  ALL TABLES IN_P SCHEMA name_list
    7200             :  { 
    7201           0 :  $$ = cat_str(2,mm_strdup("all tables in schema"),$5);
    7202             : }
    7203             : |  ALL SEQUENCES IN_P SCHEMA name_list
    7204             :  { 
    7205           0 :  $$ = cat_str(2,mm_strdup("all sequences in schema"),$5);
    7206             : }
    7207             : |  ALL FUNCTIONS IN_P SCHEMA name_list
    7208             :  { 
    7209           0 :  $$ = cat_str(2,mm_strdup("all functions in schema"),$5);
    7210             : }
    7211             : |  ALL PROCEDURES IN_P SCHEMA name_list
    7212             :  { 
    7213           0 :  $$ = cat_str(2,mm_strdup("all procedures in schema"),$5);
    7214             : }
    7215             : |  ALL ROUTINES IN_P SCHEMA name_list
    7216             :  { 
    7217           0 :  $$ = cat_str(2,mm_strdup("all routines in schema"),$5);
    7218             : }
    7219             : ;
    7220             : 
    7221             : 
    7222             :  grantee_list:
    7223             :  grantee
    7224             :  { 
    7225           0 :  $$ = $1;
    7226             : }
    7227             : |  grantee_list ',' grantee
    7228             :  { 
    7229           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    7230             : }
    7231             : ;
    7232             : 
    7233             : 
    7234             :  grantee:
    7235             :  RoleSpec
    7236             :  { 
    7237           0 :  $$ = $1;
    7238             : }
    7239             : |  GROUP_P RoleSpec
    7240             :  { 
    7241           0 :  $$ = cat_str(2,mm_strdup("group"),$2);
    7242             : }
    7243             : ;
    7244             : 
    7245             : 
    7246             :  opt_grant_grant_option:
    7247             :  WITH GRANT OPTION
    7248             :  { 
    7249           0 :  $$ = mm_strdup("with grant option");
    7250             : }
    7251             : | 
    7252             :  { 
    7253           0 :  $$=EMPTY; }
    7254             : ;
    7255             : 
    7256             : 
    7257             :  GrantRoleStmt:
    7258             :  GRANT privilege_list TO role_list opt_granted_by
    7259             :  { 
    7260           0 :  $$ = cat_str(5,mm_strdup("grant"),$2,mm_strdup("to"),$4,$5);
    7261             : }
    7262             : |  GRANT privilege_list TO role_list WITH grant_role_opt_list opt_granted_by
    7263             :  { 
    7264           0 :  $$ = cat_str(7,mm_strdup("grant"),$2,mm_strdup("to"),$4,mm_strdup("with"),$6,$7);
    7265             : }
    7266             : ;
    7267             : 
    7268             : 
    7269             :  RevokeRoleStmt:
    7270             :  REVOKE privilege_list FROM role_list opt_granted_by opt_drop_behavior
    7271             :  { 
    7272           0 :  $$ = cat_str(6,mm_strdup("revoke"),$2,mm_strdup("from"),$4,$5,$6);
    7273             : }
    7274             : |  REVOKE ColId OPTION FOR privilege_list FROM role_list opt_granted_by opt_drop_behavior
    7275             :  { 
    7276           0 :  $$ = cat_str(8,mm_strdup("revoke"),$2,mm_strdup("option for"),$5,mm_strdup("from"),$7,$8,$9);
    7277             : }
    7278             : ;
    7279             : 
    7280             : 
    7281             :  grant_role_opt_list:
    7282             :  grant_role_opt_list ',' grant_role_opt
    7283             :  { 
    7284           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    7285             : }
    7286             : |  grant_role_opt
    7287             :  { 
    7288           0 :  $$ = $1;
    7289             : }
    7290             : ;
    7291             : 
    7292             : 
    7293             :  grant_role_opt:
    7294             :  ColLabel grant_role_opt_value
    7295             :  { 
    7296           0 :  $$ = cat_str(2,$1,$2);
    7297             : }
    7298             : ;
    7299             : 
    7300             : 
    7301             :  grant_role_opt_value:
    7302             :  OPTION
    7303             :  { 
    7304           0 :  $$ = mm_strdup("option");
    7305             : }
    7306             : |  TRUE_P
    7307             :  { 
    7308           0 :  $$ = mm_strdup("true");
    7309             : }
    7310             : |  FALSE_P
    7311             :  { 
    7312           0 :  $$ = mm_strdup("false");
    7313             : }
    7314             : ;
    7315             : 
    7316             : 
    7317             :  opt_granted_by:
    7318             :  GRANTED BY RoleSpec
    7319             :  { 
    7320           0 :  $$ = cat_str(2,mm_strdup("granted by"),$3);
    7321             : }
    7322             : | 
    7323             :  { 
    7324           0 :  $$=EMPTY; }
    7325             : ;
    7326             : 
    7327             : 
    7328             :  AlterDefaultPrivilegesStmt:
    7329             :  ALTER DEFAULT PRIVILEGES DefACLOptionList DefACLAction
    7330             :  { 
    7331           0 :  $$ = cat_str(3,mm_strdup("alter default privileges"),$4,$5);
    7332             : }
    7333             : ;
    7334             : 
    7335             : 
    7336             :  DefACLOptionList:
    7337             :  DefACLOptionList DefACLOption
    7338             :  { 
    7339           0 :  $$ = cat_str(2,$1,$2);
    7340             : }
    7341             : | 
    7342             :  { 
    7343           0 :  $$=EMPTY; }
    7344             : ;
    7345             : 
    7346             : 
    7347             :  DefACLOption:
    7348             :  IN_P SCHEMA name_list
    7349             :  { 
    7350           0 :  $$ = cat_str(2,mm_strdup("in schema"),$3);
    7351             : }
    7352             : |  FOR ROLE role_list
    7353             :  { 
    7354           0 :  $$ = cat_str(2,mm_strdup("for role"),$3);
    7355             : }
    7356             : |  FOR USER role_list
    7357             :  { 
    7358           0 :  $$ = cat_str(2,mm_strdup("for user"),$3);
    7359             : }
    7360             : ;
    7361             : 
    7362             : 
    7363             :  DefACLAction:
    7364             :  GRANT privileges ON defacl_privilege_target TO grantee_list opt_grant_grant_option
    7365             :  { 
    7366           0 :  $$ = cat_str(7,mm_strdup("grant"),$2,mm_strdup("on"),$4,mm_strdup("to"),$6,$7);
    7367             : }
    7368             : |  REVOKE privileges ON defacl_privilege_target FROM grantee_list opt_drop_behavior
    7369             :  { 
    7370           0 :  $$ = cat_str(7,mm_strdup("revoke"),$2,mm_strdup("on"),$4,mm_strdup("from"),$6,$7);
    7371             : }
    7372             : |  REVOKE GRANT OPTION FOR privileges ON defacl_privilege_target FROM grantee_list opt_drop_behavior
    7373             :  { 
    7374           0 :  $$ = cat_str(7,mm_strdup("revoke grant option for"),$5,mm_strdup("on"),$7,mm_strdup("from"),$9,$10);
    7375             : }
    7376             : ;
    7377             : 
    7378             : 
    7379             :  defacl_privilege_target:
    7380             :  TABLES
    7381             :  { 
    7382           0 :  $$ = mm_strdup("tables");
    7383             : }
    7384             : |  FUNCTIONS
    7385             :  { 
    7386           0 :  $$ = mm_strdup("functions");
    7387             : }
    7388             : |  ROUTINES
    7389             :  { 
    7390           0 :  $$ = mm_strdup("routines");
    7391             : }
    7392             : |  SEQUENCES
    7393             :  { 
    7394           0 :  $$ = mm_strdup("sequences");
    7395             : }
    7396             : |  TYPES_P
    7397             :  { 
    7398           0 :  $$ = mm_strdup("types");
    7399             : }
    7400             : |  SCHEMAS
    7401             :  { 
    7402           0 :  $$ = mm_strdup("schemas");
    7403             : }
    7404             : ;
    7405             : 
    7406             : 
    7407             :  IndexStmt:
    7408             :  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
    7409             :  { 
    7410           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);
    7411             : }
    7412             : |  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
    7413             :  { 
    7414           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);
    7415             : }
    7416             : ;
    7417             : 
    7418             : 
    7419             :  opt_unique:
    7420             :  UNIQUE
    7421             :  { 
    7422           0 :  $$ = mm_strdup("unique");
    7423             : }
    7424             : | 
    7425             :  { 
    7426           0 :  $$=EMPTY; }
    7427             : ;
    7428             : 
    7429             : 
    7430             :  access_method_clause:
    7431             :  USING name
    7432             :  { 
    7433           0 :  $$ = cat_str(2,mm_strdup("using"),$2);
    7434             : }
    7435             : | 
    7436             :  { 
    7437           0 :  $$=EMPTY; }
    7438             : ;
    7439             : 
    7440             : 
    7441             :  index_params:
    7442             :  index_elem
    7443             :  { 
    7444           0 :  $$ = $1;
    7445             : }
    7446             : |  index_params ',' index_elem
    7447             :  { 
    7448           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    7449             : }
    7450             : ;
    7451             : 
    7452             : 
    7453             :  index_elem_options:
    7454             :  opt_collate opt_qualified_name opt_asc_desc opt_nulls_order
    7455             :  { 
    7456           0 :  $$ = cat_str(4,$1,$2,$3,$4);
    7457             : }
    7458             : |  opt_collate any_name reloptions opt_asc_desc opt_nulls_order
    7459             :  { 
    7460           0 :  $$ = cat_str(5,$1,$2,$3,$4,$5);
    7461             : }
    7462             : ;
    7463             : 
    7464             : 
    7465             :  index_elem:
    7466             :  ColId index_elem_options
    7467             :  { 
    7468           0 :  $$ = cat_str(2,$1,$2);
    7469             : }
    7470             : |  func_expr_windowless index_elem_options
    7471             :  { 
    7472           0 :  $$ = cat_str(2,$1,$2);
    7473             : }
    7474             : |  '(' a_expr ')' index_elem_options
    7475             :  { 
    7476           0 :  $$ = cat_str(4,mm_strdup("("),$2,mm_strdup(")"),$4);
    7477             : }
    7478             : ;
    7479             : 
    7480             : 
    7481             :  opt_include:
    7482             :  INCLUDE '(' index_including_params ')'
    7483             :  { 
    7484           0 :  $$ = cat_str(3,mm_strdup("include ("),$3,mm_strdup(")"));
    7485             : }
    7486             : | 
    7487             :  { 
    7488           0 :  $$=EMPTY; }
    7489             : ;
    7490             : 
    7491             : 
    7492             :  index_including_params:
    7493             :  index_elem
    7494             :  { 
    7495           0 :  $$ = $1;
    7496             : }
    7497             : |  index_including_params ',' index_elem
    7498             :  { 
    7499           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    7500             : }
    7501             : ;
    7502             : 
    7503             : 
    7504             :  opt_collate:
    7505             :  COLLATE any_name
    7506             :  { 
    7507           0 :  $$ = cat_str(2,mm_strdup("collate"),$2);
    7508             : }
    7509             : | 
    7510             :  { 
    7511           0 :  $$=EMPTY; }
    7512             : ;
    7513             : 
    7514             : 
    7515             :  opt_asc_desc:
    7516             :  ASC
    7517             :  { 
    7518           2 :  $$ = mm_strdup("asc");
    7519             : }
    7520             : |  DESC
    7521             :  { 
    7522           0 :  $$ = mm_strdup("desc");
    7523             : }
    7524             : | 
    7525             :  { 
    7526          10 :  $$=EMPTY; }
    7527             : ;
    7528             : 
    7529             : 
    7530             :  opt_nulls_order:
    7531             :  NULLS_LA FIRST_P
    7532             :  { 
    7533           0 :  $$ = mm_strdup("nulls first");
    7534             : }
    7535             : |  NULLS_LA LAST_P
    7536             :  { 
    7537           4 :  $$ = mm_strdup("nulls last");
    7538             : }
    7539             : | 
    7540             :  { 
    7541           8 :  $$=EMPTY; }
    7542             : ;
    7543             : 
    7544             : 
    7545             :  CreateFunctionStmt:
    7546             :  CREATE opt_or_replace FUNCTION func_name func_args_with_defaults RETURNS func_return opt_createfunc_opt_list opt_routine_body
    7547             :  { 
    7548           2 :  $$ = cat_str(9,mm_strdup("create"),$2,mm_strdup("function"),$4,$5,mm_strdup("returns"),$7,$8,$9);
    7549             : }
    7550             : |  CREATE opt_or_replace FUNCTION func_name func_args_with_defaults RETURNS TABLE '(' table_func_column_list ')' opt_createfunc_opt_list opt_routine_body
    7551             :  { 
    7552           0 :  $$ = cat_str(10,mm_strdup("create"),$2,mm_strdup("function"),$4,$5,mm_strdup("returns table ("),$9,mm_strdup(")"),$11,$12);
    7553             : }
    7554             : |  CREATE opt_or_replace FUNCTION func_name func_args_with_defaults opt_createfunc_opt_list opt_routine_body
    7555             :  { 
    7556           0 :  $$ = cat_str(7,mm_strdup("create"),$2,mm_strdup("function"),$4,$5,$6,$7);
    7557             : }
    7558             : |  CREATE opt_or_replace PROCEDURE func_name func_args_with_defaults opt_createfunc_opt_list opt_routine_body
    7559             :  { 
    7560           0 :  $$ = cat_str(7,mm_strdup("create"),$2,mm_strdup("procedure"),$4,$5,$6,$7);
    7561             : }
    7562             : ;
    7563             : 
    7564             : 
    7565             :  opt_or_replace:
    7566             :  OR REPLACE
    7567             :  { 
    7568           0 :  $$ = mm_strdup("or replace");
    7569             : }
    7570             : | 
    7571             :  { 
    7572           4 :  $$=EMPTY; }
    7573             : ;
    7574             : 
    7575             : 
    7576             :  func_args:
    7577             :  '(' func_args_list ')'
    7578             :  { 
    7579           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
    7580             : }
    7581             : |  '(' ')'
    7582             :  { 
    7583           2 :  $$ = mm_strdup("( )");
    7584             : }
    7585             : ;
    7586             : 
    7587             : 
    7588             :  func_args_list:
    7589             :  func_arg
    7590             :  { 
    7591           0 :  $$ = $1;
    7592             : }
    7593             : |  func_args_list ',' func_arg
    7594             :  { 
    7595           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    7596             : }
    7597             : ;
    7598             : 
    7599             : 
    7600             :  function_with_argtypes_list:
    7601             :  function_with_argtypes
    7602             :  { 
    7603           2 :  $$ = $1;
    7604             : }
    7605             : |  function_with_argtypes_list ',' function_with_argtypes
    7606             :  { 
    7607           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    7608             : }
    7609             : ;
    7610             : 
    7611             : 
    7612             :  function_with_argtypes:
    7613             :  func_name func_args
    7614             :  { 
    7615           2 :  $$ = cat_str(2,$1,$2);
    7616             : }
    7617             : |  type_func_name_keyword
    7618             :  { 
    7619           0 :  $$ = $1;
    7620             : }
    7621             : |  ColId
    7622             :  { 
    7623           0 :  $$ = $1;
    7624             : }
    7625             : |  ColId indirection
    7626             :  { 
    7627           0 :  $$ = cat_str(2,$1,$2);
    7628             : }
    7629             : ;
    7630             : 
    7631             : 
    7632             :  func_args_with_defaults:
    7633             :  '(' func_args_with_defaults_list ')'
    7634             :  { 
    7635           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
    7636             : }
    7637             : |  '(' ')'
    7638             :  { 
    7639           2 :  $$ = mm_strdup("( )");
    7640             : }
    7641             : ;
    7642             : 
    7643             : 
    7644             :  func_args_with_defaults_list:
    7645             :  func_arg_with_default
    7646             :  { 
    7647           0 :  $$ = $1;
    7648             : }
    7649             : |  func_args_with_defaults_list ',' func_arg_with_default
    7650             :  { 
    7651           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    7652             : }
    7653             : ;
    7654             : 
    7655             : 
    7656             :  func_arg:
    7657             :  arg_class param_name func_type
    7658             :  { 
    7659           0 :  $$ = cat_str(3,$1,$2,$3);
    7660             : }
    7661             : |  param_name arg_class func_type
    7662             :  { 
    7663           0 :  $$ = cat_str(3,$1,$2,$3);
    7664             : }
    7665             : |  param_name func_type
    7666             :  { 
    7667           0 :  $$ = cat_str(2,$1,$2);
    7668             : }
    7669             : |  arg_class func_type
    7670             :  { 
    7671           0 :  $$ = cat_str(2,$1,$2);
    7672             : }
    7673             : |  func_type
    7674             :  { 
    7675           0 :  $$ = $1;
    7676             : }
    7677             : ;
    7678             : 
    7679             : 
    7680             :  arg_class:
    7681             :  IN_P
    7682             :  { 
    7683           0 :  $$ = mm_strdup("in");
    7684             : }
    7685             : |  OUT_P
    7686             :  { 
    7687           0 :  $$ = mm_strdup("out");
    7688             : }
    7689             : |  INOUT
    7690             :  { 
    7691           0 :  $$ = mm_strdup("inout");
    7692             : }
    7693             : |  IN_P OUT_P
    7694             :  { 
    7695           0 :  $$ = mm_strdup("in out");
    7696             : }
    7697             : |  VARIADIC
    7698             :  { 
    7699           0 :  $$ = mm_strdup("variadic");
    7700             : }
    7701             : ;
    7702             : 
    7703             : 
    7704             :  param_name:
    7705             :  type_function_name
    7706             :  { 
    7707           0 :  $$ = $1;
    7708             : }
    7709             : ;
    7710             : 
    7711             : 
    7712             :  func_return:
    7713             :  func_type
    7714             :  { 
    7715           2 :  $$ = $1;
    7716             : }
    7717             : ;
    7718             : 
    7719             : 
    7720             :  func_type:
    7721             :  Typename
    7722             :  { 
    7723           2 :  $$ = $1;
    7724             : }
    7725             : |  type_function_name attrs '%' TYPE_P
    7726             :  { 
    7727           0 :  $$ = cat_str(3,$1,$2,mm_strdup("% type"));
    7728             : }
    7729             : |  SETOF type_function_name attrs '%' TYPE_P
    7730             :  { 
    7731           0 :  $$ = cat_str(4,mm_strdup("setof"),$2,$3,mm_strdup("% type"));
    7732             : }
    7733             : ;
    7734             : 
    7735             : 
    7736             :  func_arg_with_default:
    7737             :  func_arg
    7738             :  { 
    7739           0 :  $$ = $1;
    7740             : }
    7741             : |  func_arg DEFAULT a_expr
    7742             :  { 
    7743           0 :  $$ = cat_str(3,$1,mm_strdup("default"),$3);
    7744             : }
    7745             : |  func_arg '=' a_expr
    7746             :  { 
    7747           0 :  $$ = cat_str(3,$1,mm_strdup("="),$3);
    7748             : }
    7749             : ;
    7750             : 
    7751             : 
    7752             :  aggr_arg:
    7753             :  func_arg
    7754             :  { 
    7755           0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
    7756           0 :  $$ = $1;
    7757             : }
    7758             : ;
    7759             : 
    7760             : 
    7761             :  aggr_args:
    7762             :  '(' '*' ')'
    7763             :  { 
    7764           0 :  $$ = mm_strdup("( * )");
    7765             : }
    7766             : |  '(' aggr_args_list ')'
    7767             :  { 
    7768           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
    7769             : }
    7770             : |  '(' ORDER BY aggr_args_list ')'
    7771             :  { 
    7772           0 :  $$ = cat_str(3,mm_strdup("( order by"),$4,mm_strdup(")"));
    7773             : }
    7774             : |  '(' aggr_args_list ORDER BY aggr_args_list ')'
    7775             :  { 
    7776           0 :  $$ = cat_str(5,mm_strdup("("),$2,mm_strdup("order by"),$5,mm_strdup(")"));
    7777             : }
    7778             : ;
    7779             : 
    7780             : 
    7781             :  aggr_args_list:
    7782             :  aggr_arg
    7783             :  { 
    7784           0 :  $$ = $1;
    7785             : }
    7786             : |  aggr_args_list ',' aggr_arg
    7787             :  { 
    7788           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    7789             : }
    7790             : ;
    7791             : 
    7792             : 
    7793             :  aggregate_with_argtypes:
    7794             :  func_name aggr_args
    7795             :  { 
    7796           0 :  $$ = cat_str(2,$1,$2);
    7797             : }
    7798             : ;
    7799             : 
    7800             : 
    7801             :  aggregate_with_argtypes_list:
    7802             :  aggregate_with_argtypes
    7803             :  { 
    7804           0 :  $$ = $1;
    7805             : }
    7806             : |  aggregate_with_argtypes_list ',' aggregate_with_argtypes
    7807             :  { 
    7808           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    7809             : }
    7810             : ;
    7811             : 
    7812             : 
    7813             :  opt_createfunc_opt_list:
    7814             :  createfunc_opt_list
    7815             :  { 
    7816           2 :  $$ = $1;
    7817             : }
    7818             : | 
    7819             :  { 
    7820           0 :  $$=EMPTY; }
    7821             : ;
    7822             : 
    7823             : 
    7824             :  createfunc_opt_list:
    7825             :  createfunc_opt_item
    7826             :  { 
    7827           2 :  $$ = $1;
    7828             : }
    7829             : |  createfunc_opt_list createfunc_opt_item
    7830             :  { 
    7831           2 :  $$ = cat_str(2,$1,$2);
    7832             : }
    7833             : ;
    7834             : 
    7835             : 
    7836             :  common_func_opt_item:
    7837             :  CALLED ON NULL_P INPUT_P
    7838             :  { 
    7839           0 :  $$ = mm_strdup("called on null input");
    7840             : }
    7841             : |  RETURNS NULL_P ON NULL_P INPUT_P
    7842             :  { 
    7843           0 :  $$ = mm_strdup("returns null on null input");
    7844             : }
    7845             : |  STRICT_P
    7846             :  { 
    7847           0 :  $$ = mm_strdup("strict");
    7848             : }
    7849             : |  IMMUTABLE
    7850             :  { 
    7851           0 :  $$ = mm_strdup("immutable");
    7852             : }
    7853             : |  STABLE
    7854             :  { 
    7855           0 :  $$ = mm_strdup("stable");
    7856             : }
    7857             : |  VOLATILE
    7858             :  { 
    7859           0 :  $$ = mm_strdup("volatile");
    7860             : }
    7861             : |  EXTERNAL SECURITY DEFINER
    7862             :  { 
    7863           0 :  $$ = mm_strdup("external security definer");
    7864             : }
    7865             : |  EXTERNAL SECURITY INVOKER
    7866             :  { 
    7867           0 :  $$ = mm_strdup("external security invoker");
    7868             : }
    7869             : |  SECURITY DEFINER
    7870             :  { 
    7871           0 :  $$ = mm_strdup("security definer");
    7872             : }
    7873             : |  SECURITY INVOKER
    7874             :  { 
    7875           0 :  $$ = mm_strdup("security invoker");
    7876             : }
    7877             : |  LEAKPROOF
    7878             :  { 
    7879           0 :  $$ = mm_strdup("leakproof");
    7880             : }
    7881             : |  NOT LEAKPROOF
    7882             :  { 
    7883           0 :  $$ = mm_strdup("not leakproof");
    7884             : }
    7885             : |  COST NumericOnly
    7886             :  { 
    7887           0 :  $$ = cat_str(2,mm_strdup("cost"),$2);
    7888             : }
    7889             : |  ROWS NumericOnly
    7890             :  { 
    7891           0 :  $$ = cat_str(2,mm_strdup("rows"),$2);
    7892             : }
    7893             : |  SUPPORT any_name
    7894             :  { 
    7895           0 :  $$ = cat_str(2,mm_strdup("support"),$2);
    7896             : }
    7897             : |  FunctionSetResetClause
    7898             :  { 
    7899           0 :  $$ = $1;
    7900             : }
    7901             : |  PARALLEL ColId
    7902             :  { 
    7903           0 :  $$ = cat_str(2,mm_strdup("parallel"),$2);
    7904             : }
    7905             : ;
    7906             : 
    7907             : 
    7908             :  createfunc_opt_item:
    7909             :  AS func_as
    7910             :  { 
    7911           2 :  $$ = cat_str(2,mm_strdup("as"),$2);
    7912             : }
    7913             : |  LANGUAGE NonReservedWord_or_Sconst
    7914             :  { 
    7915           2 :  $$ = cat_str(2,mm_strdup("language"),$2);
    7916             : }
    7917             : |  TRANSFORM transform_type_list
    7918             :  { 
    7919           0 :  $$ = cat_str(2,mm_strdup("transform"),$2);
    7920             : }
    7921             : |  WINDOW
    7922             :  { 
    7923           0 :  $$ = mm_strdup("window");
    7924             : }
    7925             : |  common_func_opt_item
    7926             :  { 
    7927           0 :  $$ = $1;
    7928             : }
    7929             : ;
    7930             : 
    7931             : 
    7932             :  func_as:
    7933             :  ecpg_sconst
    7934             :  { 
    7935           2 :  $$ = $1;
    7936             : }
    7937             : |  ecpg_sconst ',' ecpg_sconst
    7938             :  { 
    7939           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    7940             : }
    7941             : ;
    7942             : 
    7943             : 
    7944             :  ReturnStmt:
    7945             :  RETURN a_expr
    7946             :  { 
    7947           0 :  $$ = cat_str(2,mm_strdup("return"),$2);
    7948             : }
    7949             : ;
    7950             : 
    7951             : 
    7952             :  opt_routine_body:
    7953             :  ReturnStmt
    7954             :  { 
    7955           0 :  $$ = $1;
    7956             : }
    7957             : |  BEGIN_P ATOMIC routine_body_stmt_list END_P
    7958             :  { 
    7959           0 :  $$ = cat_str(3,mm_strdup("begin atomic"),$3,mm_strdup("end"));
    7960             : }
    7961             : | 
    7962             :  { 
    7963           2 :  $$=EMPTY; }
    7964             : ;
    7965             : 
    7966             : 
    7967             :  routine_body_stmt_list:
    7968             :  routine_body_stmt_list routine_body_stmt ';'
    7969             :  { 
    7970           0 :  $$ = cat_str(3,$1,$2,mm_strdup(";"));
    7971             : }
    7972             : | 
    7973             :  { 
    7974           0 :  $$=EMPTY; }
    7975             : ;
    7976             : 
    7977             : 
    7978             :  routine_body_stmt:
    7979             :  stmt
    7980             :  { 
    7981           0 :  $$ = $1;
    7982             : }
    7983             : |  ReturnStmt
    7984             :  { 
    7985           0 :  $$ = $1;
    7986             : }
    7987             : ;
    7988             : 
    7989             : 
    7990             :  transform_type_list:
    7991             :  FOR TYPE_P Typename
    7992             :  { 
    7993           0 :  $$ = cat_str(2,mm_strdup("for type"),$3);
    7994             : }
    7995             : |  transform_type_list ',' FOR TYPE_P Typename
    7996             :  { 
    7997           0 :  $$ = cat_str(3,$1,mm_strdup(", for type"),$5);
    7998             : }
    7999             : ;
    8000             : 
    8001             : 
    8002             :  opt_definition:
    8003             :  WITH definition
    8004             :  { 
    8005           0 :  $$ = cat_str(2,mm_strdup("with"),$2);
    8006             : }
    8007             : | 
    8008             :  { 
    8009          20 :  $$=EMPTY; }
    8010             : ;
    8011             : 
    8012             : 
    8013             :  table_func_column:
    8014             :  param_name func_type
    8015             :  { 
    8016           0 :  $$ = cat_str(2,$1,$2);
    8017             : }
    8018             : ;
    8019             : 
    8020             : 
    8021             :  table_func_column_list:
    8022             :  table_func_column
    8023             :  { 
    8024           0 :  $$ = $1;
    8025             : }
    8026             : |  table_func_column_list ',' table_func_column
    8027             :  { 
    8028           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    8029             : }
    8030             : ;
    8031             : 
    8032             : 
    8033             :  AlterFunctionStmt:
    8034             :  ALTER FUNCTION function_with_argtypes alterfunc_opt_list opt_restrict
    8035             :  { 
    8036           0 :  $$ = cat_str(4,mm_strdup("alter function"),$3,$4,$5);
    8037             : }
    8038             : |  ALTER PROCEDURE function_with_argtypes alterfunc_opt_list opt_restrict
    8039             :  { 
    8040           0 :  $$ = cat_str(4,mm_strdup("alter procedure"),$3,$4,$5);
    8041             : }
    8042             : |  ALTER ROUTINE function_with_argtypes alterfunc_opt_list opt_restrict
    8043             :  { 
    8044           0 :  $$ = cat_str(4,mm_strdup("alter routine"),$3,$4,$5);
    8045             : }
    8046             : ;
    8047             : 
    8048             : 
    8049             :  alterfunc_opt_list:
    8050             :  common_func_opt_item
    8051             :  { 
    8052           0 :  $$ = $1;
    8053             : }
    8054             : |  alterfunc_opt_list common_func_opt_item
    8055             :  { 
    8056           0 :  $$ = cat_str(2,$1,$2);
    8057             : }
    8058             : ;
    8059             : 
    8060             : 
    8061             :  opt_restrict:
    8062             :  RESTRICT
    8063             :  { 
    8064           0 :  $$ = mm_strdup("restrict");
    8065             : }
    8066             : | 
    8067             :  { 
    8068           0 :  $$=EMPTY; }
    8069             : ;
    8070             : 
    8071             : 
    8072             :  RemoveFuncStmt:
    8073             :  DROP FUNCTION function_with_argtypes_list opt_drop_behavior
    8074             :  { 
    8075           2 :  $$ = cat_str(3,mm_strdup("drop function"),$3,$4);
    8076             : }
    8077             : |  DROP FUNCTION IF_P EXISTS function_with_argtypes_list opt_drop_behavior
    8078             :  { 
    8079           0 :  $$ = cat_str(3,mm_strdup("drop function if exists"),$5,$6);
    8080             : }
    8081             : |  DROP PROCEDURE function_with_argtypes_list opt_drop_behavior
    8082             :  { 
    8083           0 :  $$ = cat_str(3,mm_strdup("drop procedure"),$3,$4);
    8084             : }
    8085             : |  DROP PROCEDURE IF_P EXISTS function_with_argtypes_list opt_drop_behavior
    8086             :  { 
    8087           0 :  $$ = cat_str(3,mm_strdup("drop procedure if exists"),$5,$6);
    8088             : }
    8089             : |  DROP ROUTINE function_with_argtypes_list opt_drop_behavior
    8090             :  { 
    8091           0 :  $$ = cat_str(3,mm_strdup("drop routine"),$3,$4);
    8092             : }
    8093             : |  DROP ROUTINE IF_P EXISTS function_with_argtypes_list opt_drop_behavior
    8094             :  { 
    8095           0 :  $$ = cat_str(3,mm_strdup("drop routine if exists"),$5,$6);
    8096             : }
    8097             : ;
    8098             : 
    8099             : 
    8100             :  RemoveAggrStmt:
    8101             :  DROP AGGREGATE aggregate_with_argtypes_list opt_drop_behavior
    8102             :  { 
    8103           0 :  $$ = cat_str(3,mm_strdup("drop aggregate"),$3,$4);
    8104             : }
    8105             : |  DROP AGGREGATE IF_P EXISTS aggregate_with_argtypes_list opt_drop_behavior
    8106             :  { 
    8107           0 :  $$ = cat_str(3,mm_strdup("drop aggregate if exists"),$5,$6);
    8108             : }
    8109             : ;
    8110             : 
    8111             : 
    8112             :  RemoveOperStmt:
    8113             :  DROP OPERATOR operator_with_argtypes_list opt_drop_behavior
    8114             :  { 
    8115           0 :  $$ = cat_str(3,mm_strdup("drop operator"),$3,$4);
    8116             : }
    8117             : |  DROP OPERATOR IF_P EXISTS operator_with_argtypes_list opt_drop_behavior
    8118             :  { 
    8119           0 :  $$ = cat_str(3,mm_strdup("drop operator if exists"),$5,$6);
    8120             : }
    8121             : ;
    8122             : 
    8123             : 
    8124             :  oper_argtypes:
    8125             :  '(' Typename ')'
    8126             :  { 
    8127           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
    8128             : }
    8129             : |  '(' Typename ',' Typename ')'
    8130             :  { 
    8131           0 :  $$ = cat_str(5,mm_strdup("("),$2,mm_strdup(","),$4,mm_strdup(")"));
    8132             : }
    8133             : |  '(' NONE ',' Typename ')'
    8134             :  { 
    8135           0 :  $$ = cat_str(3,mm_strdup("( none ,"),$4,mm_strdup(")"));
    8136             : }
    8137             : |  '(' Typename ',' NONE ')'
    8138             :  { 
    8139           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(", none )"));
    8140             : }
    8141             : ;
    8142             : 
    8143             : 
    8144             :  any_operator:
    8145             :  all_Op
    8146             :  { 
    8147           0 :  $$ = $1;
    8148             : }
    8149             : |  ColId '.' any_operator
    8150             :  { 
    8151           0 :  $$ = cat_str(3,$1,mm_strdup("."),$3);
    8152             : }
    8153             : ;
    8154             : 
    8155             : 
    8156             :  operator_with_argtypes_list:
    8157             :  operator_with_argtypes
    8158             :  { 
    8159           0 :  $$ = $1;
    8160             : }
    8161             : |  operator_with_argtypes_list ',' operator_with_argtypes
    8162             :  { 
    8163           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    8164             : }
    8165             : ;
    8166             : 
    8167             : 
    8168             :  operator_with_argtypes:
    8169             :  any_operator oper_argtypes
    8170             :  { 
    8171           0 :  $$ = cat_str(2,$1,$2);
    8172             : }
    8173             : ;
    8174             : 
    8175             : 
    8176             :  DoStmt:
    8177             :  DO dostmt_opt_list
    8178             :  { 
    8179           0 :  $$ = cat_str(2,mm_strdup("do"),$2);
    8180             : }
    8181             : ;
    8182             : 
    8183             : 
    8184             :  dostmt_opt_list:
    8185             :  dostmt_opt_item
    8186             :  { 
    8187           0 :  $$ = $1;
    8188             : }
    8189             : |  dostmt_opt_list dostmt_opt_item
    8190             :  { 
    8191           0 :  $$ = cat_str(2,$1,$2);
    8192             : }
    8193             : ;
    8194             : 
    8195             : 
    8196             :  dostmt_opt_item:
    8197             :  ecpg_sconst
    8198             :  { 
    8199           0 :  $$ = $1;
    8200             : }
    8201             : |  LANGUAGE NonReservedWord_or_Sconst
    8202             :  { 
    8203           0 :  $$ = cat_str(2,mm_strdup("language"),$2);
    8204             : }
    8205             : ;
    8206             : 
    8207             : 
    8208             :  CreateCastStmt:
    8209             :  CREATE CAST '(' Typename AS Typename ')' WITH FUNCTION function_with_argtypes cast_context
    8210             :  { 
    8211           0 :  $$ = cat_str(7,mm_strdup("create cast ("),$4,mm_strdup("as"),$6,mm_strdup(") with function"),$10,$11);
    8212             : }
    8213             : |  CREATE CAST '(' Typename AS Typename ')' WITHOUT FUNCTION cast_context
    8214             :  { 
    8215           0 :  $$ = cat_str(6,mm_strdup("create cast ("),$4,mm_strdup("as"),$6,mm_strdup(") without function"),$10);
    8216             : }
    8217             : |  CREATE CAST '(' Typename AS Typename ')' WITH INOUT cast_context
    8218             :  { 
    8219           0 :  $$ = cat_str(6,mm_strdup("create cast ("),$4,mm_strdup("as"),$6,mm_strdup(") with inout"),$10);
    8220             : }
    8221             : ;
    8222             : 
    8223             : 
    8224             :  cast_context:
    8225             :  AS IMPLICIT_P
    8226             :  { 
    8227           0 :  $$ = mm_strdup("as implicit");
    8228             : }
    8229             : |  AS ASSIGNMENT
    8230             :  { 
    8231           0 :  $$ = mm_strdup("as assignment");
    8232             : }
    8233             : | 
    8234             :  { 
    8235           0 :  $$=EMPTY; }
    8236             : ;
    8237             : 
    8238             : 
    8239             :  DropCastStmt:
    8240             :  DROP CAST opt_if_exists '(' Typename AS Typename ')' opt_drop_behavior
    8241             :  { 
    8242           0 :  $$ = cat_str(8,mm_strdup("drop cast"),$3,mm_strdup("("),$5,mm_strdup("as"),$7,mm_strdup(")"),$9);
    8243             : }
    8244             : ;
    8245             : 
    8246             : 
    8247             :  opt_if_exists:
    8248             :  IF_P EXISTS
    8249             :  { 
    8250           0 :  $$ = mm_strdup("if exists");
    8251             : }
    8252             : | 
    8253             :  { 
    8254           0 :  $$=EMPTY; }
    8255             : ;
    8256             : 
    8257             : 
    8258             :  CreateTransformStmt:
    8259             :  CREATE opt_or_replace TRANSFORM FOR Typename LANGUAGE name '(' transform_element_list ')'
    8260             :  { 
    8261           0 :  $$ = cat_str(9,mm_strdup("create"),$2,mm_strdup("transform for"),$5,mm_strdup("language"),$7,mm_strdup("("),$9,mm_strdup(")"));
    8262             : }
    8263             : ;
    8264             : 
    8265             : 
    8266             :  transform_element_list:
    8267             :  FROM SQL_P WITH FUNCTION function_with_argtypes ',' TO SQL_P WITH FUNCTION function_with_argtypes
    8268             :  { 
    8269           0 :  $$ = cat_str(4,mm_strdup("from sql with function"),$5,mm_strdup(", to sql with function"),$11);
    8270             : }
    8271             : |  TO SQL_P WITH FUNCTION function_with_argtypes ',' FROM SQL_P WITH FUNCTION function_with_argtypes
    8272             :  { 
    8273           0 :  $$ = cat_str(4,mm_strdup("to sql with function"),$5,mm_strdup(", from sql with function"),$11);
    8274             : }
    8275             : |  FROM SQL_P WITH FUNCTION function_with_argtypes
    8276             :  { 
    8277           0 :  $$ = cat_str(2,mm_strdup("from sql with function"),$5);
    8278             : }
    8279             : |  TO SQL_P WITH FUNCTION function_with_argtypes
    8280             :  { 
    8281           0 :  $$ = cat_str(2,mm_strdup("to sql with function"),$5);
    8282             : }
    8283             : ;
    8284             : 
    8285             : 
    8286             :  DropTransformStmt:
    8287             :  DROP TRANSFORM opt_if_exists FOR Typename LANGUAGE name opt_drop_behavior
    8288             :  { 
    8289           0 :  $$ = cat_str(7,mm_strdup("drop transform"),$3,mm_strdup("for"),$5,mm_strdup("language"),$7,$8);
    8290             : }
    8291             : ;
    8292             : 
    8293             : 
    8294             :  ReindexStmt:
    8295             :  REINDEX opt_reindex_option_list reindex_target_relation opt_concurrently qualified_name
    8296             :  { 
    8297           0 :  $$ = cat_str(5,mm_strdup("reindex"),$2,$3,$4,$5);
    8298             : }
    8299             : |  REINDEX opt_reindex_option_list SCHEMA opt_concurrently name
    8300             :  { 
    8301           0 :  $$ = cat_str(5,mm_strdup("reindex"),$2,mm_strdup("schema"),$4,$5);
    8302             : }
    8303             : |  REINDEX opt_reindex_option_list reindex_target_all opt_concurrently opt_single_name
    8304             :  { 
    8305           0 :  $$ = cat_str(5,mm_strdup("reindex"),$2,$3,$4,$5);
    8306             : }
    8307             : ;
    8308             : 
    8309             : 
    8310             :  reindex_target_relation:
    8311             :  INDEX
    8312             :  { 
    8313           0 :  $$ = mm_strdup("index");
    8314             : }
    8315             : |  TABLE
    8316             :  { 
    8317           0 :  $$ = mm_strdup("table");
    8318             : }
    8319             : ;
    8320             : 
    8321             : 
    8322             :  reindex_target_all:
    8323             :  SYSTEM_P
    8324             :  { 
    8325           0 :  $$ = mm_strdup("system");
    8326             : }
    8327             : |  DATABASE
    8328             :  { 
    8329           0 :  $$ = mm_strdup("database");
    8330             : }
    8331             : ;
    8332             : 
    8333             : 
    8334             :  opt_reindex_option_list:
    8335             :  '(' utility_option_list ')'
    8336             :  { 
    8337           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
    8338             : }
    8339             : | 
    8340             :  { 
    8341           0 :  $$=EMPTY; }
    8342             : ;
    8343             : 
    8344             : 
    8345             :  AlterTblSpcStmt:
    8346             :  ALTER TABLESPACE name SET reloptions
    8347             :  { 
    8348           0 :  $$ = cat_str(4,mm_strdup("alter tablespace"),$3,mm_strdup("set"),$5);
    8349             : }
    8350             : |  ALTER TABLESPACE name RESET reloptions
    8351             :  { 
    8352           0 :  $$ = cat_str(4,mm_strdup("alter tablespace"),$3,mm_strdup("reset"),$5);
    8353             : }
    8354             : ;
    8355             : 
    8356             : 
    8357             :  RenameStmt:
    8358             :  ALTER AGGREGATE aggregate_with_argtypes RENAME TO name
    8359             :  { 
    8360           0 :  $$ = cat_str(4,mm_strdup("alter aggregate"),$3,mm_strdup("rename to"),$6);
    8361             : }
    8362             : |  ALTER COLLATION any_name RENAME TO name
    8363             :  { 
    8364           0 :  $$ = cat_str(4,mm_strdup("alter collation"),$3,mm_strdup("rename to"),$6);
    8365             : }
    8366             : |  ALTER CONVERSION_P any_name RENAME TO name
    8367             :  { 
    8368           0 :  $$ = cat_str(4,mm_strdup("alter conversion"),$3,mm_strdup("rename to"),$6);
    8369             : }
    8370             : |  ALTER DATABASE name RENAME TO name
    8371             :  { 
    8372           0 :  $$ = cat_str(4,mm_strdup("alter database"),$3,mm_strdup("rename to"),$6);
    8373             : }
    8374             : |  ALTER DOMAIN_P any_name RENAME TO name
    8375             :  { 
    8376           0 :  $$ = cat_str(4,mm_strdup("alter domain"),$3,mm_strdup("rename to"),$6);
    8377             : }
    8378             : |  ALTER DOMAIN_P any_name RENAME CONSTRAINT name TO name
    8379             :  { 
    8380           0 :  $$ = cat_str(6,mm_strdup("alter domain"),$3,mm_strdup("rename constraint"),$6,mm_strdup("to"),$8);
    8381             : }
    8382             : |  ALTER FOREIGN DATA_P WRAPPER name RENAME TO name
    8383             :  { 
    8384           0 :  $$ = cat_str(4,mm_strdup("alter foreign data wrapper"),$5,mm_strdup("rename to"),$8);
    8385             : }
    8386             : |  ALTER FUNCTION function_with_argtypes RENAME TO name
    8387             :  { 
    8388           0 :  $$ = cat_str(4,mm_strdup("alter function"),$3,mm_strdup("rename to"),$6);
    8389             : }
    8390             : |  ALTER GROUP_P RoleId RENAME TO RoleId
    8391             :  { 
    8392           0 :  $$ = cat_str(4,mm_strdup("alter group"),$3,mm_strdup("rename to"),$6);
    8393             : }
    8394             : |  ALTER opt_procedural LANGUAGE name RENAME TO name
    8395             :  { 
    8396           0 :  $$ = cat_str(6,mm_strdup("alter"),$2,mm_strdup("language"),$4,mm_strdup("rename to"),$7);
    8397             : }
    8398             : |  ALTER OPERATOR CLASS any_name USING name RENAME TO name
    8399             :  { 
    8400           0 :  $$ = cat_str(6,mm_strdup("alter operator class"),$4,mm_strdup("using"),$6,mm_strdup("rename to"),$9);
    8401             : }
    8402             : |  ALTER OPERATOR FAMILY any_name USING name RENAME TO name
    8403             :  { 
    8404           0 :  $$ = cat_str(6,mm_strdup("alter operator family"),$4,mm_strdup("using"),$6,mm_strdup("rename to"),$9);
    8405             : }
    8406             : |  ALTER POLICY name ON qualified_name RENAME TO name
    8407             :  { 
    8408           0 :  $$ = cat_str(6,mm_strdup("alter policy"),$3,mm_strdup("on"),$5,mm_strdup("rename to"),$8);
    8409             : }
    8410             : |  ALTER POLICY IF_P EXISTS name ON qualified_name RENAME TO name
    8411             :  { 
    8412           0 :  $$ = cat_str(6,mm_strdup("alter policy if exists"),$5,mm_strdup("on"),$7,mm_strdup("rename to"),$10);
    8413             : }
    8414             : |  ALTER PROCEDURE function_with_argtypes RENAME TO name
    8415             :  { 
    8416           0 :  $$ = cat_str(4,mm_strdup("alter procedure"),$3,mm_strdup("rename to"),$6);
    8417             : }
    8418             : |  ALTER PUBLICATION name RENAME TO name
    8419             :  { 
    8420           0 :  $$ = cat_str(4,mm_strdup("alter publication"),$3,mm_strdup("rename to"),$6);
    8421             : }
    8422             : |  ALTER ROUTINE function_with_argtypes RENAME TO name
    8423             :  { 
    8424           0 :  $$ = cat_str(4,mm_strdup("alter routine"),$3,mm_strdup("rename to"),$6);
    8425             : }
    8426             : |  ALTER SCHEMA name RENAME TO name
    8427             :  { 
    8428           0 :  $$ = cat_str(4,mm_strdup("alter schema"),$3,mm_strdup("rename to"),$6);
    8429             : }
    8430             : |  ALTER SERVER name RENAME TO name
    8431             :  { 
    8432           0 :  $$ = cat_str(4,mm_strdup("alter server"),$3,mm_strdup("rename to"),$6);
    8433             : }
    8434             : |  ALTER SUBSCRIPTION name RENAME TO name
    8435             :  { 
    8436           0 :  $$ = cat_str(4,mm_strdup("alter subscription"),$3,mm_strdup("rename to"),$6);
    8437             : }
    8438             : |  ALTER TABLE relation_expr RENAME TO name
    8439             :  { 
    8440           0 :  $$ = cat_str(4,mm_strdup("alter table"),$3,mm_strdup("rename to"),$6);
    8441             : }
    8442             : |  ALTER TABLE IF_P EXISTS relation_expr RENAME TO name
    8443             :  { 
    8444           0 :  $$ = cat_str(4,mm_strdup("alter table if exists"),$5,mm_strdup("rename to"),$8);
    8445             : }
    8446             : |  ALTER SEQUENCE qualified_name RENAME TO name
    8447             :  { 
    8448           0 :  $$ = cat_str(4,mm_strdup("alter sequence"),$3,mm_strdup("rename to"),$6);
    8449             : }
    8450             : |  ALTER SEQUENCE IF_P EXISTS qualified_name RENAME TO name
    8451             :  { 
    8452           0 :  $$ = cat_str(4,mm_strdup("alter sequence if exists"),$5,mm_strdup("rename to"),$8);
    8453             : }
    8454             : |  ALTER VIEW qualified_name RENAME TO name
    8455             :  { 
    8456           0 :  $$ = cat_str(4,mm_strdup("alter view"),$3,mm_strdup("rename to"),$6);
    8457             : }
    8458             : |  ALTER VIEW IF_P EXISTS qualified_name RENAME TO name
    8459             :  { 
    8460           0 :  $$ = cat_str(4,mm_strdup("alter view if exists"),$5,mm_strdup("rename to"),$8);
    8461             : }
    8462             : |  ALTER MATERIALIZED VIEW qualified_name RENAME TO name
    8463             :  { 
    8464           0 :  $$ = cat_str(4,mm_strdup("alter materialized view"),$4,mm_strdup("rename to"),$7);
    8465             : }
    8466             : |  ALTER MATERIALIZED VIEW IF_P EXISTS qualified_name RENAME TO name
    8467             :  { 
    8468           0 :  $$ = cat_str(4,mm_strdup("alter materialized view if exists"),$6,mm_strdup("rename to"),$9);
    8469             : }
    8470             : |  ALTER INDEX qualified_name RENAME TO name
    8471             :  { 
    8472           0 :  $$ = cat_str(4,mm_strdup("alter index"),$3,mm_strdup("rename to"),$6);
    8473             : }
    8474             : |  ALTER INDEX IF_P EXISTS qualified_name RENAME TO name
    8475             :  { 
    8476           0 :  $$ = cat_str(4,mm_strdup("alter index if exists"),$5,mm_strdup("rename to"),$8);
    8477             : }
    8478             : |  ALTER FOREIGN TABLE relation_expr RENAME TO name
    8479             :  { 
    8480           0 :  $$ = cat_str(4,mm_strdup("alter foreign table"),$4,mm_strdup("rename to"),$7);
    8481             : }
    8482             : |  ALTER FOREIGN TABLE IF_P EXISTS relation_expr RENAME TO name
    8483             :  { 
    8484           0 :  $$ = cat_str(4,mm_strdup("alter foreign table if exists"),$6,mm_strdup("rename to"),$9);
    8485             : }
    8486             : |  ALTER TABLE relation_expr RENAME opt_column name TO name
    8487             :  { 
    8488           0 :  $$ = cat_str(7,mm_strdup("alter table"),$3,mm_strdup("rename"),$5,$6,mm_strdup("to"),$8);
    8489             : }
    8490             : |  ALTER TABLE IF_P EXISTS relation_expr RENAME opt_column name TO name
    8491             :  { 
    8492           0 :  $$ = cat_str(7,mm_strdup("alter table if exists"),$5,mm_strdup("rename"),$7,$8,mm_strdup("to"),$10);
    8493             : }
    8494             : |  ALTER VIEW qualified_name RENAME opt_column name TO name
    8495             :  { 
    8496           0 :  $$ = cat_str(7,mm_strdup("alter view"),$3,mm_strdup("rename"),$5,$6,mm_strdup("to"),$8);
    8497             : }
    8498             : |  ALTER VIEW IF_P EXISTS qualified_name RENAME opt_column name TO name
    8499             :  { 
    8500           0 :  $$ = cat_str(7,mm_strdup("alter view if exists"),$5,mm_strdup("rename"),$7,$8,mm_strdup("to"),$10);
    8501             : }
    8502             : |  ALTER MATERIALIZED VIEW qualified_name RENAME opt_column name TO name
    8503             :  { 
    8504           0 :  $$ = cat_str(7,mm_strdup("alter materialized view"),$4,mm_strdup("rename"),$6,$7,mm_strdup("to"),$9);
    8505             : }
    8506             : |  ALTER MATERIALIZED VIEW IF_P EXISTS qualified_name RENAME opt_column name TO name
    8507             :  { 
    8508           0 :  $$ = cat_str(7,mm_strdup("alter materialized view if exists"),$6,mm_strdup("rename"),$8,$9,mm_strdup("to"),$11);
    8509             : }
    8510             : |  ALTER TABLE relation_expr RENAME CONSTRAINT name TO name
    8511             :  { 
    8512           0 :  $$ = cat_str(6,mm_strdup("alter table"),$3,mm_strdup("rename constraint"),$6,mm_strdup("to"),$8);
    8513             : }
    8514             : |  ALTER TABLE IF_P EXISTS relation_expr RENAME CONSTRAINT name TO name
    8515             :  { 
    8516           0 :  $$ = cat_str(6,mm_strdup("alter table if exists"),$5,mm_strdup("rename constraint"),$8,mm_strdup("to"),$10);
    8517             : }
    8518             : |  ALTER FOREIGN TABLE relation_expr RENAME opt_column name TO name
    8519             :  { 
    8520           0 :  $$ = cat_str(7,mm_strdup("alter foreign table"),$4,mm_strdup("rename"),$6,$7,mm_strdup("to"),$9);
    8521             : }
    8522             : |  ALTER FOREIGN TABLE IF_P EXISTS relation_expr RENAME opt_column name TO name
    8523             :  { 
    8524           0 :  $$ = cat_str(7,mm_strdup("alter foreign table if exists"),$6,mm_strdup("rename"),$8,$9,mm_strdup("to"),$11);
    8525             : }
    8526             : |  ALTER RULE name ON qualified_name RENAME TO name
    8527             :  { 
    8528           0 :  $$ = cat_str(6,mm_strdup("alter rule"),$3,mm_strdup("on"),$5,mm_strdup("rename to"),$8);
    8529             : }
    8530             : |  ALTER TRIGGER name ON qualified_name RENAME TO name
    8531             :  { 
    8532           0 :  $$ = cat_str(6,mm_strdup("alter trigger"),$3,mm_strdup("on"),$5,mm_strdup("rename to"),$8);
    8533             : }
    8534             : |  ALTER EVENT TRIGGER name RENAME TO name
    8535             :  { 
    8536           0 :  $$ = cat_str(4,mm_strdup("alter event trigger"),$4,mm_strdup("rename to"),$7);
    8537             : }
    8538             : |  ALTER ROLE RoleId RENAME TO RoleId
    8539             :  { 
    8540           0 :  $$ = cat_str(4,mm_strdup("alter role"),$3,mm_strdup("rename to"),$6);
    8541             : }
    8542             : |  ALTER USER RoleId RENAME TO RoleId
    8543             :  { 
    8544           0 :  $$ = cat_str(4,mm_strdup("alter user"),$3,mm_strdup("rename to"),$6);
    8545             : }
    8546             : |  ALTER TABLESPACE name RENAME TO name
    8547             :  { 
    8548           0 :  $$ = cat_str(4,mm_strdup("alter tablespace"),$3,mm_strdup("rename to"),$6);
    8549             : }
    8550             : |  ALTER STATISTICS any_name RENAME TO name
    8551             :  { 
    8552           0 :  $$ = cat_str(4,mm_strdup("alter statistics"),$3,mm_strdup("rename to"),$6);
    8553             : }
    8554             : |  ALTER TEXT_P SEARCH PARSER any_name RENAME TO name
    8555             :  { 
    8556           0 :  $$ = cat_str(4,mm_strdup("alter text search parser"),$5,mm_strdup("rename to"),$8);
    8557             : }
    8558             : |  ALTER TEXT_P SEARCH DICTIONARY any_name RENAME TO name
    8559             :  { 
    8560           0 :  $$ = cat_str(4,mm_strdup("alter text search dictionary"),$5,mm_strdup("rename to"),$8);
    8561             : }
    8562             : |  ALTER TEXT_P SEARCH TEMPLATE any_name RENAME TO name
    8563             :  { 
    8564           0 :  $$ = cat_str(4,mm_strdup("alter text search template"),$5,mm_strdup("rename to"),$8);
    8565             : }
    8566             : |  ALTER TEXT_P SEARCH CONFIGURATION any_name RENAME TO name
    8567             :  { 
    8568           0 :  $$ = cat_str(4,mm_strdup("alter text search configuration"),$5,mm_strdup("rename to"),$8);
    8569             : }
    8570             : |  ALTER TYPE_P any_name RENAME TO name
    8571             :  { 
    8572           0 :  $$ = cat_str(4,mm_strdup("alter type"),$3,mm_strdup("rename to"),$6);
    8573             : }
    8574             : |  ALTER TYPE_P any_name RENAME ATTRIBUTE name TO name opt_drop_behavior
    8575             :  { 
    8576           0 :  $$ = cat_str(7,mm_strdup("alter type"),$3,mm_strdup("rename attribute"),$6,mm_strdup("to"),$8,$9);
    8577             : }
    8578             : ;
    8579             : 
    8580             : 
    8581             :  opt_column:
    8582             :  COLUMN
    8583             :  { 
    8584           2 :  $$ = mm_strdup("column");
    8585             : }
    8586             : | 
    8587             :  { 
    8588           2 :  $$=EMPTY; }
    8589             : ;
    8590             : 
    8591             : 
    8592             :  opt_set_data:
    8593             :  SET DATA_P
    8594             :  { 
    8595           2 :  $$ = mm_strdup("set data");
    8596             : }
    8597             : | 
    8598             :  { 
    8599           2 :  $$=EMPTY; }
    8600             : ;
    8601             : 
    8602             : 
    8603             :  AlterObjectDependsStmt:
    8604             :  ALTER FUNCTION function_with_argtypes opt_no DEPENDS ON EXTENSION name
    8605             :  { 
    8606           0 :  $$ = cat_str(5,mm_strdup("alter function"),$3,$4,mm_strdup("depends on extension"),$8);
    8607             : }
    8608             : |  ALTER PROCEDURE function_with_argtypes opt_no DEPENDS ON EXTENSION name
    8609             :  { 
    8610           0 :  $$ = cat_str(5,mm_strdup("alter procedure"),$3,$4,mm_strdup("depends on extension"),$8);
    8611             : }
    8612             : |  ALTER ROUTINE function_with_argtypes opt_no DEPENDS ON EXTENSION name
    8613             :  { 
    8614           0 :  $$ = cat_str(5,mm_strdup("alter routine"),$3,$4,mm_strdup("depends on extension"),$8);
    8615             : }
    8616             : |  ALTER TRIGGER name ON qualified_name opt_no DEPENDS ON EXTENSION name
    8617             :  { 
    8618           0 :  $$ = cat_str(7,mm_strdup("alter trigger"),$3,mm_strdup("on"),$5,$6,mm_strdup("depends on extension"),$10);
    8619             : }
    8620             : |  ALTER MATERIALIZED VIEW qualified_name opt_no DEPENDS ON EXTENSION name
    8621             :  { 
    8622           0 :  $$ = cat_str(5,mm_strdup("alter materialized view"),$4,$5,mm_strdup("depends on extension"),$9);
    8623             : }
    8624             : |  ALTER INDEX qualified_name opt_no DEPENDS ON EXTENSION name
    8625             :  { 
    8626           0 :  $$ = cat_str(5,mm_strdup("alter index"),$3,$4,mm_strdup("depends on extension"),$8);
    8627             : }
    8628             : ;
    8629             : 
    8630             : 
    8631             :  opt_no:
    8632             :  NO
    8633             :  { 
    8634           0 :  $$ = mm_strdup("no");
    8635             : }
    8636             : | 
    8637             :  { 
    8638           0 :  $$=EMPTY; }
    8639             : ;
    8640             : 
    8641             : 
    8642             :  AlterObjectSchemaStmt:
    8643             :  ALTER AGGREGATE aggregate_with_argtypes SET SCHEMA name
    8644             :  { 
    8645           0 :  $$ = cat_str(4,mm_strdup("alter aggregate"),$3,mm_strdup("set schema"),$6);
    8646             : }
    8647             : |  ALTER COLLATION any_name SET SCHEMA name
    8648             :  { 
    8649           0 :  $$ = cat_str(4,mm_strdup("alter collation"),$3,mm_strdup("set schema"),$6);
    8650             : }
    8651             : |  ALTER CONVERSION_P any_name SET SCHEMA name
    8652             :  { 
    8653           0 :  $$ = cat_str(4,mm_strdup("alter conversion"),$3,mm_strdup("set schema"),$6);
    8654             : }
    8655             : |  ALTER DOMAIN_P any_name SET SCHEMA name
    8656             :  { 
    8657           0 :  $$ = cat_str(4,mm_strdup("alter domain"),$3,mm_strdup("set schema"),$6);
    8658             : }
    8659             : |  ALTER EXTENSION name SET SCHEMA name
    8660             :  { 
    8661           0 :  $$ = cat_str(4,mm_strdup("alter extension"),$3,mm_strdup("set schema"),$6);
    8662             : }
    8663             : |  ALTER FUNCTION function_with_argtypes SET SCHEMA name
    8664             :  { 
    8665           0 :  $$ = cat_str(4,mm_strdup("alter function"),$3,mm_strdup("set schema"),$6);
    8666             : }
    8667             : |  ALTER OPERATOR operator_with_argtypes SET SCHEMA name
    8668             :  { 
    8669           0 :  $$ = cat_str(4,mm_strdup("alter operator"),$3,mm_strdup("set schema"),$6);
    8670             : }
    8671             : |  ALTER OPERATOR CLASS any_name USING name SET SCHEMA name
    8672             :  { 
    8673           0 :  $$ = cat_str(6,mm_strdup("alter operator class"),$4,mm_strdup("using"),$6,mm_strdup("set schema"),$9);
    8674             : }
    8675             : |  ALTER OPERATOR FAMILY any_name USING name SET SCHEMA name
    8676             :  { 
    8677           0 :  $$ = cat_str(6,mm_strdup("alter operator family"),$4,mm_strdup("using"),$6,mm_strdup("set schema"),$9);
    8678             : }
    8679             : |  ALTER PROCEDURE function_with_argtypes SET SCHEMA name
    8680             :  { 
    8681           0 :  $$ = cat_str(4,mm_strdup("alter procedure"),$3,mm_strdup("set schema"),$6);
    8682             : }
    8683             : |  ALTER ROUTINE function_with_argtypes SET SCHEMA name
    8684             :  { 
    8685           0 :  $$ = cat_str(4,mm_strdup("alter routine"),$3,mm_strdup("set schema"),$6);
    8686             : }
    8687             : |  ALTER TABLE relation_expr SET SCHEMA name
    8688             :  { 
    8689           0 :  $$ = cat_str(4,mm_strdup("alter table"),$3,mm_strdup("set schema"),$6);
    8690             : }
    8691             : |  ALTER TABLE IF_P EXISTS relation_expr SET SCHEMA name
    8692             :  { 
    8693           0 :  $$ = cat_str(4,mm_strdup("alter table if exists"),$5,mm_strdup("set schema"),$8);
    8694             : }
    8695             : |  ALTER STATISTICS any_name SET SCHEMA name
    8696             :  { 
    8697           0 :  $$ = cat_str(4,mm_strdup("alter statistics"),$3,mm_strdup("set schema"),$6);
    8698             : }
    8699             : |  ALTER TEXT_P SEARCH PARSER any_name SET SCHEMA name
    8700             :  { 
    8701           0 :  $$ = cat_str(4,mm_strdup("alter text search parser"),$5,mm_strdup("set schema"),$8);
    8702             : }
    8703             : |  ALTER TEXT_P SEARCH DICTIONARY any_name SET SCHEMA name
    8704             :  { 
    8705           0 :  $$ = cat_str(4,mm_strdup("alter text search dictionary"),$5,mm_strdup("set schema"),$8);
    8706             : }
    8707             : |  ALTER TEXT_P SEARCH TEMPLATE any_name SET SCHEMA name
    8708             :  { 
    8709           0 :  $$ = cat_str(4,mm_strdup("alter text search template"),$5,mm_strdup("set schema"),$8);
    8710             : }
    8711             : |  ALTER TEXT_P SEARCH CONFIGURATION any_name SET SCHEMA name
    8712             :  { 
    8713           0 :  $$ = cat_str(4,mm_strdup("alter text search configuration"),$5,mm_strdup("set schema"),$8);
    8714             : }
    8715             : |  ALTER SEQUENCE qualified_name SET SCHEMA name
    8716             :  { 
    8717           0 :  $$ = cat_str(4,mm_strdup("alter sequence"),$3,mm_strdup("set schema"),$6);
    8718             : }
    8719             : |  ALTER SEQUENCE IF_P EXISTS qualified_name SET SCHEMA name
    8720             :  { 
    8721           0 :  $$ = cat_str(4,mm_strdup("alter sequence if exists"),$5,mm_strdup("set schema"),$8);
    8722             : }
    8723             : |  ALTER VIEW qualified_name SET SCHEMA name
    8724             :  { 
    8725           0 :  $$ = cat_str(4,mm_strdup("alter view"),$3,mm_strdup("set schema"),$6);
    8726             : }
    8727             : |  ALTER VIEW IF_P EXISTS qualified_name SET SCHEMA name
    8728             :  { 
    8729           0 :  $$ = cat_str(4,mm_strdup("alter view if exists"),$5,mm_strdup("set schema"),$8);
    8730             : }
    8731             : |  ALTER MATERIALIZED VIEW qualified_name SET SCHEMA name
    8732             :  { 
    8733           0 :  $$ = cat_str(4,mm_strdup("alter materialized view"),$4,mm_strdup("set schema"),$7);
    8734             : }
    8735             : |  ALTER MATERIALIZED VIEW IF_P EXISTS qualified_name SET SCHEMA name
    8736             :  { 
    8737           0 :  $$ = cat_str(4,mm_strdup("alter materialized view if exists"),$6,mm_strdup("set schema"),$9);
    8738             : }
    8739             : |  ALTER FOREIGN TABLE relation_expr SET SCHEMA name
    8740             :  { 
    8741           0 :  $$ = cat_str(4,mm_strdup("alter foreign table"),$4,mm_strdup("set schema"),$7);
    8742             : }
    8743             : |  ALTER FOREIGN TABLE IF_P EXISTS relation_expr SET SCHEMA name
    8744             :  { 
    8745           0 :  $$ = cat_str(4,mm_strdup("alter foreign table if exists"),$6,mm_strdup("set schema"),$9);
    8746             : }
    8747             : |  ALTER TYPE_P any_name SET SCHEMA name
    8748             :  { 
    8749           0 :  $$ = cat_str(4,mm_strdup("alter type"),$3,mm_strdup("set schema"),$6);
    8750             : }
    8751             : ;
    8752             : 
    8753             : 
    8754             :  AlterOperatorStmt:
    8755             :  ALTER OPERATOR operator_with_argtypes SET '(' operator_def_list ')'
    8756             :  { 
    8757           0 :  $$ = cat_str(5,mm_strdup("alter operator"),$3,mm_strdup("set ("),$6,mm_strdup(")"));
    8758             : }
    8759             : ;
    8760             : 
    8761             : 
    8762             :  operator_def_list:
    8763             :  operator_def_elem
    8764             :  { 
    8765           0 :  $$ = $1;
    8766             : }
    8767             : |  operator_def_list ',' operator_def_elem
    8768             :  { 
    8769           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    8770             : }
    8771             : ;
    8772             : 
    8773             : 
    8774             :  operator_def_elem:
    8775             :  ColLabel '=' NONE
    8776             :  { 
    8777           0 :  $$ = cat_str(2,$1,mm_strdup("= none"));
    8778             : }
    8779             : |  ColLabel '=' operator_def_arg
    8780             :  { 
    8781           0 :  $$ = cat_str(3,$1,mm_strdup("="),$3);
    8782             : }
    8783             : |  ColLabel
    8784             :  { 
    8785           0 :  $$ = $1;
    8786             : }
    8787             : ;
    8788             : 
    8789             : 
    8790             :  operator_def_arg:
    8791             :  func_type
    8792             :  { 
    8793           0 :  $$ = $1;
    8794             : }
    8795             : |  reserved_keyword
    8796             :  { 
    8797           0 :  $$ = $1;
    8798             : }
    8799             : |  qual_all_Op
    8800             :  { 
    8801           0 :  $$ = $1;
    8802             : }
    8803             : |  NumericOnly
    8804             :  { 
    8805           0 :  $$ = $1;
    8806             : }
    8807             : |  ecpg_sconst
    8808             :  { 
    8809           0 :  $$ = $1;
    8810             : }
    8811             : ;
    8812             : 
    8813             : 
    8814             :  AlterTypeStmt:
    8815             :  ALTER TYPE_P any_name SET '(' operator_def_list ')'
    8816             :  { 
    8817           0 :  $$ = cat_str(5,mm_strdup("alter type"),$3,mm_strdup("set ("),$6,mm_strdup(")"));
    8818             : }
    8819             : ;
    8820             : 
    8821             : 
    8822             :  AlterOwnerStmt:
    8823             :  ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
    8824             :  { 
    8825           0 :  $$ = cat_str(4,mm_strdup("alter aggregate"),$3,mm_strdup("owner to"),$6);
    8826             : }
    8827             : |  ALTER COLLATION any_name OWNER TO RoleSpec
    8828             :  { 
    8829           0 :  $$ = cat_str(4,mm_strdup("alter collation"),$3,mm_strdup("owner to"),$6);
    8830             : }
    8831             : |  ALTER CONVERSION_P any_name OWNER TO RoleSpec
    8832             :  { 
    8833           0 :  $$ = cat_str(4,mm_strdup("alter conversion"),$3,mm_strdup("owner to"),$6);
    8834             : }
    8835             : |  ALTER DATABASE name OWNER TO RoleSpec
    8836             :  { 
    8837           0 :  $$ = cat_str(4,mm_strdup("alter database"),$3,mm_strdup("owner to"),$6);
    8838             : }
    8839             : |  ALTER DOMAIN_P any_name OWNER TO RoleSpec
    8840             :  { 
    8841           0 :  $$ = cat_str(4,mm_strdup("alter domain"),$3,mm_strdup("owner to"),$6);
    8842             : }
    8843             : |  ALTER FUNCTION function_with_argtypes OWNER TO RoleSpec
    8844             :  { 
    8845           0 :  $$ = cat_str(4,mm_strdup("alter function"),$3,mm_strdup("owner to"),$6);
    8846             : }
    8847             : |  ALTER opt_procedural LANGUAGE name OWNER TO RoleSpec
    8848             :  { 
    8849           0 :  $$ = cat_str(6,mm_strdup("alter"),$2,mm_strdup("language"),$4,mm_strdup("owner to"),$7);
    8850             : }
    8851             : |  ALTER LARGE_P OBJECT_P NumericOnly OWNER TO RoleSpec
    8852             :  { 
    8853           0 :  $$ = cat_str(4,mm_strdup("alter large object"),$4,mm_strdup("owner to"),$7);
    8854             : }
    8855             : |  ALTER OPERATOR operator_with_argtypes OWNER TO RoleSpec
    8856             :  { 
    8857           0 :  $$ = cat_str(4,mm_strdup("alter operator"),$3,mm_strdup("owner to"),$6);
    8858             : }
    8859             : |  ALTER OPERATOR CLASS any_name USING name OWNER TO RoleSpec
    8860             :  { 
    8861           0 :  $$ = cat_str(6,mm_strdup("alter operator class"),$4,mm_strdup("using"),$6,mm_strdup("owner to"),$9);
    8862             : }
    8863             : |  ALTER OPERATOR FAMILY any_name USING name OWNER TO RoleSpec
    8864             :  { 
    8865           0 :  $$ = cat_str(6,mm_strdup("alter operator family"),$4,mm_strdup("using"),$6,mm_strdup("owner to"),$9);
    8866             : }
    8867             : |  ALTER PROCEDURE function_with_argtypes OWNER TO RoleSpec
    8868             :  { 
    8869           0 :  $$ = cat_str(4,mm_strdup("alter procedure"),$3,mm_strdup("owner to"),$6);
    8870             : }
    8871             : |  ALTER ROUTINE function_with_argtypes OWNER TO RoleSpec
    8872             :  { 
    8873           0 :  $$ = cat_str(4,mm_strdup("alter routine"),$3,mm_strdup("owner to"),$6);
    8874             : }
    8875             : |  ALTER SCHEMA name OWNER TO RoleSpec
    8876             :  { 
    8877           0 :  $$ = cat_str(4,mm_strdup("alter schema"),$3,mm_strdup("owner to"),$6);
    8878             : }
    8879             : |  ALTER TYPE_P any_name OWNER TO RoleSpec
    8880             :  { 
    8881           0 :  $$ = cat_str(4,mm_strdup("alter type"),$3,mm_strdup("owner to"),$6);
    8882             : }
    8883             : |  ALTER TABLESPACE name OWNER TO RoleSpec
    8884             :  { 
    8885           0 :  $$ = cat_str(4,mm_strdup("alter tablespace"),$3,mm_strdup("owner to"),$6);
    8886             : }
    8887             : |  ALTER STATISTICS any_name OWNER TO RoleSpec
    8888             :  { 
    8889           0 :  $$ = cat_str(4,mm_strdup("alter statistics"),$3,mm_strdup("owner to"),$6);
    8890             : }
    8891             : |  ALTER TEXT_P SEARCH DICTIONARY any_name OWNER TO RoleSpec
    8892             :  { 
    8893           0 :  $$ = cat_str(4,mm_strdup("alter text search dictionary"),$5,mm_strdup("owner to"),$8);
    8894             : }
    8895             : |  ALTER TEXT_P SEARCH CONFIGURATION any_name OWNER TO RoleSpec
    8896             :  { 
    8897           0 :  $$ = cat_str(4,mm_strdup("alter text search configuration"),$5,mm_strdup("owner to"),$8);
    8898             : }
    8899             : |  ALTER FOREIGN DATA_P WRAPPER name OWNER TO RoleSpec
    8900             :  { 
    8901           0 :  $$ = cat_str(4,mm_strdup("alter foreign data wrapper"),$5,mm_strdup("owner to"),$8);
    8902             : }
    8903             : |  ALTER SERVER name OWNER TO RoleSpec
    8904             :  { 
    8905           0 :  $$ = cat_str(4,mm_strdup("alter server"),$3,mm_strdup("owner to"),$6);
    8906             : }
    8907             : |  ALTER EVENT TRIGGER name OWNER TO RoleSpec
    8908             :  { 
    8909           0 :  $$ = cat_str(4,mm_strdup("alter event trigger"),$4,mm_strdup("owner to"),$7);
    8910             : }
    8911             : |  ALTER PUBLICATION name OWNER TO RoleSpec
    8912             :  { 
    8913           0 :  $$ = cat_str(4,mm_strdup("alter publication"),$3,mm_strdup("owner to"),$6);
    8914             : }
    8915             : |  ALTER SUBSCRIPTION name OWNER TO RoleSpec
    8916             :  { 
    8917           0 :  $$ = cat_str(4,mm_strdup("alter subscription"),$3,mm_strdup("owner to"),$6);
    8918             : }
    8919             : ;
    8920             : 
    8921             : 
    8922             :  CreatePublicationStmt:
    8923             :  CREATE PUBLICATION name opt_definition
    8924             :  { 
    8925           0 :  $$ = cat_str(3,mm_strdup("create publication"),$3,$4);
    8926             : }
    8927             : |  CREATE PUBLICATION name FOR ALL TABLES opt_definition
    8928             :  { 
    8929           0 :  $$ = cat_str(4,mm_strdup("create publication"),$3,mm_strdup("for all tables"),$7);
    8930             : }
    8931             : |  CREATE PUBLICATION name FOR pub_obj_list opt_definition
    8932             :  { 
    8933           0 :  $$ = cat_str(5,mm_strdup("create publication"),$3,mm_strdup("for"),$5,$6);
    8934             : }
    8935             : ;
    8936             : 
    8937             : 
    8938             :  PublicationObjSpec:
    8939             :  TABLE relation_expr opt_column_list OptWhereClause
    8940             :  { 
    8941           0 :  $$ = cat_str(4,mm_strdup("table"),$2,$3,$4);
    8942             : }
    8943             : |  TABLES IN_P SCHEMA ColId
    8944             :  { 
    8945           0 :  $$ = cat_str(2,mm_strdup("tables in schema"),$4);
    8946             : }
    8947             : |  TABLES IN_P SCHEMA CURRENT_SCHEMA
    8948             :  { 
    8949           0 :  $$ = mm_strdup("tables in schema current_schema");
    8950             : }
    8951             : |  ColId opt_column_list OptWhereClause
    8952             :  { 
    8953           0 :  $$ = cat_str(3,$1,$2,$3);
    8954             : }
    8955             : |  ColId indirection opt_column_list OptWhereClause
    8956             :  { 
    8957           0 :  $$ = cat_str(4,$1,$2,$3,$4);
    8958             : }
    8959             : |  extended_relation_expr opt_column_list OptWhereClause
    8960             :  { 
    8961           0 :  $$ = cat_str(3,$1,$2,$3);
    8962             : }
    8963             : |  CURRENT_SCHEMA
    8964             :  { 
    8965           0 :  $$ = mm_strdup("current_schema");
    8966             : }
    8967             : ;
    8968             : 
    8969             : 
    8970             :  pub_obj_list:
    8971             :  PublicationObjSpec
    8972             :  { 
    8973           0 :  $$ = $1;
    8974             : }
    8975             : |  pub_obj_list ',' PublicationObjSpec
    8976             :  { 
    8977           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    8978             : }
    8979             : ;
    8980             : 
    8981             : 
    8982             :  AlterPublicationStmt:
    8983             :  ALTER PUBLICATION name SET definition
    8984             :  { 
    8985           0 :  $$ = cat_str(4,mm_strdup("alter publication"),$3,mm_strdup("set"),$5);
    8986             : }
    8987             : |  ALTER PUBLICATION name ADD_P pub_obj_list
    8988             :  { 
    8989           0 :  $$ = cat_str(4,mm_strdup("alter publication"),$3,mm_strdup("add"),$5);
    8990             : }
    8991             : |  ALTER PUBLICATION name SET pub_obj_list
    8992             :  { 
    8993           0 :  $$ = cat_str(4,mm_strdup("alter publication"),$3,mm_strdup("set"),$5);
    8994             : }
    8995             : |  ALTER PUBLICATION name DROP pub_obj_list
    8996             :  { 
    8997           0 :  $$ = cat_str(4,mm_strdup("alter publication"),$3,mm_strdup("drop"),$5);
    8998             : }
    8999             : ;
    9000             : 
    9001             : 
    9002             :  CreateSubscriptionStmt:
    9003             :  CREATE SUBSCRIPTION name CONNECTION ecpg_sconst PUBLICATION name_list opt_definition
    9004             :  { 
    9005           0 :  $$ = cat_str(7,mm_strdup("create subscription"),$3,mm_strdup("connection"),$5,mm_strdup("publication"),$7,$8);
    9006             : }
    9007             : ;
    9008             : 
    9009             : 
    9010             :  AlterSubscriptionStmt:
    9011             :  ALTER SUBSCRIPTION name SET definition
    9012             :  { 
    9013           0 :  $$ = cat_str(4,mm_strdup("alter subscription"),$3,mm_strdup("set"),$5);
    9014             : }
    9015             : |  ALTER SUBSCRIPTION name CONNECTION ecpg_sconst
    9016             :  { 
    9017           0 :  $$ = cat_str(4,mm_strdup("alter subscription"),$3,mm_strdup("connection"),$5);
    9018             : }
    9019             : |  ALTER SUBSCRIPTION name REFRESH PUBLICATION opt_definition
    9020             :  { 
    9021           0 :  $$ = cat_str(4,mm_strdup("alter subscription"),$3,mm_strdup("refresh publication"),$6);
    9022             : }
    9023             : |  ALTER SUBSCRIPTION name ADD_P PUBLICATION name_list opt_definition
    9024             :  { 
    9025           0 :  $$ = cat_str(5,mm_strdup("alter subscription"),$3,mm_strdup("add publication"),$6,$7);
    9026             : }
    9027             : |  ALTER SUBSCRIPTION name DROP PUBLICATION name_list opt_definition
    9028             :  { 
    9029           0 :  $$ = cat_str(5,mm_strdup("alter subscription"),$3,mm_strdup("drop publication"),$6,$7);
    9030             : }
    9031             : |  ALTER SUBSCRIPTION name SET PUBLICATION name_list opt_definition
    9032             :  { 
    9033           0 :  $$ = cat_str(5,mm_strdup("alter subscription"),$3,mm_strdup("set publication"),$6,$7);
    9034             : }
    9035             : |  ALTER SUBSCRIPTION name ENABLE_P
    9036             :  { 
    9037           0 :  $$ = cat_str(3,mm_strdup("alter subscription"),$3,mm_strdup("enable"));
    9038             : }
    9039             : |  ALTER SUBSCRIPTION name DISABLE_P
    9040             :  { 
    9041           0 :  $$ = cat_str(3,mm_strdup("alter subscription"),$3,mm_strdup("disable"));
    9042             : }
    9043             : |  ALTER SUBSCRIPTION name SKIP definition
    9044             :  { 
    9045           0 :  $$ = cat_str(4,mm_strdup("alter subscription"),$3,mm_strdup("skip"),$5);
    9046             : }
    9047             : ;
    9048             : 
    9049             : 
    9050             :  DropSubscriptionStmt:
    9051             :  DROP SUBSCRIPTION name opt_drop_behavior
    9052             :  { 
    9053           0 :  $$ = cat_str(3,mm_strdup("drop subscription"),$3,$4);
    9054             : }
    9055             : |  DROP SUBSCRIPTION IF_P EXISTS name opt_drop_behavior
    9056             :  { 
    9057           0 :  $$ = cat_str(3,mm_strdup("drop subscription if exists"),$5,$6);
    9058             : }
    9059             : ;
    9060             : 
    9061             : 
    9062             :  RuleStmt:
    9063             :  CREATE opt_or_replace RULE name AS ON event TO qualified_name where_clause DO opt_instead RuleActionList
    9064             :  { 
    9065           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);
    9066             : }
    9067             : ;
    9068             : 
    9069             : 
    9070             :  RuleActionList:
    9071             :  NOTHING
    9072             :  { 
    9073           0 :  $$ = mm_strdup("nothing");
    9074             : }
    9075             : |  RuleActionStmt
    9076             :  { 
    9077           0 :  $$ = $1;
    9078             : }
    9079             : |  '(' RuleActionMulti ')'
    9080             :  { 
    9081           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
    9082             : }
    9083             : ;
    9084             : 
    9085             : 
    9086             :  RuleActionMulti:
    9087             :  RuleActionMulti ';' RuleActionStmtOrEmpty
    9088             :  { 
    9089           0 :  $$ = cat_str(3,$1,mm_strdup(";"),$3);
    9090             : }
    9091             : |  RuleActionStmtOrEmpty
    9092             :  { 
    9093           0 :  $$ = $1;
    9094             : }
    9095             : ;
    9096             : 
    9097             : 
    9098             :  RuleActionStmt:
    9099             :  SelectStmt
    9100             :  { 
    9101           0 :  $$ = $1;
    9102             : }
    9103             : |  InsertStmt
    9104             :  { 
    9105           0 :  $$ = $1;
    9106             : }
    9107             : |  UpdateStmt
    9108             :  { 
    9109           0 :  $$ = $1;
    9110             : }
    9111             : |  DeleteStmt
    9112             :  { 
    9113           0 :  $$ = $1;
    9114             : }
    9115             : |  NotifyStmt
    9116             :  { 
    9117           0 :  $$ = $1;
    9118             : }
    9119             : ;
    9120             : 
    9121             : 
    9122             :  RuleActionStmtOrEmpty:
    9123             :  RuleActionStmt
    9124             :  { 
    9125           0 :  $$ = $1;
    9126             : }
    9127             : | 
    9128             :  { 
    9129           0 :  $$=EMPTY; }
    9130             : ;
    9131             : 
    9132             : 
    9133             :  event:
    9134             :  SELECT
    9135             :  { 
    9136           0 :  $$ = mm_strdup("select");
    9137             : }
    9138             : |  UPDATE
    9139             :  { 
    9140           0 :  $$ = mm_strdup("update");
    9141             : }
    9142             : |  DELETE_P
    9143             :  { 
    9144           0 :  $$ = mm_strdup("delete");
    9145             : }
    9146             : |  INSERT
    9147             :  { 
    9148           0 :  $$ = mm_strdup("insert");
    9149             : }
    9150             : ;
    9151             : 
    9152             : 
    9153             :  opt_instead:
    9154             :  INSTEAD
    9155             :  { 
    9156           0 :  $$ = mm_strdup("instead");
    9157             : }
    9158             : |  ALSO
    9159             :  { 
    9160           0 :  $$ = mm_strdup("also");
    9161             : }
    9162             : | 
    9163             :  { 
    9164           0 :  $$=EMPTY; }
    9165             : ;
    9166             : 
    9167             : 
    9168             :  NotifyStmt:
    9169             :  NOTIFY ColId notify_payload
    9170             :  { 
    9171           0 :  $$ = cat_str(3,mm_strdup("notify"),$2,$3);
    9172             : }
    9173             : ;
    9174             : 
    9175             : 
    9176             :  notify_payload:
    9177             :  ',' ecpg_sconst
    9178             :  { 
    9179           0 :  $$ = cat_str(2,mm_strdup(","),$2);
    9180             : }
    9181             : | 
    9182             :  { 
    9183           0 :  $$=EMPTY; }
    9184             : ;
    9185             : 
    9186             : 
    9187             :  ListenStmt:
    9188             :  LISTEN ColId
    9189             :  { 
    9190           0 :  $$ = cat_str(2,mm_strdup("listen"),$2);
    9191             : }
    9192             : ;
    9193             : 
    9194             : 
    9195             :  UnlistenStmt:
    9196             :  UNLISTEN ColId
    9197             :  { 
    9198           0 :  $$ = cat_str(2,mm_strdup("unlisten"),$2);
    9199             : }
    9200             : |  UNLISTEN '*'
    9201             :  { 
    9202           0 :  $$ = mm_strdup("unlisten *");
    9203             : }
    9204             : ;
    9205             : 
    9206             : 
    9207             :  TransactionStmt:
    9208             :  ABORT_P opt_transaction opt_transaction_chain
    9209             :  { 
    9210           0 :  $$ = cat_str(3,mm_strdup("abort"),$2,$3);
    9211             : }
    9212             : |  START TRANSACTION transaction_mode_list_or_empty
    9213             :  { 
    9214           0 :  $$ = cat_str(2,mm_strdup("start transaction"),$3);
    9215             : }
    9216             : |  COMMIT opt_transaction opt_transaction_chain
    9217             :  { 
    9218         122 :  $$ = cat_str(3,mm_strdup("commit"),$2,$3);
    9219             : }
    9220             : |  ROLLBACK opt_transaction opt_transaction_chain
    9221             :  { 
    9222          32 :  $$ = cat_str(3,mm_strdup("rollback"),$2,$3);
    9223             : }
    9224             : |  SAVEPOINT ColId
    9225             :  { 
    9226           0 :  $$ = cat_str(2,mm_strdup("savepoint"),$2);
    9227             : }
    9228             : |  RELEASE SAVEPOINT ColId
    9229             :  { 
    9230           0 :  $$ = cat_str(2,mm_strdup("release savepoint"),$3);
    9231             : }
    9232             : |  RELEASE ColId
    9233             :  { 
    9234           0 :  $$ = cat_str(2,mm_strdup("release"),$2);
    9235             : }
    9236             : |  ROLLBACK opt_transaction TO SAVEPOINT ColId
    9237             :  { 
    9238           0 :  $$ = cat_str(4,mm_strdup("rollback"),$2,mm_strdup("to savepoint"),$5);
    9239             : }
    9240             : |  ROLLBACK opt_transaction TO ColId
    9241             :  { 
    9242           0 :  $$ = cat_str(4,mm_strdup("rollback"),$2,mm_strdup("to"),$4);
    9243             : }
    9244             : |  PREPARE TRANSACTION ecpg_sconst
    9245             :  { 
    9246           2 :  $$ = cat_str(2,mm_strdup("prepare transaction"),$3);
    9247             : }
    9248             : |  COMMIT PREPARED ecpg_sconst
    9249             :  { 
    9250           2 :  $$ = cat_str(2,mm_strdup("commit prepared"),$3);
    9251             : }
    9252             : |  ROLLBACK PREPARED ecpg_sconst
    9253             :  { 
    9254           0 :  $$ = cat_str(2,mm_strdup("rollback prepared"),$3);
    9255             : }
    9256             : ;
    9257             : 
    9258             : 
    9259             :  TransactionStmtLegacy:
    9260             :  BEGIN_P opt_transaction transaction_mode_list_or_empty
    9261             :  { 
    9262          16 :  $$ = cat_str(3,mm_strdup("begin"),$2,$3);
    9263             : }
    9264             : |  END_P opt_transaction opt_transaction_chain
    9265             :  { 
    9266           0 :  $$ = cat_str(3,mm_strdup("end"),$2,$3);
    9267             : }
    9268             : ;
    9269             : 
    9270             : 
    9271             :  opt_transaction:
    9272             :  WORK
    9273             :  { 
    9274          24 :  $$ = mm_strdup("work");
    9275             : }
    9276             : |  TRANSACTION
    9277             :  { 
    9278           0 :  $$ = mm_strdup("transaction");
    9279             : }
    9280             : | 
    9281             :  { 
    9282         146 :  $$=EMPTY; }
    9283             : ;
    9284             : 
    9285             : 
    9286             :  transaction_mode_item:
    9287             :  ISOLATION LEVEL iso_level
    9288             :  { 
    9289           2 :  $$ = cat_str(2,mm_strdup("isolation level"),$3);
    9290             : }
    9291             : |  READ ONLY
    9292             :  { 
    9293           0 :  $$ = mm_strdup("read only");
    9294             : }
    9295             : |  READ WRITE
    9296             :  { 
    9297           0 :  $$ = mm_strdup("read write");
    9298             : }
    9299             : |  DEFERRABLE
    9300             :  { 
    9301           0 :  $$ = mm_strdup("deferrable");
    9302             : }
    9303             : |  NOT DEFERRABLE
    9304             :  { 
    9305           0 :  $$ = mm_strdup("not deferrable");
    9306             : }
    9307             : ;
    9308             : 
    9309             : 
    9310             :  transaction_mode_list:
    9311             :  transaction_mode_item
    9312             :  { 
    9313           2 :  $$ = $1;
    9314             : }
    9315             : |  transaction_mode_list ',' transaction_mode_item
    9316             :  { 
    9317           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    9318             : }
    9319             : |  transaction_mode_list transaction_mode_item
    9320             :  { 
    9321           0 :  $$ = cat_str(2,$1,$2);
    9322             : }
    9323             : ;
    9324             : 
    9325             : 
    9326             :  transaction_mode_list_or_empty:
    9327             :  transaction_mode_list
    9328             :  { 
    9329           0 :  $$ = $1;
    9330             : }
    9331             : | 
    9332             :  { 
    9333          16 :  $$=EMPTY; }
    9334             : ;
    9335             : 
    9336             : 
    9337             :  opt_transaction_chain:
    9338             :  AND CHAIN
    9339             :  { 
    9340           0 :  $$ = mm_strdup("and chain");
    9341             : }
    9342             : |  AND NO CHAIN
    9343             :  { 
    9344           0 :  $$ = mm_strdup("and no chain");
    9345             : }
    9346             : | 
    9347             :  { 
    9348         154 :  $$=EMPTY; }
    9349             : ;
    9350             : 
    9351             : 
    9352             :  ViewStmt:
    9353             :  CREATE OptTemp VIEW qualified_name opt_column_list opt_reloptions AS SelectStmt opt_check_option
    9354             :  { 
    9355           0 :  $$ = cat_str(9,mm_strdup("create"),$2,mm_strdup("view"),$4,$5,$6,mm_strdup("as"),$8,$9);
    9356             : }
    9357             : |  CREATE OR REPLACE OptTemp VIEW qualified_name opt_column_list opt_reloptions AS SelectStmt opt_check_option
    9358             :  { 
    9359           0 :  $$ = cat_str(9,mm_strdup("create or replace"),$4,mm_strdup("view"),$6,$7,$8,mm_strdup("as"),$10,$11);
    9360             : }
    9361             : |  CREATE OptTemp RECURSIVE VIEW qualified_name '(' columnList ')' opt_reloptions AS SelectStmt opt_check_option
    9362             :  { 
    9363           0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
    9364           0 :  $$ = cat_str(11,mm_strdup("create"),$2,mm_strdup("recursive view"),$5,mm_strdup("("),$7,mm_strdup(")"),$9,mm_strdup("as"),$11,$12);
    9365             : }
    9366             : |  CREATE OR REPLACE OptTemp RECURSIVE VIEW qualified_name '(' columnList ')' opt_reloptions AS SelectStmt opt_check_option
    9367             :  { 
    9368           0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
    9369           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);
    9370             : }
    9371             : ;
    9372             : 
    9373             : 
    9374             :  opt_check_option:
    9375             :  WITH CHECK OPTION
    9376             :  { 
    9377           0 :  $$ = mm_strdup("with check option");
    9378             : }
    9379             : |  WITH CASCADED CHECK OPTION
    9380             :  { 
    9381           0 :  $$ = mm_strdup("with cascaded check option");
    9382             : }
    9383             : |  WITH LOCAL CHECK OPTION
    9384             :  { 
    9385           0 :  $$ = mm_strdup("with local check option");
    9386             : }
    9387             : | 
    9388             :  { 
    9389           0 :  $$=EMPTY; }
    9390             : ;
    9391             : 
    9392             : 
    9393             :  LoadStmt:
    9394             :  LOAD file_name
    9395             :  { 
    9396           0 :  $$ = cat_str(2,mm_strdup("load"),$2);
    9397             : }
    9398             : ;
    9399             : 
    9400             : 
    9401             :  CreatedbStmt:
    9402             :  CREATE DATABASE name opt_with createdb_opt_list
    9403             :  { 
    9404           0 :  $$ = cat_str(4,mm_strdup("create database"),$3,$4,$5);
    9405             : }
    9406             : ;
    9407             : 
    9408             : 
    9409             :  createdb_opt_list:
    9410             :  createdb_opt_items
    9411             :  { 
    9412           0 :  $$ = $1;
    9413             : }
    9414             : | 
    9415             :  { 
    9416           0 :  $$=EMPTY; }
    9417             : ;
    9418             : 
    9419             : 
    9420             :  createdb_opt_items:
    9421             :  createdb_opt_item
    9422             :  { 
    9423           0 :  $$ = $1;
    9424             : }
    9425             : |  createdb_opt_items createdb_opt_item
    9426             :  { 
    9427           0 :  $$ = cat_str(2,$1,$2);
    9428             : }
    9429             : ;
    9430             : 
    9431             : 
    9432             :  createdb_opt_item:
    9433             :  createdb_opt_name opt_equal NumericOnly
    9434             :  { 
    9435           0 :  $$ = cat_str(3,$1,$2,$3);
    9436             : }
    9437             : |  createdb_opt_name opt_equal opt_boolean_or_string
    9438             :  { 
    9439           0 :  $$ = cat_str(3,$1,$2,$3);
    9440             : }
    9441             : |  createdb_opt_name opt_equal DEFAULT
    9442             :  { 
    9443           0 :  $$ = cat_str(3,$1,$2,mm_strdup("default"));
    9444             : }
    9445             : ;
    9446             : 
    9447             : 
    9448             :  createdb_opt_name:
    9449             :  ecpg_ident
    9450             :  { 
    9451           0 :  $$ = $1;
    9452             : }
    9453             : |  CONNECTION LIMIT
    9454             :  { 
    9455           0 :  $$ = mm_strdup("connection limit");
    9456             : }
    9457             : |  ENCODING
    9458             :  { 
    9459           0 :  $$ = mm_strdup("encoding");
    9460             : }
    9461             : |  LOCATION
    9462             :  { 
    9463           0 :  $$ = mm_strdup("location");
    9464             : }
    9465             : |  OWNER
    9466             :  { 
    9467           0 :  $$ = mm_strdup("owner");
    9468             : }
    9469             : |  TABLESPACE
    9470             :  { 
    9471           0 :  $$ = mm_strdup("tablespace");
    9472             : }
    9473             : |  TEMPLATE
    9474             :  { 
    9475           0 :  $$ = mm_strdup("template");
    9476             : }
    9477             : ;
    9478             : 
    9479             : 
    9480             :  opt_equal:
    9481             :  '='
    9482             :  { 
    9483           0 :  $$ = mm_strdup("=");
    9484             : }
    9485             : | 
    9486             :  { 
    9487           0 :  $$=EMPTY; }
    9488             : ;
    9489             : 
    9490             : 
    9491             :  AlterDatabaseStmt:
    9492             :  ALTER DATABASE name WITH createdb_opt_list
    9493             :  { 
    9494           0 :  $$ = cat_str(4,mm_strdup("alter database"),$3,mm_strdup("with"),$5);
    9495             : }
    9496             : |  ALTER DATABASE name createdb_opt_list
    9497             :  { 
    9498           0 :  $$ = cat_str(3,mm_strdup("alter database"),$3,$4);
    9499             : }
    9500             : |  ALTER DATABASE name SET TABLESPACE name
    9501             :  { 
    9502           0 :  $$ = cat_str(4,mm_strdup("alter database"),$3,mm_strdup("set tablespace"),$6);
    9503             : }
    9504             : |  ALTER DATABASE name REFRESH COLLATION VERSION_P
    9505             :  { 
    9506           0 :  $$ = cat_str(3,mm_strdup("alter database"),$3,mm_strdup("refresh collation version"));
    9507             : }
    9508             : ;
    9509             : 
    9510             : 
    9511             :  AlterDatabaseSetStmt:
    9512             :  ALTER DATABASE name SetResetClause
    9513             :  { 
    9514           0 :  $$ = cat_str(3,mm_strdup("alter database"),$3,$4);
    9515             : }
    9516             : ;
    9517             : 
    9518             : 
    9519             :  DropdbStmt:
    9520             :  DROP DATABASE name
    9521             :  { 
    9522           0 :  $$ = cat_str(2,mm_strdup("drop database"),$3);
    9523             : }
    9524             : |  DROP DATABASE IF_P EXISTS name
    9525             :  { 
    9526           0 :  $$ = cat_str(2,mm_strdup("drop database if exists"),$5);
    9527             : }
    9528             : |  DROP DATABASE name opt_with '(' drop_option_list ')'
    9529             :  { 
    9530           0 :  $$ = cat_str(6,mm_strdup("drop database"),$3,$4,mm_strdup("("),$6,mm_strdup(")"));
    9531             : }
    9532             : |  DROP DATABASE IF_P EXISTS name opt_with '(' drop_option_list ')'
    9533             :  { 
    9534           0 :  $$ = cat_str(6,mm_strdup("drop database if exists"),$5,$6,mm_strdup("("),$8,mm_strdup(")"));
    9535             : }
    9536             : ;
    9537             : 
    9538             : 
    9539             :  drop_option_list:
    9540             :  drop_option
    9541             :  { 
    9542           0 :  $$ = $1;
    9543             : }
    9544             : |  drop_option_list ',' drop_option
    9545             :  { 
    9546           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    9547             : }
    9548             : ;
    9549             : 
    9550             : 
    9551             :  drop_option:
    9552             :  FORCE
    9553             :  { 
    9554           0 :  $$ = mm_strdup("force");
    9555             : }
    9556             : ;
    9557             : 
    9558             : 
    9559             :  AlterCollationStmt:
    9560             :  ALTER COLLATION any_name REFRESH VERSION_P
    9561             :  { 
    9562           0 :  $$ = cat_str(3,mm_strdup("alter collation"),$3,mm_strdup("refresh version"));
    9563             : }
    9564             : ;
    9565             : 
    9566             : 
    9567             :  AlterSystemStmt:
    9568             :  ALTER SYSTEM_P SET generic_set
    9569             :  { 
    9570           0 :  $$ = cat_str(2,mm_strdup("alter system set"),$4);
    9571             : }
    9572             : |  ALTER SYSTEM_P RESET generic_reset
    9573             :  { 
    9574           0 :  $$ = cat_str(2,mm_strdup("alter system reset"),$4);
    9575             : }
    9576             : ;
    9577             : 
    9578             : 
    9579             :  CreateDomainStmt:
    9580             :  CREATE DOMAIN_P any_name opt_as Typename ColQualList
    9581             :  { 
    9582           0 :  $$ = cat_str(5,mm_strdup("create domain"),$3,$4,$5,$6);
    9583             : }
    9584             : ;
    9585             : 
    9586             : 
    9587             :  AlterDomainStmt:
    9588             :  ALTER DOMAIN_P any_name alter_column_default
    9589             :  { 
    9590           0 :  $$ = cat_str(3,mm_strdup("alter domain"),$3,$4);
    9591             : }
    9592             : |  ALTER DOMAIN_P any_name DROP NOT NULL_P
    9593             :  { 
    9594           0 :  $$ = cat_str(3,mm_strdup("alter domain"),$3,mm_strdup("drop not null"));
    9595             : }
    9596             : |  ALTER DOMAIN_P any_name SET NOT NULL_P
    9597             :  { 
    9598           0 :  $$ = cat_str(3,mm_strdup("alter domain"),$3,mm_strdup("set not null"));
    9599             : }
    9600             : |  ALTER DOMAIN_P any_name ADD_P TableConstraint
    9601             :  { 
    9602           0 :  $$ = cat_str(4,mm_strdup("alter domain"),$3,mm_strdup("add"),$5);
    9603             : }
    9604             : |  ALTER DOMAIN_P any_name DROP CONSTRAINT name opt_drop_behavior
    9605             :  { 
    9606           0 :  $$ = cat_str(5,mm_strdup("alter domain"),$3,mm_strdup("drop constraint"),$6,$7);
    9607             : }
    9608             : |  ALTER DOMAIN_P any_name DROP CONSTRAINT IF_P EXISTS name opt_drop_behavior
    9609             :  { 
    9610           0 :  $$ = cat_str(5,mm_strdup("alter domain"),$3,mm_strdup("drop constraint if exists"),$8,$9);
    9611             : }
    9612             : |  ALTER DOMAIN_P any_name VALIDATE CONSTRAINT name
    9613             :  { 
    9614           0 :  $$ = cat_str(4,mm_strdup("alter domain"),$3,mm_strdup("validate constraint"),$6);
    9615             : }
    9616             : ;
    9617             : 
    9618             : 
    9619             :  opt_as:
    9620             :  AS
    9621             :  { 
    9622           0 :  $$ = mm_strdup("as");
    9623             : }
    9624             : | 
    9625             :  { 
    9626           2 :  $$=EMPTY; }
    9627             : ;
    9628             : 
    9629             : 
    9630             :  AlterTSDictionaryStmt:
    9631             :  ALTER TEXT_P SEARCH DICTIONARY any_name definition
    9632             :  { 
    9633           0 :  $$ = cat_str(3,mm_strdup("alter text search dictionary"),$5,$6);
    9634             : }
    9635             : ;
    9636             : 
    9637             : 
    9638             :  AlterTSConfigurationStmt:
    9639             :  ALTER TEXT_P SEARCH CONFIGURATION any_name ADD_P MAPPING FOR name_list any_with any_name_list
    9640             :  { 
    9641           0 :  $$ = cat_str(6,mm_strdup("alter text search configuration"),$5,mm_strdup("add mapping for"),$9,$10,$11);
    9642             : }
    9643             : |  ALTER TEXT_P SEARCH CONFIGURATION any_name ALTER MAPPING FOR name_list any_with any_name_list
    9644             :  { 
    9645           0 :  $$ = cat_str(6,mm_strdup("alter text search configuration"),$5,mm_strdup("alter mapping for"),$9,$10,$11);
    9646             : }
    9647             : |  ALTER TEXT_P SEARCH CONFIGURATION any_name ALTER MAPPING REPLACE any_name any_with any_name
    9648             :  { 
    9649           0 :  $$ = cat_str(6,mm_strdup("alter text search configuration"),$5,mm_strdup("alter mapping replace"),$9,$10,$11);
    9650             : }
    9651             : |  ALTER TEXT_P SEARCH CONFIGURATION any_name ALTER MAPPING FOR name_list REPLACE any_name any_with any_name
    9652             :  { 
    9653           0 :  $$ = cat_str(8,mm_strdup("alter text search configuration"),$5,mm_strdup("alter mapping for"),$9,mm_strdup("replace"),$11,$12,$13);
    9654             : }
    9655             : |  ALTER TEXT_P SEARCH CONFIGURATION any_name DROP MAPPING FOR name_list
    9656             :  { 
    9657           0 :  $$ = cat_str(4,mm_strdup("alter text search configuration"),$5,mm_strdup("drop mapping for"),$9);
    9658             : }
    9659             : |  ALTER TEXT_P SEARCH CONFIGURATION any_name DROP MAPPING IF_P EXISTS FOR name_list
    9660             :  { 
    9661           0 :  $$ = cat_str(4,mm_strdup("alter text search configuration"),$5,mm_strdup("drop mapping if exists for"),$11);
    9662             : }
    9663             : ;
    9664             : 
    9665             : 
    9666             :  any_with:
    9667             :  WITH
    9668             :  { 
    9669           0 :  $$ = mm_strdup("with");
    9670             : }
    9671             : |  WITH_LA
    9672             :  { 
    9673           0 :  $$ = mm_strdup("with");
    9674             : }
    9675             : ;
    9676             : 
    9677             : 
    9678             :  CreateConversionStmt:
    9679             :  CREATE opt_default CONVERSION_P any_name FOR ecpg_sconst TO ecpg_sconst FROM any_name
    9680             :  { 
    9681           0 :  $$ = cat_str(10,mm_strdup("create"),$2,mm_strdup("conversion"),$4,mm_strdup("for"),$6,mm_strdup("to"),$8,mm_strdup("from"),$10);
    9682             : }
    9683             : ;
    9684             : 
    9685             : 
    9686             :  ClusterStmt:
    9687             :  CLUSTER '(' utility_option_list ')' qualified_name cluster_index_specification
    9688             :  { 
    9689           0 :  $$ = cat_str(5,mm_strdup("cluster ("),$3,mm_strdup(")"),$5,$6);
    9690             : }
    9691             : |  CLUSTER '(' utility_option_list ')'
    9692             :  { 
    9693           0 :  $$ = cat_str(3,mm_strdup("cluster ("),$3,mm_strdup(")"));
    9694             : }
    9695             : |  CLUSTER opt_verbose qualified_name cluster_index_specification
    9696             :  { 
    9697           0 :  $$ = cat_str(4,mm_strdup("cluster"),$2,$3,$4);
    9698             : }
    9699             : |  CLUSTER opt_verbose
    9700             :  { 
    9701           0 :  $$ = cat_str(2,mm_strdup("cluster"),$2);
    9702             : }
    9703             : |  CLUSTER opt_verbose name ON qualified_name
    9704             :  { 
    9705           0 :  $$ = cat_str(5,mm_strdup("cluster"),$2,$3,mm_strdup("on"),$5);
    9706             : }
    9707             : ;
    9708             : 
    9709             : 
    9710             :  cluster_index_specification:
    9711             :  USING name
    9712             :  { 
    9713           0 :  $$ = cat_str(2,mm_strdup("using"),$2);
    9714             : }
    9715             : | 
    9716             :  { 
    9717           0 :  $$=EMPTY; }
    9718             : ;
    9719             : 
    9720             : 
    9721             :  VacuumStmt:
    9722             :  VACUUM opt_full opt_freeze opt_verbose opt_analyze opt_vacuum_relation_list
    9723             :  { 
    9724           0 :  $$ = cat_str(6,mm_strdup("vacuum"),$2,$3,$4,$5,$6);
    9725             : }
    9726             : |  VACUUM '(' utility_option_list ')' opt_vacuum_relation_list
    9727             :  { 
    9728           0 :  $$ = cat_str(4,mm_strdup("vacuum ("),$3,mm_strdup(")"),$5);
    9729             : }
    9730             : ;
    9731             : 
    9732             : 
    9733             :  AnalyzeStmt:
    9734             :  analyze_keyword opt_verbose opt_vacuum_relation_list
    9735             :  { 
    9736           0 :  $$ = cat_str(3,$1,$2,$3);
    9737             : }
    9738             : |  analyze_keyword '(' utility_option_list ')' opt_vacuum_relation_list
    9739             :  { 
    9740           0 :  $$ = cat_str(5,$1,mm_strdup("("),$3,mm_strdup(")"),$5);
    9741             : }
    9742             : ;
    9743             : 
    9744             : 
    9745             :  utility_option_list:
    9746             :  utility_option_elem
    9747             :  { 
    9748           0 :  $$ = $1;
    9749             : }
    9750             : |  utility_option_list ',' utility_option_elem
    9751             :  { 
    9752           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    9753             : }
    9754             : ;
    9755             : 
    9756             : 
    9757             :  analyze_keyword:
    9758             :  ANALYZE
    9759             :  { 
    9760           0 :  $$ = mm_strdup("analyze");
    9761             : }
    9762             : |  ANALYSE
    9763             :  { 
    9764           0 :  $$ = mm_strdup("analyse");
    9765             : }
    9766             : ;
    9767             : 
    9768             : 
    9769             :  utility_option_elem:
    9770             :  utility_option_name utility_option_arg
    9771             :  { 
    9772           0 :  $$ = cat_str(2,$1,$2);
    9773             : }
    9774             : ;
    9775             : 
    9776             : 
    9777             :  utility_option_name:
    9778             :  NonReservedWord
    9779             :  { 
    9780           0 :  $$ = $1;
    9781             : }
    9782             : |  analyze_keyword
    9783             :  { 
    9784           0 :  $$ = $1;
    9785             : }
    9786             : |  FORMAT_LA
    9787             :  { 
    9788           0 :  $$ = mm_strdup("format");
    9789             : }
    9790             : ;
    9791             : 
    9792             : 
    9793             :  utility_option_arg:
    9794             :  opt_boolean_or_string
    9795             :  { 
    9796           0 :  $$ = $1;
    9797             : }
    9798             : |  NumericOnly
    9799             :  { 
    9800           0 :  $$ = $1;
    9801             : }
    9802             : | 
    9803             :  { 
    9804           0 :  $$=EMPTY; }
    9805             : ;
    9806             : 
    9807             : 
    9808             :  opt_analyze:
    9809             :  analyze_keyword
    9810             :  { 
    9811           0 :  $$ = $1;
    9812             : }
    9813             : | 
    9814             :  { 
    9815           0 :  $$=EMPTY; }
    9816             : ;
    9817             : 
    9818             : 
    9819             :  opt_verbose:
    9820             :  VERBOSE
    9821             :  { 
    9822           0 :  $$ = mm_strdup("verbose");
    9823             : }
    9824             : | 
    9825             :  { 
    9826           0 :  $$=EMPTY; }
    9827             : ;
    9828             : 
    9829             : 
    9830             :  opt_full:
    9831             :  FULL
    9832             :  { 
    9833           0 :  $$ = mm_strdup("full");
    9834             : }
    9835             : | 
    9836             :  { 
    9837           0 :  $$=EMPTY; }
    9838             : ;
    9839             : 
    9840             : 
    9841             :  opt_freeze:
    9842             :  FREEZE
    9843             :  { 
    9844           0 :  $$ = mm_strdup("freeze");
    9845             : }
    9846             : | 
    9847             :  { 
    9848           0 :  $$=EMPTY; }
    9849             : ;
    9850             : 
    9851             : 
    9852             :  opt_name_list:
    9853             :  '(' name_list ')'
    9854             :  { 
    9855           2 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
    9856             : }
    9857             : | 
    9858             :  { 
    9859           0 :  $$=EMPTY; }
    9860             : ;
    9861             : 
    9862             : 
    9863             :  vacuum_relation:
    9864             :  qualified_name opt_name_list
    9865             :  { 
    9866           0 :  $$ = cat_str(2,$1,$2);
    9867             : }
    9868             : ;
    9869             : 
    9870             : 
    9871             :  vacuum_relation_list:
    9872             :  vacuum_relation
    9873             :  { 
    9874           0 :  $$ = $1;
    9875             : }
    9876             : |  vacuum_relation_list ',' vacuum_relation
    9877             :  { 
    9878           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
    9879             : }
    9880             : ;
    9881             : 
    9882             : 
    9883             :  opt_vacuum_relation_list:
    9884             :  vacuum_relation_list
    9885             :  { 
    9886           0 :  $$ = $1;
    9887             : }
    9888             : | 
    9889             :  { 
    9890           0 :  $$=EMPTY; }
    9891             : ;
    9892             : 
    9893             : 
    9894             :  ExplainStmt:
    9895             :  EXPLAIN ExplainableStmt
    9896             :  { 
    9897           0 :  $$ = cat_str(2,mm_strdup("explain"),$2);
    9898             : }
    9899             : |  EXPLAIN analyze_keyword opt_verbose ExplainableStmt
    9900             :  { 
    9901           0 :  $$ = cat_str(4,mm_strdup("explain"),$2,$3,$4);
    9902             : }
    9903             : |  EXPLAIN VERBOSE ExplainableStmt
    9904             :  { 
    9905           0 :  $$ = cat_str(2,mm_strdup("explain verbose"),$3);
    9906             : }
    9907             : |  EXPLAIN '(' utility_option_list ')' ExplainableStmt
    9908             :  { 
    9909           0 :  $$ = cat_str(4,mm_strdup("explain ("),$3,mm_strdup(")"),$5);
    9910             : }
    9911             : ;
    9912             : 
    9913             : 
    9914             :  ExplainableStmt:
    9915             :  SelectStmt
    9916             :  { 
    9917           0 :  $$ = $1;
    9918             : }
    9919             : |  InsertStmt
    9920             :  { 
    9921           0 :  $$ = $1;
    9922             : }
    9923             : |  UpdateStmt
    9924             :  { 
    9925           0 :  $$ = $1;
    9926             : }
    9927             : |  DeleteStmt
    9928             :  { 
    9929           0 :  $$ = $1;
    9930             : }
    9931             : |  MergeStmt
    9932             :  { 
    9933           0 :  $$ = $1;
    9934             : }
    9935             : |  DeclareCursorStmt
    9936             :  { 
    9937           0 :  $$ = $1;
    9938             : }
    9939             : |  CreateAsStmt
    9940             :  { 
    9941           0 :  $$ = $1;
    9942             : }
    9943             : |  CreateMatViewStmt
    9944             :  { 
    9945           0 :  $$ = $1;
    9946             : }
    9947             : |  RefreshMatViewStmt
    9948             :  { 
    9949           0 :  $$ = $1;
    9950             : }
    9951             : |  ExecuteStmt
    9952             :     {
    9953           0 :         $$ = $1.name;
    9954             :     }
    9955             : ;
    9956             : 
    9957             : 
    9958             :  PrepareStmt:
    9959             : PREPARE prepared_name prep_type_clause AS PreparableStmt
    9960             :     {
    9961          12 :         $$.name = $2;
    9962          12 :         $$.type = $3;
    9963          12 :         $$.stmt = $5;
    9964             :     }
    9965             :     | PREPARE prepared_name FROM execstring
    9966             :     {
    9967          94 :         $$.name = $2;
    9968          94 :         $$.type = NULL;
    9969          94 :         $$.stmt = $4;
    9970             :     }
    9971             : ;
    9972             : 
    9973             : 
    9974             :  prep_type_clause:
    9975             :  '(' type_list ')'
    9976             :  { 
    9977          10 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
    9978             : }
    9979             : | 
    9980             :  { 
    9981           2 :  $$=EMPTY; }
    9982             : ;
    9983             : 
    9984             : 
    9985             :  PreparableStmt:
    9986             :  SelectStmt
    9987             :  { 
    9988           2 :  $$ = $1;
    9989             : }
    9990             : |  InsertStmt
    9991             :  { 
    9992          12 :  $$ = $1;
    9993             : }
    9994             : |  UpdateStmt
    9995             :  { 
    9996           0 :  $$ = $1;
    9997             : }
    9998             : |  DeleteStmt
    9999             :  { 
   10000           0 :  $$ = $1;
   10001             : }
   10002             : |  MergeStmt
   10003             :  { 
   10004           0 :  $$ = $1;
   10005             : }
   10006             : ;
   10007             : 
   10008             : 
   10009             :  ExecuteStmt:
   10010             : EXECUTE prepared_name execute_param_clause execute_rest
   10011             :     {
   10012          66 :         $$.name = $2;
   10013          66 :         $$.type = $3;
   10014             :     }
   10015             : | CREATE OptTemp TABLE create_as_target AS EXECUTE prepared_name execute_param_clause opt_with_data execute_rest
   10016             :     {
   10017           0 :         $$.name = cat_str(8,mm_strdup("create"),$2,mm_strdup("table"),$4,mm_strdup("as execute"),$7,$8,$9);
   10018             :     }
   10019             : | CREATE OptTemp TABLE IF_P NOT EXISTS create_as_target AS EXECUTE prepared_name execute_param_clause opt_with_data execute_rest
   10020             :     {
   10021           0 :         $$.name = cat_str(8,mm_strdup("create"),$2,mm_strdup("table if not exists"),$7,mm_strdup("as execute"),$10,$11,$12);
   10022             :     }
   10023             : ;
   10024             : 
   10025             : 
   10026             :  execute_param_clause:
   10027             :  '(' expr_list ')'
   10028             :  { 
   10029          18 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
   10030             : }
   10031             : | 
   10032             :  { 
   10033          48 :  $$=EMPTY; }
   10034             : ;
   10035             : 
   10036             : 
   10037             :  InsertStmt:
   10038             :  opt_with_clause INSERT INTO insert_target insert_rest opt_on_conflict returning_clause
   10039             :  { 
   10040         236 :  $$ = cat_str(6,$1,mm_strdup("insert into"),$4,$5,$6,$7);
   10041             : }
   10042             : ;
   10043             : 
   10044             : 
   10045             :  insert_target:
   10046             :  qualified_name
   10047             :  { 
   10048         236 :  $$ = $1;
   10049             : }
   10050             : |  qualified_name AS ColId
   10051             :  { 
   10052           0 :  $$ = cat_str(3,$1,mm_strdup("as"),$3);
   10053             : }
   10054             : ;
   10055             : 
   10056             : 
   10057             :  insert_rest:
   10058             :  SelectStmt
   10059             :  { 
   10060         132 :  $$ = $1;
   10061             : }
   10062             : |  OVERRIDING override_kind VALUE_P SelectStmt
   10063             :  { 
   10064           0 :  $$ = cat_str(4,mm_strdup("overriding"),$2,mm_strdup("value"),$4);
   10065             : }
   10066             : |  '(' insert_column_list ')' SelectStmt
   10067             :  { 
   10068         104 :  $$ = cat_str(4,mm_strdup("("),$2,mm_strdup(")"),$4);
   10069             : }
   10070             : |  '(' insert_column_list ')' OVERRIDING override_kind VALUE_P SelectStmt
   10071             :  { 
   10072           0 :  $$ = cat_str(6,mm_strdup("("),$2,mm_strdup(") overriding"),$5,mm_strdup("value"),$7);
   10073             : }
   10074             : |  DEFAULT VALUES
   10075             :  { 
   10076           0 :  $$ = mm_strdup("default values");
   10077             : }
   10078             : ;
   10079             : 
   10080             : 
   10081             :  override_kind:
   10082             :  USER
   10083             :  { 
   10084           0 :  $$ = mm_strdup("user");
   10085             : }
   10086             : |  SYSTEM_P
   10087             :  { 
   10088           0 :  $$ = mm_strdup("system");
   10089             : }
   10090             : ;
   10091             : 
   10092             : 
   10093             :  insert_column_list:
   10094             :  insert_column_item
   10095             :  { 
   10096         104 :  $$ = $1;
   10097             : }
   10098             : |  insert_column_list ',' insert_column_item
   10099             :  { 
   10100         242 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   10101             : }
   10102             : ;
   10103             : 
   10104             : 
   10105             :  insert_column_item:
   10106             :  ColId opt_indirection
   10107             :  { 
   10108         346 :  $$ = cat_str(2,$1,$2);
   10109             : }
   10110             : ;
   10111             : 
   10112             : 
   10113             :  opt_on_conflict:
   10114             :  ON CONFLICT opt_conf_expr DO UPDATE SET set_clause_list where_clause
   10115             :  { 
   10116           0 :  $$ = cat_str(5,mm_strdup("on conflict"),$3,mm_strdup("do update set"),$7,$8);
   10117             : }
   10118             : |  ON CONFLICT opt_conf_expr DO NOTHING
   10119             :  { 
   10120           0 :  $$ = cat_str(3,mm_strdup("on conflict"),$3,mm_strdup("do nothing"));
   10121             : }
   10122             : | 
   10123             :  { 
   10124         236 :  $$=EMPTY; }
   10125             : ;
   10126             : 
   10127             : 
   10128             :  opt_conf_expr:
   10129             :  '(' index_params ')' where_clause
   10130             :  { 
   10131           0 :  $$ = cat_str(4,mm_strdup("("),$2,mm_strdup(")"),$4);
   10132             : }
   10133             : |  ON CONSTRAINT name
   10134             :  { 
   10135           0 :  $$ = cat_str(2,mm_strdup("on constraint"),$3);
   10136             : }
   10137             : | 
   10138             :  { 
   10139           0 :  $$=EMPTY; }
   10140             : ;
   10141             : 
   10142             : 
   10143             :  returning_clause:
   10144             : RETURNING target_list opt_ecpg_into
   10145             :  { 
   10146           4 :  $$ = cat_str(2,mm_strdup("returning"),$2);
   10147             : }
   10148             : | 
   10149             :  { 
   10150         246 :  $$=EMPTY; }
   10151             : ;
   10152             : 
   10153             : 
   10154             :  DeleteStmt:
   10155             :  opt_with_clause DELETE_P FROM relation_expr_opt_alias using_clause where_or_current_clause returning_clause
   10156             :  { 
   10157           4 :  $$ = cat_str(6,$1,mm_strdup("delete from"),$4,$5,$6,$7);
   10158             : }
   10159             : ;
   10160             : 
   10161             : 
   10162             :  using_clause:
   10163             :  USING from_list
   10164             :  { 
   10165           0 :  $$ = cat_str(2,mm_strdup("using"),$2);
   10166             : }
   10167             : | 
   10168             :  { 
   10169           4 :  $$=EMPTY; }
   10170             : ;
   10171             : 
   10172             : 
   10173             :  LockStmt:
   10174             :  LOCK_P opt_table relation_expr_list opt_lock opt_nowait
   10175             :  { 
   10176           0 :  $$ = cat_str(5,mm_strdup("lock"),$2,$3,$4,$5);
   10177             : }
   10178             : ;
   10179             : 
   10180             : 
   10181             :  opt_lock:
   10182             :  IN_P lock_type MODE
   10183             :  { 
   10184           0 :  $$ = cat_str(3,mm_strdup("in"),$2,mm_strdup("mode"));
   10185             : }
   10186             : | 
   10187             :  { 
   10188           0 :  $$=EMPTY; }
   10189             : ;
   10190             : 
   10191             : 
   10192             :  lock_type:
   10193             :  ACCESS SHARE
   10194             :  { 
   10195           0 :  $$ = mm_strdup("access share");
   10196             : }
   10197             : |  ROW SHARE
   10198             :  { 
   10199           0 :  $$ = mm_strdup("row share");
   10200             : }
   10201             : |  ROW EXCLUSIVE
   10202             :  { 
   10203           0 :  $$ = mm_strdup("row exclusive");
   10204             : }
   10205             : |  SHARE UPDATE EXCLUSIVE
   10206             :  { 
   10207           0 :  $$ = mm_strdup("share update exclusive");
   10208             : }
   10209             : |  SHARE
   10210             :  { 
   10211           0 :  $$ = mm_strdup("share");
   10212             : }
   10213             : |  SHARE ROW EXCLUSIVE
   10214             :  { 
   10215           0 :  $$ = mm_strdup("share row exclusive");
   10216             : }
   10217             : |  EXCLUSIVE
   10218             :  { 
   10219           0 :  $$ = mm_strdup("exclusive");
   10220             : }
   10221             : |  ACCESS EXCLUSIVE
   10222             :  { 
   10223           0 :  $$ = mm_strdup("access exclusive");
   10224             : }
   10225             : ;
   10226             : 
   10227             : 
   10228             :  opt_nowait:
   10229             :  NOWAIT
   10230             :  { 
   10231           0 :  $$ = mm_strdup("nowait");
   10232             : }
   10233             : | 
   10234             :  { 
   10235           0 :  $$=EMPTY; }
   10236             : ;
   10237             : 
   10238             : 
   10239             :  opt_nowait_or_skip:
   10240             :  NOWAIT
   10241             :  { 
   10242           0 :  $$ = mm_strdup("nowait");
   10243             : }
   10244             : |  SKIP LOCKED
   10245             :  { 
   10246           0 :  $$ = mm_strdup("skip locked");
   10247             : }
   10248             : | 
   10249             :  { 
   10250           0 :  $$=EMPTY; }
   10251             : ;
   10252             : 
   10253             : 
   10254             :  UpdateStmt:
   10255             :  opt_with_clause UPDATE relation_expr_opt_alias SET set_clause_list from_clause where_or_current_clause returning_clause
   10256             :  { 
   10257          10 :  $$ = cat_str(8,$1,mm_strdup("update"),$3,mm_strdup("set"),$5,$6,$7,$8);
   10258             : }
   10259             : ;
   10260             : 
   10261             : 
   10262             :  set_clause_list:
   10263             :  set_clause
   10264             :  { 
   10265          10 :  $$ = $1;
   10266             : }
   10267             : |  set_clause_list ',' set_clause
   10268             :  { 
   10269           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   10270             : }
   10271             : ;
   10272             : 
   10273             : 
   10274             :  set_clause:
   10275             :  set_target '=' a_expr
   10276             :  { 
   10277           8 :  $$ = cat_str(3,$1,mm_strdup("="),$3);
   10278             : }
   10279             : |  '(' set_target_list ')' '=' a_expr
   10280             :  { 
   10281           2 :  $$ = cat_str(4,mm_strdup("("),$2,mm_strdup(") ="),$5);
   10282             : }
   10283             : ;
   10284             : 
   10285             : 
   10286             :  set_target:
   10287             :  ColId opt_indirection
   10288             :  { 
   10289          12 :  $$ = cat_str(2,$1,$2);
   10290             : }
   10291             : ;
   10292             : 
   10293             : 
   10294             :  set_target_list:
   10295             :  set_target
   10296             :  { 
   10297           2 :  $$ = $1;
   10298             : }
   10299             : |  set_target_list ',' set_target
   10300             :  { 
   10301           2 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   10302             : }
   10303             : ;
   10304             : 
   10305             : 
   10306             :  MergeStmt:
   10307             :  opt_with_clause MERGE INTO relation_expr_opt_alias USING table_ref ON a_expr merge_when_list returning_clause
   10308             :  { 
   10309           0 :  $$ = cat_str(9,$1,mm_strdup("merge into"),$4,mm_strdup("using"),$6,mm_strdup("on"),$8,$9,$10);
   10310             : }
   10311             : ;
   10312             : 
   10313             : 
   10314             :  merge_when_list:
   10315             :  merge_when_clause
   10316             :  { 
   10317           0 :  $$ = $1;
   10318             : }
   10319             : |  merge_when_list merge_when_clause
   10320             :  { 
   10321           0 :  $$ = cat_str(2,$1,$2);
   10322             : }
   10323             : ;
   10324             : 
   10325             : 
   10326             :  merge_when_clause:
   10327             :  WHEN MATCHED opt_merge_when_condition THEN merge_update
   10328             :  { 
   10329           0 :  $$ = cat_str(4,mm_strdup("when matched"),$3,mm_strdup("then"),$5);
   10330             : }
   10331             : |  WHEN MATCHED opt_merge_when_condition THEN merge_delete
   10332             :  { 
   10333           0 :  $$ = cat_str(4,mm_strdup("when matched"),$3,mm_strdup("then"),$5);
   10334             : }
   10335             : |  WHEN NOT MATCHED opt_merge_when_condition THEN merge_insert
   10336             :  { 
   10337           0 :  $$ = cat_str(4,mm_strdup("when not matched"),$4,mm_strdup("then"),$6);
   10338             : }
   10339             : |  WHEN MATCHED opt_merge_when_condition THEN DO NOTHING
   10340             :  { 
   10341           0 :  $$ = cat_str(3,mm_strdup("when matched"),$3,mm_strdup("then do nothing"));
   10342             : }
   10343             : |  WHEN NOT MATCHED opt_merge_when_condition THEN DO NOTHING
   10344             :  { 
   10345           0 :  $$ = cat_str(3,mm_strdup("when not matched"),$4,mm_strdup("then do nothing"));
   10346             : }
   10347             : ;
   10348             : 
   10349             : 
   10350             :  opt_merge_when_condition:
   10351             :  AND a_expr
   10352             :  { 
   10353           0 :  $$ = cat_str(2,mm_strdup("and"),$2);
   10354             : }
   10355             : | 
   10356             :  { 
   10357           0 :  $$=EMPTY; }
   10358             : ;
   10359             : 
   10360             : 
   10361             :  merge_update:
   10362             :  UPDATE SET set_clause_list
   10363             :  { 
   10364           0 :  $$ = cat_str(2,mm_strdup("update set"),$3);
   10365             : }
   10366             : ;
   10367             : 
   10368             : 
   10369             :  merge_delete:
   10370             :  DELETE_P
   10371             :  { 
   10372           0 :  $$ = mm_strdup("delete");
   10373             : }
   10374             : ;
   10375             : 
   10376             : 
   10377             :  merge_insert:
   10378             :  INSERT merge_values_clause
   10379             :  { 
   10380           0 :  $$ = cat_str(2,mm_strdup("insert"),$2);
   10381             : }
   10382             : |  INSERT OVERRIDING override_kind VALUE_P merge_values_clause
   10383             :  { 
   10384           0 :  $$ = cat_str(4,mm_strdup("insert overriding"),$3,mm_strdup("value"),$5);
   10385             : }
   10386             : |  INSERT '(' insert_column_list ')' merge_values_clause
   10387             :  { 
   10388           0 :  $$ = cat_str(4,mm_strdup("insert ("),$3,mm_strdup(")"),$5);
   10389             : }
   10390             : |  INSERT '(' insert_column_list ')' OVERRIDING override_kind VALUE_P merge_values_clause
   10391             :  { 
   10392           0 :  $$ = cat_str(6,mm_strdup("insert ("),$3,mm_strdup(") overriding"),$6,mm_strdup("value"),$8);
   10393             : }
   10394             : |  INSERT DEFAULT VALUES
   10395             :  { 
   10396           0 :  $$ = mm_strdup("insert default values");
   10397             : }
   10398             : ;
   10399             : 
   10400             : 
   10401             :  merge_values_clause:
   10402             :  VALUES '(' expr_list ')'
   10403             :  { 
   10404           0 :  $$ = cat_str(3,mm_strdup("values ("),$3,mm_strdup(")"));
   10405             : }
   10406             : ;
   10407             : 
   10408             : 
   10409             :  DeclareCursorStmt:
   10410             :  DECLARE cursor_name cursor_options CURSOR opt_hold FOR SelectStmt
   10411             :     {
   10412             :         struct cursor *ptr, *this;
   10413          34 :         char *cursor_marker = $2[0] == ':' ? mm_strdup("$0") : mm_strdup($2);
   10414             :         char *comment, *c1, *c2;
   10415          34 :         int (* strcmp_fn)(const char *, const char *) = (($2[0] == ':' || $2[0] == '"') ? strcmp : pg_strcasecmp);
   10416             : 
   10417          34 :                 if (INFORMIX_MODE && pg_strcasecmp($2, "database") == 0)
   10418           0 :                         mmfatal(PARSE_ERROR, "\"database\" cannot be used as cursor name in INFORMIX mode");
   10419             : 
   10420          46 :         for (ptr = cur; ptr != NULL; ptr = ptr->next)
   10421             :         {
   10422          12 :             if (strcmp_fn($2, ptr->name) == 0)
   10423             :             {
   10424           0 :                 if ($2[0] == ':')
   10425           0 :                     mmerror(PARSE_ERROR, ET_ERROR, "using variable \"%s\" in different declare statements is not supported", $2+1);
   10426             :                 else
   10427           0 :                     mmerror(PARSE_ERROR, ET_ERROR, "cursor \"%s\" is already defined", $2);
   10428             :             }
   10429             :         }
   10430             : 
   10431          34 :         this = (struct cursor *) mm_alloc(sizeof(struct cursor));
   10432             : 
   10433          34 :         this->next = cur;
   10434          34 :         this->name = $2;
   10435          34 :         this->function = (current_function ? mm_strdup(current_function) : NULL);
   10436          34 :         this->connection = connection ? mm_strdup(connection) : NULL;
   10437          34 :         this->opened = false;
   10438          34 :         this->command =  cat_str(7, mm_strdup("declare"), cursor_marker, $3, mm_strdup("cursor"), $5, mm_strdup("for"), $7);
   10439          34 :         this->argsinsert = argsinsert;
   10440          34 :         this->argsinsert_oos = NULL;
   10441          34 :         this->argsresult = argsresult;
   10442          34 :         this->argsresult_oos = NULL;
   10443          34 :         argsinsert = argsresult = NULL;
   10444          34 :         cur = this;
   10445             : 
   10446          34 :         c1 = mm_strdup(this->command);
   10447          34 :         if ((c2 = strstr(c1, "*/")) != NULL)
   10448             :         {
   10449             :             /* We put this text into a comment, so we better remove [*][/]. */
   10450           0 :             c2[0] = '.';
   10451           0 :             c2[1] = '.';
   10452             :         }
   10453          34 :         comment = cat_str(3, mm_strdup("/*"), c1, mm_strdup("*/"));
   10454             : 
   10455          34 :         $$ = cat2_str(adjust_outofscope_cursor_vars(this), comment);
   10456             :     }
   10457             : ;
   10458             : 
   10459             : 
   10460             :  cursor_name:
   10461             :  name
   10462             :  { 
   10463         268 :  $$ = $1;
   10464             : }
   10465             :     | char_civar
   10466             :         {
   10467          86 :             char *curname = mm_alloc(strlen($1) + 2);
   10468          86 :             sprintf(curname, ":%s", $1);
   10469          86 :             free($1);
   10470          86 :             $1 = curname;
   10471          86 :             $$ = $1;
   10472             :         }
   10473             : ;
   10474             : 
   10475             : 
   10476             :  cursor_options:
   10477             : 
   10478             :  { 
   10479          74 :  $$=EMPTY; }
   10480             : |  cursor_options NO SCROLL
   10481             :  { 
   10482           0 :  $$ = cat_str(2,$1,mm_strdup("no scroll"));
   10483             : }
   10484             : |  cursor_options SCROLL
   10485             :  { 
   10486           0 :  $$ = cat_str(2,$1,mm_strdup("scroll"));
   10487             : }
   10488             : |  cursor_options BINARY
   10489             :  { 
   10490           4 :  $$ = cat_str(2,$1,mm_strdup("binary"));
   10491             : }
   10492             : |  cursor_options ASENSITIVE
   10493             :  { 
   10494           0 :  $$ = cat_str(2,$1,mm_strdup("asensitive"));
   10495             : }
   10496             : |  cursor_options INSENSITIVE
   10497             :  { 
   10498           0 :  $$ = cat_str(2,$1,mm_strdup("insensitive"));
   10499             : }
   10500             : ;
   10501             : 
   10502             : 
   10503             :  opt_hold:
   10504             : 
   10505             :     {
   10506          74 :         if (compat == ECPG_COMPAT_INFORMIX_SE && autocommit)
   10507           0 :             $$ = mm_strdup("with hold");
   10508             :         else
   10509          74 :             $$ = EMPTY;
   10510             :     }
   10511             : |  WITH HOLD
   10512             :  { 
   10513           0 :  $$ = mm_strdup("with hold");
   10514             : }
   10515             : |  WITHOUT HOLD
   10516             :  { 
   10517           0 :  $$ = mm_strdup("without hold");
   10518             : }
   10519             : ;
   10520             : 
   10521             : 
   10522             :  SelectStmt:
   10523             :  select_no_parens %prec UMINUS
   10524             :  { 
   10525         466 :  $$ = $1;
   10526             : }
   10527             : |  select_with_parens %prec UMINUS
   10528             :  { 
   10529           2 :  $$ = $1;
   10530             : }
   10531             : ;
   10532             : 
   10533             : 
   10534             :  select_with_parens:
   10535             :  '(' select_no_parens ')'
   10536             :  { 
   10537           6 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
   10538             : }
   10539             : |  '(' select_with_parens ')'
   10540             :  { 
   10541           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
   10542             : }
   10543             : ;
   10544             : 
   10545             : 
   10546             :  select_no_parens:
   10547             :  simple_select
   10548             :  { 
   10549         434 :  $$ = $1;
   10550             : }
   10551             : |  select_clause sort_clause
   10552             :  { 
   10553          10 :  $$ = cat_str(2,$1,$2);
   10554             : }
   10555             : |  select_clause opt_sort_clause for_locking_clause opt_select_limit
   10556             :  { 
   10557           0 :  $$ = cat_str(4,$1,$2,$3,$4);
   10558             : }
   10559             : |  select_clause opt_sort_clause select_limit opt_for_locking_clause
   10560             :  { 
   10561          26 :  $$ = cat_str(4,$1,$2,$3,$4);
   10562             : }
   10563             : |  with_clause select_clause
   10564             :  { 
   10565           2 :  $$ = cat_str(2,$1,$2);
   10566             : }
   10567             : |  with_clause select_clause sort_clause
   10568             :  { 
   10569           0 :  $$ = cat_str(3,$1,$2,$3);
   10570             : }
   10571             : |  with_clause select_clause opt_sort_clause for_locking_clause opt_select_limit
   10572             :  { 
   10573           0 :  $$ = cat_str(5,$1,$2,$3,$4,$5);
   10574             : }
   10575             : |  with_clause select_clause opt_sort_clause select_limit opt_for_locking_clause
   10576             :  { 
   10577           0 :  $$ = cat_str(5,$1,$2,$3,$4,$5);
   10578             : }
   10579             : ;
   10580             : 
   10581             : 
   10582             :  select_clause:
   10583             :  simple_select
   10584             :  { 
   10585          38 :  $$ = $1;
   10586             : }
   10587             : |  select_with_parens
   10588             :  { 
   10589           0 :  $$ = $1;
   10590             : }
   10591             : ;
   10592             : 
   10593             : 
   10594             :  simple_select:
   10595             :  SELECT opt_all_clause opt_target_list into_clause from_clause where_clause group_clause having_clause window_clause
   10596             :  { 
   10597         238 :  $$ = cat_str(9,mm_strdup("select"),$2,$3,$4,$5,$6,$7,$8,$9);
   10598             : }
   10599             : |  SELECT distinct_clause target_list into_clause from_clause where_clause group_clause having_clause window_clause
   10600             :  { 
   10601           0 :  $$ = cat_str(9,mm_strdup("select"),$2,$3,$4,$5,$6,$7,$8,$9);
   10602             : }
   10603             : |  values_clause
   10604             :  { 
   10605         234 :  $$ = $1;
   10606             : }
   10607             : |  TABLE relation_expr
   10608             :  { 
   10609           0 :  $$ = cat_str(2,mm_strdup("table"),$2);
   10610             : }
   10611             : |  select_clause UNION set_quantifier select_clause
   10612             :  { 
   10613           0 :  $$ = cat_str(4,$1,mm_strdup("union"),$3,$4);
   10614             : }
   10615             : |  select_clause INTERSECT set_quantifier select_clause
   10616             :  { 
   10617           0 :  $$ = cat_str(4,$1,mm_strdup("intersect"),$3,$4);
   10618             : }
   10619             : |  select_clause EXCEPT set_quantifier select_clause
   10620             :  { 
   10621           0 :  $$ = cat_str(4,$1,mm_strdup("except"),$3,$4);
   10622             : }
   10623             : ;
   10624             : 
   10625             : 
   10626             :  with_clause:
   10627             :  WITH cte_list
   10628             :  { 
   10629           2 :  $$ = cat_str(2,mm_strdup("with"),$2);
   10630             : }
   10631             : |  WITH_LA cte_list
   10632             :  { 
   10633           0 :  $$ = cat_str(2,mm_strdup("with"),$2);
   10634             : }
   10635             : |  WITH RECURSIVE cte_list
   10636             :  { 
   10637           0 :  $$ = cat_str(2,mm_strdup("with recursive"),$3);
   10638             : }
   10639             : ;
   10640             : 
   10641             : 
   10642             :  cte_list:
   10643             :  common_table_expr
   10644             :  { 
   10645           2 :  $$ = $1;
   10646             : }
   10647             : |  cte_list ',' common_table_expr
   10648             :  { 
   10649           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   10650             : }
   10651             : ;
   10652             : 
   10653             : 
   10654             :  common_table_expr:
   10655             :  name opt_name_list AS opt_materialized '(' PreparableStmt ')' opt_search_clause opt_cycle_clause
   10656             :  { 
   10657           2 :  $$ = cat_str(9,$1,$2,mm_strdup("as"),$4,mm_strdup("("),$6,mm_strdup(")"),$8,$9);
   10658             : }
   10659             : ;
   10660             : 
   10661             : 
   10662             :  opt_materialized:
   10663             :  MATERIALIZED
   10664             :  { 
   10665           0 :  $$ = mm_strdup("materialized");
   10666             : }
   10667             : |  NOT MATERIALIZED
   10668             :  { 
   10669           0 :  $$ = mm_strdup("not materialized");
   10670             : }
   10671             : | 
   10672             :  { 
   10673           2 :  $$=EMPTY; }
   10674             : ;
   10675             : 
   10676             : 
   10677             :  opt_search_clause:
   10678             :  SEARCH DEPTH FIRST_P BY columnList SET ColId
   10679             :  { 
   10680           0 :  $$ = cat_str(4,mm_strdup("search depth first by"),$5,mm_strdup("set"),$7);
   10681             : }
   10682             : |  SEARCH BREADTH FIRST_P BY columnList SET ColId
   10683             :  { 
   10684           0 :  $$ = cat_str(4,mm_strdup("search breadth first by"),$5,mm_strdup("set"),$7);
   10685             : }
   10686             : | 
   10687             :  { 
   10688           2 :  $$=EMPTY; }
   10689             : ;
   10690             : 
   10691             : 
   10692             :  opt_cycle_clause:
   10693             :  CYCLE columnList SET ColId TO AexprConst DEFAULT AexprConst USING ColId
   10694             :  { 
   10695           0 :  $$ = cat_str(10,mm_strdup("cycle"),$2,mm_strdup("set"),$4,mm_strdup("to"),$6,mm_strdup("default"),$8,mm_strdup("using"),$10);
   10696             : }
   10697             : |  CYCLE columnList SET ColId USING ColId
   10698             :  { 
   10699           0 :  $$ = cat_str(6,mm_strdup("cycle"),$2,mm_strdup("set"),$4,mm_strdup("using"),$6);
   10700             : }
   10701             : | 
   10702             :  { 
   10703           2 :  $$=EMPTY; }
   10704             : ;
   10705             : 
   10706             : 
   10707             :  opt_with_clause:
   10708             :  with_clause
   10709             :  { 
   10710           0 :  $$ = $1;
   10711             : }
   10712             : | 
   10713             :  { 
   10714         250 :  $$=EMPTY; }
   10715             : ;
   10716             : 
   10717             : 
   10718             :  into_clause:
   10719             :  INTO OptTempTableName
   10720             :                     {
   10721           2 :                         FoundInto = 1;
   10722           2 :                         $$= cat2_str(mm_strdup("into"), $2);
   10723             :                     }
   10724         172 :     | ecpg_into { $$ = EMPTY; }
   10725             : | 
   10726             :  { 
   10727          64 :  $$=EMPTY; }
   10728             : ;
   10729             : 
   10730             : 
   10731             :  OptTempTableName:
   10732             :  TEMPORARY opt_table qualified_name
   10733             :  { 
   10734           0 :  $$ = cat_str(3,mm_strdup("temporary"),$2,$3);
   10735             : }
   10736             : |  TEMP opt_table qualified_name
   10737             :  { 
   10738           0 :  $$ = cat_str(3,mm_strdup("temp"),$2,$3);
   10739             : }
   10740             : |  LOCAL TEMPORARY opt_table qualified_name
   10741             :  { 
   10742           0 :  $$ = cat_str(3,mm_strdup("local temporary"),$3,$4);
   10743             : }
   10744             : |  LOCAL TEMP opt_table qualified_name
   10745             :  { 
   10746           0 :  $$ = cat_str(3,mm_strdup("local temp"),$3,$4);
   10747             : }
   10748             : |  GLOBAL TEMPORARY opt_table qualified_name
   10749             :  { 
   10750           0 :  $$ = cat_str(3,mm_strdup("global temporary"),$3,$4);
   10751             : }
   10752             : |  GLOBAL TEMP opt_table qualified_name
   10753             :  { 
   10754           0 :  $$ = cat_str(3,mm_strdup("global temp"),$3,$4);
   10755             : }
   10756             : |  UNLOGGED opt_table qualified_name
   10757             :  { 
   10758           0 :  $$ = cat_str(3,mm_strdup("unlogged"),$2,$3);
   10759             : }
   10760             : |  TABLE qualified_name
   10761             :  { 
   10762           0 :  $$ = cat_str(2,mm_strdup("table"),$2);
   10763             : }
   10764             : |  qualified_name
   10765             :  { 
   10766           2 :  $$ = $1;
   10767             : }
   10768             : ;
   10769             : 
   10770             : 
   10771             :  opt_table:
   10772             :  TABLE
   10773             :  { 
   10774           0 :  $$ = mm_strdup("table");
   10775             : }
   10776             : | 
   10777             :  { 
   10778          44 :  $$=EMPTY; }
   10779             : ;
   10780             : 
   10781             : 
   10782             :  set_quantifier:
   10783             :  ALL
   10784             :  { 
   10785           0 :  $$ = mm_strdup("all");
   10786             : }
   10787             : |  DISTINCT
   10788             :  { 
   10789           0 :  $$ = mm_strdup("distinct");
   10790             : }
   10791             : | 
   10792             :  { 
   10793           0 :  $$=EMPTY; }
   10794             : ;
   10795             : 
   10796             : 
   10797             :  distinct_clause:
   10798             :  DISTINCT
   10799             :  { 
   10800           0 :  $$ = mm_strdup("distinct");
   10801             : }
   10802             : |  DISTINCT ON '(' expr_list ')'
   10803             :  { 
   10804           0 :  $$ = cat_str(3,mm_strdup("distinct on ("),$4,mm_strdup(")"));
   10805             : }
   10806             : ;
   10807             : 
   10808             : 
   10809             :  opt_all_clause:
   10810             :  ALL
   10811             :  { 
   10812           0 :  $$ = mm_strdup("all");
   10813             : }
   10814             : | 
   10815             :  { 
   10816         238 :  $$=EMPTY; }
   10817             : ;
   10818             : 
   10819             : 
   10820             :  opt_sort_clause:
   10821             :  sort_clause
   10822             :  { 
   10823           2 :  $$ = $1;
   10824             : }
   10825             : | 
   10826             :  { 
   10827          30 :  $$=EMPTY; }
   10828             : ;
   10829             : 
   10830             : 
   10831             :  sort_clause:
   10832             :  ORDER BY sortby_list
   10833             :  { 
   10834          12 :  $$ = cat_str(2,mm_strdup("order by"),$3);
   10835             : }
   10836             : ;
   10837             : 
   10838             : 
   10839             :  sortby_list:
   10840             :  sortby
   10841             :  { 
   10842          12 :  $$ = $1;
   10843             : }
   10844             : |  sortby_list ',' sortby
   10845             :  { 
   10846           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   10847             : }
   10848             : ;
   10849             : 
   10850             : 
   10851             :  sortby:
   10852             :  a_expr USING qual_all_Op opt_nulls_order
   10853             :  { 
   10854           0 :  $$ = cat_str(4,$1,mm_strdup("using"),$3,$4);
   10855             : }
   10856             : |  a_expr opt_asc_desc opt_nulls_order
   10857             :  { 
   10858          12 :  $$ = cat_str(3,$1,$2,$3);
   10859             : }
   10860             : ;
   10861             : 
   10862             : 
   10863             :  select_limit:
   10864             :  limit_clause offset_clause
   10865             :  { 
   10866           0 :  $$ = cat_str(2,$1,$2);
   10867             : }
   10868             : |  offset_clause limit_clause
   10869             :  { 
   10870           0 :  $$ = cat_str(2,$1,$2);
   10871             : }
   10872             : |  limit_clause
   10873             :  { 
   10874          26 :  $$ = $1;
   10875             : }
   10876             : |  offset_clause
   10877             :  { 
   10878           0 :  $$ = $1;
   10879             : }
   10880             : ;
   10881             : 
   10882             : 
   10883             :  opt_select_limit:
   10884             :  select_limit
   10885             :  { 
   10886           0 :  $$ = $1;
   10887             : }
   10888             : | 
   10889             :  { 
   10890           0 :  $$=EMPTY; }
   10891             : ;
   10892             : 
   10893             : 
   10894             :  limit_clause:
   10895             :  LIMIT select_limit_value
   10896             :  { 
   10897          26 :  $$ = cat_str(2,mm_strdup("limit"),$2);
   10898             : }
   10899             : |  LIMIT select_limit_value ',' select_offset_value
   10900             :     {
   10901           0 :         mmerror(PARSE_ERROR, ET_WARNING, "no longer supported LIMIT #,# syntax passed to server");
   10902           0 :         $$ = cat_str(4, mm_strdup("limit"), $2, mm_strdup(","), $4);
   10903             :     }
   10904             : |  FETCH first_or_next select_fetch_first_value row_or_rows ONLY
   10905             :  { 
   10906           0 :  $$ = cat_str(5,mm_strdup("fetch"),$2,$3,$4,mm_strdup("only"));
   10907             : }
   10908             : |  FETCH first_or_next select_fetch_first_value row_or_rows WITH TIES
   10909             :  { 
   10910           0 :  $$ = cat_str(5,mm_strdup("fetch"),$2,$3,$4,mm_strdup("with ties"));
   10911             : }
   10912             : |  FETCH first_or_next row_or_rows ONLY
   10913             :  { 
   10914           0 :  $$ = cat_str(4,mm_strdup("fetch"),$2,$3,mm_strdup("only"));
   10915             : }
   10916             : |  FETCH first_or_next row_or_rows WITH TIES
   10917             :  { 
   10918           0 :  $$ = cat_str(4,mm_strdup("fetch"),$2,$3,mm_strdup("with ties"));
   10919             : }
   10920             : ;
   10921             : 
   10922             : 
   10923             :  offset_clause:
   10924             :  OFFSET select_offset_value
   10925             :  { 
   10926           0 :  $$ = cat_str(2,mm_strdup("offset"),$2);
   10927             : }
   10928             : |  OFFSET select_fetch_first_value row_or_rows
   10929             :  { 
   10930           0 :  $$ = cat_str(3,mm_strdup("offset"),$2,$3);
   10931             : }
   10932             : ;
   10933             : 
   10934             : 
   10935             :  select_limit_value:
   10936             :  a_expr
   10937             :  { 
   10938          26 :  $$ = $1;
   10939             : }
   10940             : |  ALL
   10941             :  { 
   10942           0 :  $$ = mm_strdup("all");
   10943             : }
   10944             : ;
   10945             : 
   10946             : 
   10947             :  select_offset_value:
   10948             :  a_expr
   10949             :  { 
   10950           0 :  $$ = $1;
   10951             : }
   10952             : ;
   10953             : 
   10954             : 
   10955             :  select_fetch_first_value:
   10956             :  c_expr
   10957             :  { 
   10958           0 :  $$ = $1;
   10959             : }
   10960             : |  '+' I_or_F_const
   10961             :  { 
   10962           0 :  $$ = cat_str(2,mm_strdup("+"),$2);
   10963             : }
   10964             : |  '-' I_or_F_const
   10965             :  { 
   10966           0 :  $$ = cat_str(2,mm_strdup("-"),$2);
   10967             : }
   10968             : ;
   10969             : 
   10970             : 
   10971             :  I_or_F_const:
   10972             :  Iconst
   10973             :  { 
   10974           0 :  $$ = $1;
   10975             : }
   10976             : |  ecpg_fconst
   10977             :  { 
   10978           0 :  $$ = $1;
   10979             : }
   10980             : ;
   10981             : 
   10982             : 
   10983             :  row_or_rows:
   10984             :  ROW
   10985             :  { 
   10986           0 :  $$ = mm_strdup("row");
   10987             : }
   10988             : |  ROWS
   10989             :  { 
   10990           0 :  $$ = mm_strdup("rows");
   10991             : }
   10992             : ;
   10993             : 
   10994             : 
   10995             :  first_or_next:
   10996             :  FIRST_P
   10997             :  { 
   10998           0 :  $$ = mm_strdup("first");
   10999             : }
   11000             : |  NEXT
   11001             :  { 
   11002           0 :  $$ = mm_strdup("next");
   11003             : }
   11004             : ;
   11005             : 
   11006             : 
   11007             :  group_clause:
   11008             :  GROUP_P BY set_quantifier group_by_list
   11009             :  { 
   11010           0 :  $$ = cat_str(3,mm_strdup("group by"),$3,$4);
   11011             : }
   11012             : | 
   11013             :  { 
   11014         238 :  $$=EMPTY; }
   11015             : ;
   11016             : 
   11017             : 
   11018             :  group_by_list:
   11019             :  group_by_item
   11020             :  { 
   11021           0 :  $$ = $1;
   11022             : }
   11023             : |  group_by_list ',' group_by_item
   11024             :  { 
   11025           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   11026             : }
   11027             : ;
   11028             : 
   11029             : 
   11030             :  group_by_item:
   11031             :  a_expr
   11032             :  { 
   11033           0 :  $$ = $1;
   11034             : }
   11035             : |  empty_grouping_set
   11036             :  { 
   11037           0 :  $$ = $1;
   11038             : }
   11039             : |  cube_clause
   11040             :  { 
   11041           0 :  $$ = $1;
   11042             : }
   11043             : |  rollup_clause
   11044             :  { 
   11045           0 :  $$ = $1;
   11046             : }
   11047             : |  grouping_sets_clause
   11048             :  { 
   11049           0 :  $$ = $1;
   11050             : }
   11051             : ;
   11052             : 
   11053             : 
   11054             :  empty_grouping_set:
   11055             :  '(' ')'
   11056             :  { 
   11057           0 :  $$ = mm_strdup("( )");
   11058             : }
   11059             : ;
   11060             : 
   11061             : 
   11062             :  rollup_clause:
   11063             :  ROLLUP '(' expr_list ')'
   11064             :  { 
   11065           0 :  $$ = cat_str(3,mm_strdup("rollup ("),$3,mm_strdup(")"));
   11066             : }
   11067             : ;
   11068             : 
   11069             : 
   11070             :  cube_clause:
   11071             :  CUBE '(' expr_list ')'
   11072             :  { 
   11073           0 :  $$ = cat_str(3,mm_strdup("cube ("),$3,mm_strdup(")"));
   11074             : }
   11075             : ;
   11076             : 
   11077             : 
   11078             :  grouping_sets_clause:
   11079             :  GROUPING SETS '(' group_by_list ')'
   11080             :  { 
   11081           0 :  $$ = cat_str(3,mm_strdup("grouping sets ("),$4,mm_strdup(")"));
   11082             : }
   11083             : ;
   11084             : 
   11085             : 
   11086             :  having_clause:
   11087             :  HAVING a_expr
   11088             :  { 
   11089           0 :  $$ = cat_str(2,mm_strdup("having"),$2);
   11090             : }
   11091             : | 
   11092             :  { 
   11093         238 :  $$=EMPTY; }
   11094             : ;
   11095             : 
   11096             : 
   11097             :  for_locking_clause:
   11098             :  for_locking_items
   11099             :  { 
   11100           0 :  $$ = $1;
   11101             : }
   11102             : |  FOR READ ONLY
   11103             :  { 
   11104           0 :  $$ = mm_strdup("for read only");
   11105             : }
   11106             : ;
   11107             : 
   11108             : 
   11109             :  opt_for_locking_clause:
   11110             :  for_locking_clause
   11111             :  { 
   11112           0 :  $$ = $1;
   11113             : }
   11114             : | 
   11115             :  { 
   11116          26 :  $$=EMPTY; }
   11117             : ;
   11118             : 
   11119             : 
   11120             :  for_locking_items:
   11121             :  for_locking_item
   11122             :  { 
   11123           0 :  $$ = $1;
   11124             : }
   11125             : |  for_locking_items for_locking_item
   11126             :  { 
   11127           0 :  $$ = cat_str(2,$1,$2);
   11128             : }
   11129             : ;
   11130             : 
   11131             : 
   11132             :  for_locking_item:
   11133             :  for_locking_strength locked_rels_list opt_nowait_or_skip
   11134             :  { 
   11135           0 :  $$ = cat_str(3,$1,$2,$3);
   11136             : }
   11137             : ;
   11138             : 
   11139             : 
   11140             :  for_locking_strength:
   11141             :  FOR UPDATE
   11142             :  { 
   11143           0 :  $$ = mm_strdup("for update");
   11144             : }
   11145             : |  FOR NO KEY UPDATE
   11146             :  { 
   11147           0 :  $$ = mm_strdup("for no key update");
   11148             : }
   11149             : |  FOR SHARE
   11150             :  { 
   11151           0 :  $$ = mm_strdup("for share");
   11152             : }
   11153             : |  FOR KEY SHARE
   11154             :  { 
   11155           0 :  $$ = mm_strdup("for key share");
   11156             : }
   11157             : ;
   11158             : 
   11159             : 
   11160             :  locked_rels_list:
   11161             :  OF qualified_name_list
   11162             :  { 
   11163           0 :  $$ = cat_str(2,mm_strdup("of"),$2);
   11164             : }
   11165             : | 
   11166             :  { 
   11167           0 :  $$=EMPTY; }
   11168             : ;
   11169             : 
   11170             : 
   11171             :  values_clause:
   11172             :  VALUES '(' expr_list ')'
   11173             :  { 
   11174         234 :  $$ = cat_str(3,mm_strdup("values ("),$3,mm_strdup(")"));
   11175             : }
   11176             : |  values_clause ',' '(' expr_list ')'
   11177             :  { 
   11178          16 :  $$ = cat_str(4,$1,mm_strdup(", ("),$4,mm_strdup(")"));
   11179             : }
   11180             : ;
   11181             : 
   11182             : 
   11183             :  from_clause:
   11184             :  FROM from_list
   11185             :  { 
   11186         150 :  $$ = cat_str(2,mm_strdup("from"),$2);
   11187             : }
   11188             : | 
   11189             :  { 
   11190          98 :  $$=EMPTY; }
   11191             : ;
   11192             : 
   11193             : 
   11194             :  from_list:
   11195             :  table_ref
   11196             :  { 
   11197         150 :  $$ = $1;
   11198             : }
   11199             : |  from_list ',' table_ref
   11200             :  { 
   11201           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   11202             : }
   11203             : ;
   11204             : 
   11205             : 
   11206             :  table_ref:
   11207             :  relation_expr opt_alias_clause
   11208             :  { 
   11209         148 :  $$ = cat_str(2,$1,$2);
   11210             : }
   11211             : |  relation_expr opt_alias_clause tablesample_clause
   11212             :  { 
   11213           0 :  $$ = cat_str(3,$1,$2,$3);
   11214             : }
   11215             : |  func_table func_alias_clause
   11216             :  { 
   11217           2 :  $$ = cat_str(2,$1,$2);
   11218             : }
   11219             : |  LATERAL_P func_table func_alias_clause
   11220             :  { 
   11221           0 :  $$ = cat_str(3,mm_strdup("lateral"),$2,$3);
   11222             : }
   11223             : |  xmltable opt_alias_clause
   11224             :  { 
   11225           0 :  $$ = cat_str(2,$1,$2);
   11226             : }
   11227             : |  LATERAL_P xmltable opt_alias_clause
   11228             :  { 
   11229           0 :  $$ = cat_str(3,mm_strdup("lateral"),$2,$3);
   11230             : }
   11231             : |  select_with_parens opt_alias_clause
   11232             :  { 
   11233           0 :  $$ = cat_str(2,$1,$2);
   11234             : }
   11235             : |  LATERAL_P select_with_parens opt_alias_clause
   11236             :  { 
   11237           0 :  $$ = cat_str(3,mm_strdup("lateral"),$2,$3);
   11238             : }
   11239             : |  joined_table
   11240             :  { 
   11241           0 :  $$ = $1;
   11242             : }
   11243             : |  '(' joined_table ')' alias_clause
   11244             :  { 
   11245           0 :  $$ = cat_str(4,mm_strdup("("),$2,mm_strdup(")"),$4);
   11246             : }
   11247             : ;
   11248             : 
   11249             : 
   11250             :  joined_table:
   11251             :  '(' joined_table ')'
   11252             :  { 
   11253           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
   11254             : }
   11255             : |  table_ref CROSS JOIN table_ref
   11256             :  { 
   11257           0 :  $$ = cat_str(3,$1,mm_strdup("cross join"),$4);
   11258             : }
   11259             : |  table_ref join_type JOIN table_ref join_qual
   11260             :  { 
   11261           0 :  $$ = cat_str(5,$1,$2,mm_strdup("join"),$4,$5);
   11262             : }
   11263             : |  table_ref JOIN table_ref join_qual
   11264             :  { 
   11265           0 :  $$ = cat_str(4,$1,mm_strdup("join"),$3,$4);
   11266             : }
   11267             : |  table_ref NATURAL join_type JOIN table_ref
   11268             :  { 
   11269           0 :  $$ = cat_str(5,$1,mm_strdup("natural"),$3,mm_strdup("join"),$5);
   11270             : }
   11271             : |  table_ref NATURAL JOIN table_ref
   11272             :  { 
   11273           0 :  $$ = cat_str(3,$1,mm_strdup("natural join"),$4);
   11274             : }
   11275             : ;
   11276             : 
   11277             : 
   11278             :  alias_clause:
   11279             :  AS ColId '(' name_list ')'
   11280             :  { 
   11281           2 :  $$ = cat_str(5,mm_strdup("as"),$2,mm_strdup("("),$4,mm_strdup(")"));
   11282             : }
   11283             : |  AS ColId
   11284             :  { 
   11285           0 :  $$ = cat_str(2,mm_strdup("as"),$2);
   11286             : }
   11287             : |  ColId '(' name_list ')'
   11288             :  { 
   11289           0 :  $$ = cat_str(4,$1,mm_strdup("("),$3,mm_strdup(")"));
   11290             : }
   11291             : |  ColId
   11292             :  { 
   11293           0 :  $$ = $1;
   11294             : }
   11295             : ;
   11296             : 
   11297             : 
   11298             :  opt_alias_clause:
   11299             :  alias_clause
   11300             :  { 
   11301           0 :  $$ = $1;
   11302             : }
   11303             : | 
   11304             :  { 
   11305         148 :  $$=EMPTY; }
   11306             : ;
   11307             : 
   11308             : 
   11309             :  opt_alias_clause_for_join_using:
   11310             :  AS ColId
   11311             :  { 
   11312           0 :  $$ = cat_str(2,mm_strdup("as"),$2);
   11313             : }
   11314             : | 
   11315             :  { 
   11316           0 :  $$=EMPTY; }
   11317             : ;
   11318             : 
   11319             : 
   11320             :  func_alias_clause:
   11321             :  alias_clause
   11322             :  { 
   11323           2 :  $$ = $1;
   11324             : }
   11325             : |  AS '(' TableFuncElementList ')'
   11326             :  { 
   11327           0 :  $$ = cat_str(3,mm_strdup("as ("),$3,mm_strdup(")"));
   11328             : }
   11329             : |  AS ColId '(' TableFuncElementList ')'
   11330             :  { 
   11331           0 :  $$ = cat_str(5,mm_strdup("as"),$2,mm_strdup("("),$4,mm_strdup(")"));
   11332             : }
   11333             : |  ColId '(' TableFuncElementList ')'
   11334             :  { 
   11335           0 :  $$ = cat_str(4,$1,mm_strdup("("),$3,mm_strdup(")"));
   11336             : }
   11337             : | 
   11338             :  { 
   11339           0 :  $$=EMPTY; }
   11340             : ;
   11341             : 
   11342             : 
   11343             :  join_type:
   11344             :  FULL opt_outer
   11345             :  { 
   11346           0 :  $$ = cat_str(2,mm_strdup("full"),$2);
   11347             : }
   11348             : |  LEFT opt_outer
   11349             :  { 
   11350           0 :  $$ = cat_str(2,mm_strdup("left"),$2);
   11351             : }
   11352             : |  RIGHT opt_outer
   11353             :  { 
   11354           0 :  $$ = cat_str(2,mm_strdup("right"),$2);
   11355             : }
   11356             : |  INNER_P
   11357             :  { 
   11358           0 :  $$ = mm_strdup("inner");
   11359             : }
   11360             : ;
   11361             : 
   11362             : 
   11363             :  opt_outer:
   11364             :  OUTER_P
   11365             :  { 
   11366           0 :  $$ = mm_strdup("outer");
   11367             : }
   11368             : | 
   11369             :  { 
   11370           0 :  $$=EMPTY; }
   11371             : ;
   11372             : 
   11373             : 
   11374             :  join_qual:
   11375             :  USING '(' name_list ')' opt_alias_clause_for_join_using
   11376             :  { 
   11377           0 :  $$ = cat_str(4,mm_strdup("using ("),$3,mm_strdup(")"),$5);
   11378             : }
   11379             : |  ON a_expr
   11380             :  { 
   11381           0 :  $$ = cat_str(2,mm_strdup("on"),$2);
   11382             : }
   11383             : ;
   11384             : 
   11385             : 
   11386             :  relation_expr:
   11387             :  qualified_name
   11388             :  { 
   11389         210 :  $$ = $1;
   11390             : }
   11391             : |  extended_relation_expr
   11392             :  { 
   11393           0 :  $$ = $1;
   11394             : }
   11395             : ;
   11396             : 
   11397             : 
   11398             :  extended_relation_expr:
   11399             :  qualified_name '*'
   11400             :  { 
   11401           0 :  $$ = cat_str(2,$1,mm_strdup("*"));
   11402             : }
   11403             : |  ONLY qualified_name
   11404             :  { 
   11405           0 :  $$ = cat_str(2,mm_strdup("only"),$2);
   11406             : }
   11407             : |  ONLY '(' qualified_name ')'
   11408             :  { 
   11409           0 :  $$ = cat_str(3,mm_strdup("only ("),$3,mm_strdup(")"));
   11410             : }
   11411             : ;
   11412             : 
   11413             : 
   11414             :  relation_expr_list:
   11415             :  relation_expr
   11416             :  { 
   11417          44 :  $$ = $1;
   11418             : }
   11419             : |  relation_expr_list ',' relation_expr
   11420             :  { 
   11421           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   11422             : }
   11423             : ;
   11424             : 
   11425             : 
   11426             :  relation_expr_opt_alias:
   11427             :  relation_expr %prec UMINUS
   11428             :  { 
   11429          14 :  $$ = $1;
   11430             : }
   11431             : |  relation_expr ColId
   11432             :  { 
   11433           0 :  $$ = cat_str(2,$1,$2);
   11434             : }
   11435             : |  relation_expr AS ColId
   11436             :  { 
   11437           0 :  $$ = cat_str(3,$1,mm_strdup("as"),$3);
   11438             : }
   11439             : ;
   11440             : 
   11441             : 
   11442             :  tablesample_clause:
   11443             :  TABLESAMPLE func_name '(' expr_list ')' opt_repeatable_clause
   11444             :  { 
   11445           0 :  $$ = cat_str(6,mm_strdup("tablesample"),$2,mm_strdup("("),$4,mm_strdup(")"),$6);
   11446             : }
   11447             : ;
   11448             : 
   11449             : 
   11450             :  opt_repeatable_clause:
   11451             :  REPEATABLE '(' a_expr ')'
   11452             :  { 
   11453           0 :  $$ = cat_str(3,mm_strdup("repeatable ("),$3,mm_strdup(")"));
   11454             : }
   11455             : | 
   11456             :  { 
   11457           0 :  $$=EMPTY; }
   11458             : ;
   11459             : 
   11460             : 
   11461             :  func_table:
   11462             :  func_expr_windowless opt_ordinality
   11463             :  { 
   11464           2 :  $$ = cat_str(2,$1,$2);
   11465             : }
   11466             : |  ROWS FROM '(' rowsfrom_list ')' opt_ordinality
   11467             :  { 
   11468           0 :  $$ = cat_str(4,mm_strdup("rows from ("),$4,mm_strdup(")"),$6);
   11469             : }
   11470             : ;
   11471             : 
   11472             : 
   11473             :  rowsfrom_item:
   11474             :  func_expr_windowless opt_col_def_list
   11475             :  { 
   11476           0 :  $$ = cat_str(2,$1,$2);
   11477             : }
   11478             : ;
   11479             : 
   11480             : 
   11481             :  rowsfrom_list:
   11482             :  rowsfrom_item
   11483             :  { 
   11484           0 :  $$ = $1;
   11485             : }
   11486             : |  rowsfrom_list ',' rowsfrom_item
   11487             :  { 
   11488           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   11489             : }
   11490             : ;
   11491             : 
   11492             : 
   11493             :  opt_col_def_list:
   11494             :  AS '(' TableFuncElementList ')'
   11495             :  { 
   11496           0 :  $$ = cat_str(3,mm_strdup("as ("),$3,mm_strdup(")"));
   11497             : }
   11498             : | 
   11499             :  { 
   11500           0 :  $$=EMPTY; }
   11501             : ;
   11502             : 
   11503             : 
   11504             :  opt_ordinality:
   11505             :  WITH_LA ORDINALITY
   11506             :  { 
   11507           2 :  $$ = mm_strdup("with ordinality");
   11508             : }
   11509             : | 
   11510             :  { 
   11511           0 :  $$=EMPTY; }
   11512             : ;
   11513             : 
   11514             : 
   11515             :  where_clause:
   11516             :  WHERE a_expr
   11517             :  { 
   11518          54 :  $$ = cat_str(2,mm_strdup("where"),$2);
   11519             : }
   11520             : | 
   11521             :  { 
   11522         186 :  $$=EMPTY; }
   11523             : ;
   11524             : 
   11525             : 
   11526             :  where_or_current_clause:
   11527             :  WHERE a_expr
   11528             :  { 
   11529          12 :  $$ = cat_str(2,mm_strdup("where"),$2);
   11530             : }
   11531             : |  WHERE CURRENT_P OF cursor_name
   11532             :     {
   11533           0 :         char *cursor_marker = $4[0] == ':' ? mm_strdup("$0") : $4;
   11534           0 :         $$ = cat_str(2,mm_strdup("where current of"), cursor_marker);
   11535             :     }
   11536             : | 
   11537             :  { 
   11538           2 :  $$=EMPTY; }
   11539             : ;
   11540             : 
   11541             : 
   11542             :  OptTableFuncElementList:
   11543             :  TableFuncElementList
   11544             :  { 
   11545           0 :  $$ = $1;
   11546             : }
   11547             : | 
   11548             :  { 
   11549           0 :  $$=EMPTY; }
   11550             : ;
   11551             : 
   11552             : 
   11553             :  TableFuncElementList:
   11554             :  TableFuncElement
   11555             :  { 
   11556           0 :  $$ = $1;
   11557             : }
   11558             : |  TableFuncElementList ',' TableFuncElement
   11559             :  { 
   11560           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   11561             : }
   11562             : ;
   11563             : 
   11564             : 
   11565             :  TableFuncElement:
   11566             :  ColId Typename opt_collate_clause
   11567             :  { 
   11568           0 :  $$ = cat_str(3,$1,$2,$3);
   11569             : }
   11570             : ;
   11571             : 
   11572             : 
   11573             :  xmltable:
   11574             :  XMLTABLE '(' c_expr xmlexists_argument COLUMNS xmltable_column_list ')'
   11575             :  { 
   11576           0 :  $$ = cat_str(6,mm_strdup("xmltable ("),$3,$4,mm_strdup("columns"),$6,mm_strdup(")"));
   11577             : }
   11578             : |  XMLTABLE '(' XMLNAMESPACES '(' xml_namespace_list ')' ',' c_expr xmlexists_argument COLUMNS xmltable_column_list ')'
   11579             :  { 
   11580           0 :  $$ = cat_str(8,mm_strdup("xmltable ( xmlnamespaces ("),$5,mm_strdup(") ,"),$8,$9,mm_strdup("columns"),$11,mm_strdup(")"));
   11581             : }
   11582             : ;
   11583             : 
   11584             : 
   11585             :  xmltable_column_list:
   11586             :  xmltable_column_el
   11587             :  { 
   11588           0 :  $$ = $1;
   11589             : }
   11590             : |  xmltable_column_list ',' xmltable_column_el
   11591             :  { 
   11592           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   11593             : }
   11594             : ;
   11595             : 
   11596             : 
   11597             :  xmltable_column_el:
   11598             :  ColId Typename
   11599             :  { 
   11600           0 :  $$ = cat_str(2,$1,$2);
   11601             : }
   11602             : |  ColId Typename xmltable_column_option_list
   11603             :  { 
   11604           0 :  $$ = cat_str(3,$1,$2,$3);
   11605             : }
   11606             : |  ColId FOR ORDINALITY
   11607             :  { 
   11608           0 :  $$ = cat_str(2,$1,mm_strdup("for ordinality"));
   11609             : }
   11610             : ;
   11611             : 
   11612             : 
   11613             :  xmltable_column_option_list:
   11614             :  xmltable_column_option_el
   11615             :  { 
   11616           0 :  $$ = $1;
   11617             : }
   11618             : |  xmltable_column_option_list xmltable_column_option_el
   11619             :  { 
   11620           0 :  $$ = cat_str(2,$1,$2);
   11621             : }
   11622             : ;
   11623             : 
   11624             : 
   11625             :  xmltable_column_option_el:
   11626             :  ecpg_ident b_expr
   11627             :  { 
   11628           0 :  $$ = cat_str(2,$1,$2);
   11629             : }
   11630             : |  DEFAULT b_expr
   11631             :  { 
   11632           0 :  $$ = cat_str(2,mm_strdup("default"),$2);
   11633             : }
   11634             : |  NOT NULL_P
   11635             :  { 
   11636           0 :  $$ = mm_strdup("not null");
   11637             : }
   11638             : |  NULL_P
   11639             :  { 
   11640           0 :  $$ = mm_strdup("null");
   11641             : }
   11642             : ;
   11643             : 
   11644             : 
   11645             :  xml_namespace_list:
   11646             :  xml_namespace_el
   11647             :  { 
   11648           0 :  $$ = $1;
   11649             : }
   11650             : |  xml_namespace_list ',' xml_namespace_el
   11651             :  { 
   11652           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   11653             : }
   11654             : ;
   11655             : 
   11656             : 
   11657             :  xml_namespace_el:
   11658             :  b_expr AS ColLabel
   11659             :  { 
   11660           0 :  $$ = cat_str(3,$1,mm_strdup("as"),$3);
   11661             : }
   11662             : |  DEFAULT b_expr
   11663             :  { 
   11664           0 :  $$ = cat_str(2,mm_strdup("default"),$2);
   11665             : }
   11666             : ;
   11667             : 
   11668             : 
   11669             :  Typename:
   11670             :  SimpleTypename opt_array_bounds
   11671         374 :     {   $$ = cat2_str($1, $2.str); }
   11672             : |  SETOF SimpleTypename opt_array_bounds
   11673           0 :     {   $$ = cat_str(3, mm_strdup("setof"), $2, $3.str); }
   11674             : |  SimpleTypename ARRAY '[' Iconst ']'
   11675             :  { 
   11676           0 :  $$ = cat_str(4,$1,mm_strdup("array ["),$4,mm_strdup("]"));
   11677             : }
   11678             : |  SETOF SimpleTypename ARRAY '[' Iconst ']'
   11679             :  { 
   11680           0 :  $$ = cat_str(5,mm_strdup("setof"),$2,mm_strdup("array ["),$5,mm_strdup("]"));
   11681             : }
   11682             : |  SimpleTypename ARRAY
   11683             :  { 
   11684           0 :  $$ = cat_str(2,$1,mm_strdup("array"));
   11685             : }
   11686             : |  SETOF SimpleTypename ARRAY
   11687             :  { 
   11688           0 :  $$ = cat_str(3,mm_strdup("setof"),$2,mm_strdup("array"));
   11689             : }
   11690             : ;
   11691             : 
   11692             : 
   11693             :  opt_array_bounds:
   11694             :  opt_array_bounds '[' ']'
   11695             :     {
   11696           6 :         $$.index1 = $1.index1;
   11697           6 :         $$.index2 = $1.index2;
   11698           6 :         if (strcmp($$.index1, "-1") == 0)
   11699           6 :             $$.index1 = mm_strdup("0");
   11700           0 :         else if (strcmp($1.index2, "-1") == 0)
   11701           0 :             $$.index2 = mm_strdup("0");
   11702           6 :         $$.str = cat_str(2, $1.str, mm_strdup("[]"));
   11703             :     }
   11704             :     | opt_array_bounds '[' Iresult ']'
   11705             :     {
   11706         246 :         $$.index1 = $1.index1;
   11707         246 :         $$.index2 = $1.index2;
   11708         246 :         if (strcmp($1.index1, "-1") == 0)
   11709         222 :             $$.index1 = mm_strdup($3);
   11710          24 :         else if (strcmp($1.index2, "-1") == 0)
   11711          24 :             $$.index2 = mm_strdup($3);
   11712         246 :         $$.str = cat_str(4, $1.str, mm_strdup("["), $3, mm_strdup("]"));
   11713             :     }
   11714             : | 
   11715             :     {
   11716        1120 :         $$.index1 = mm_strdup("-1");
   11717        1120 :         $$.index2 = mm_strdup("-1");
   11718        1120 :         $$.str= EMPTY;
   11719             :     }
   11720             : ;
   11721             : 
   11722             : 
   11723             :  SimpleTypename:
   11724             :  GenericType
   11725             :  { 
   11726         122 :  $$ = $1;
   11727             : }
   11728             : |  Numeric
   11729             :  { 
   11730         166 :  $$ = $1;
   11731             : }
   11732             : |  Bit
   11733             :  { 
   11734           0 :  $$ = $1;
   11735             : }
   11736             : |  Character
   11737             :  { 
   11738          66 :  $$ = $1;
   11739             : }
   11740             : |  ConstDatetime
   11741             :  { 
   11742          16 :  $$ = $1;
   11743             : }
   11744             : |  ConstInterval opt_interval
   11745             :  { 
   11746           2 :  $$ = cat_str(2,$1,$2);
   11747             : }
   11748             : |  ConstInterval '(' Iconst ')'
   11749             :  { 
   11750           0 :  $$ = cat_str(4,$1,mm_strdup("("),$3,mm_strdup(")"));
   11751             : }
   11752             : |  JsonType
   11753             :  { 
   11754           2 :  $$ = $1;
   11755             : }
   11756             : ;
   11757             : 
   11758             : 
   11759             :  ConstTypename:
   11760             :  Numeric
   11761             :  { 
   11762           0 :  $$ = $1;
   11763             : }
   11764             : |  ConstBit
   11765             :  { 
   11766           0 :  $$ = $1;
   11767             : }
   11768             : |  ConstCharacter
   11769             :  { 
   11770           0 :  $$ = $1;
   11771             : }
   11772             : |  ConstDatetime
   11773             :  { 
   11774           0 :  $$ = $1;
   11775             : }
   11776             : |  JsonType
   11777             :  { 
   11778           0 :  $$ = $1;
   11779             : }
   11780             : ;
   11781             : 
   11782             : 
   11783             :  GenericType:
   11784             :  type_function_name opt_type_modifiers
   11785             :  { 
   11786         122 :  $$ = cat_str(2,$1,$2);
   11787             : }
   11788             : |  type_function_name attrs opt_type_modifiers
   11789             :  { 
   11790           0 :  $$ = cat_str(3,$1,$2,$3);
   11791             : }
   11792             : ;
   11793             : 
   11794             : 
   11795             :  opt_type_modifiers:
   11796             :  '(' expr_list ')'
   11797             :  { 
   11798           6 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
   11799             : }
   11800             : | 
   11801             :  { 
   11802         138 :  $$=EMPTY; }
   11803             : ;
   11804             : 
   11805             : 
   11806             :  Numeric:
   11807             :  INT_P
   11808             :  { 
   11809          88 :  $$ = mm_strdup("int");
   11810             : }
   11811             : |  INTEGER
   11812             :  { 
   11813          26 :  $$ = mm_strdup("integer");
   11814             : }
   11815             : |  SMALLINT
   11816             :  { 
   11817          10 :  $$ = mm_strdup("smallint");
   11818             : }
   11819             : |  BIGINT
   11820             :  { 
   11821           6 :  $$ = mm_strdup("bigint");
   11822             : }
   11823             : |  REAL
   11824             :  { 
   11825           0 :  $$ = mm_strdup("real");
   11826             : }
   11827             : |  FLOAT_P opt_float
   11828             :  { 
   11829           4 :  $$ = cat_str(2,mm_strdup("float"),$2);
   11830             : }
   11831             : |  DOUBLE_P PRECISION
   11832             :  { 
   11833           6 :  $$ = mm_strdup("double precision");
   11834             : }
   11835             : |  DECIMAL_P opt_type_modifiers
   11836             :  { 
   11837           4 :  $$ = cat_str(2,mm_strdup("decimal"),$2);
   11838             : }
   11839             : |  DEC opt_type_modifiers
   11840             :  { 
   11841           0 :  $$ = cat_str(2,mm_strdup("dec"),$2);
   11842             : }
   11843             : |  NUMERIC opt_type_modifiers
   11844             :  { 
   11845          18 :  $$ = cat_str(2,mm_strdup("numeric"),$2);
   11846             : }
   11847             : |  BOOLEAN_P
   11848             :  { 
   11849           4 :  $$ = mm_strdup("boolean");
   11850             : }
   11851             : ;
   11852             : 
   11853             : 
   11854             :  opt_float:
   11855             :  '(' Iconst ')'
   11856             :  { 
   11857           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
   11858             : }
   11859             : | 
   11860             :  { 
   11861           4 :  $$=EMPTY; }
   11862             : ;
   11863             : 
   11864             : 
   11865             :  Bit:
   11866             :  BitWithLength
   11867             :  { 
   11868           0 :  $$ = $1;
   11869             : }
   11870             : |  BitWithoutLength
   11871             :  { 
   11872           0 :  $$ = $1;
   11873             : }
   11874             : ;
   11875             : 
   11876             : 
   11877             :  ConstBit:
   11878             :  BitWithLength
   11879             :  { 
   11880           0 :  $$ = $1;
   11881             : }
   11882             : |  BitWithoutLength
   11883             :  { 
   11884           0 :  $$ = $1;
   11885             : }
   11886             : ;
   11887             : 
   11888             : 
   11889             :  BitWithLength:
   11890             :  BIT opt_varying '(' expr_list ')'
   11891             :  { 
   11892           0 :  $$ = cat_str(5,mm_strdup("bit"),$2,mm_strdup("("),$4,mm_strdup(")"));
   11893             : }
   11894             : ;
   11895             : 
   11896             : 
   11897             :  BitWithoutLength:
   11898             :  BIT opt_varying
   11899             :  { 
   11900           0 :  $$ = cat_str(2,mm_strdup("bit"),$2);
   11901             : }
   11902             : ;
   11903             : 
   11904             : 
   11905             :  Character:
   11906             :  CharacterWithLength
   11907             :  { 
   11908          58 :  $$ = $1;
   11909             : }
   11910             : |  CharacterWithoutLength
   11911             :  { 
   11912           8 :  $$ = $1;
   11913             : }
   11914             : ;
   11915             : 
   11916             : 
   11917             :  ConstCharacter:
   11918             :  CharacterWithLength
   11919             :  { 
   11920           0 :  $$ = $1;
   11921             : }
   11922             : |  CharacterWithoutLength
   11923             :  { 
   11924           0 :  $$ = $1;
   11925             : }
   11926             : ;
   11927             : 
   11928             : 
   11929             :  CharacterWithLength:
   11930             :  character '(' Iconst ')'
   11931             :  { 
   11932          58 :  $$ = cat_str(4,$1,mm_strdup("("),$3,mm_strdup(")"));
   11933             : }
   11934             : ;
   11935             : 
   11936             : 
   11937             :  CharacterWithoutLength:
   11938             :  character
   11939             :  { 
   11940           8 :  $$ = $1;
   11941             : }
   11942             : ;
   11943             : 
   11944             : 
   11945             :  character:
   11946             :  CHARACTER opt_varying
   11947             :  { 
   11948           2 :  $$ = cat_str(2,mm_strdup("character"),$2);
   11949             : }
   11950             : |  CHAR_P opt_varying
   11951             :  { 
   11952          42 :  $$ = cat_str(2,mm_strdup("char"),$2);
   11953             : }
   11954             : |  VARCHAR
   11955             :  { 
   11956          22 :  $$ = mm_strdup("varchar");
   11957             : }
   11958             : |  NATIONAL CHARACTER opt_varying
   11959             :  { 
   11960           0 :  $$ = cat_str(2,mm_strdup("national character"),$3);
   11961             : }
   11962             : |  NATIONAL CHAR_P opt_varying
   11963             :  { 
   11964           0 :  $$ = cat_str(2,mm_strdup("national char"),$3);
   11965             : }
   11966             : |  NCHAR opt_varying
   11967             :  { 
   11968           0 :  $$ = cat_str(2,mm_strdup("nchar"),$2);
   11969             : }
   11970             : ;
   11971             : 
   11972             : 
   11973             :  opt_varying:
   11974             :  VARYING
   11975             :  { 
   11976           0 :  $$ = mm_strdup("varying");
   11977             : }
   11978             : | 
   11979             :  { 
   11980          44 :  $$=EMPTY; }
   11981             : ;
   11982             : 
   11983             : 
   11984             :  ConstDatetime:
   11985             :  TIMESTAMP '(' Iconst ')' opt_timezone
   11986             :  { 
   11987           0 :  $$ = cat_str(4,mm_strdup("timestamp ("),$3,mm_strdup(")"),$5);
   11988             : }
   11989             : |  TIMESTAMP opt_timezone
   11990             :  { 
   11991          16 :  $$ = cat_str(2,mm_strdup("timestamp"),$2);
   11992             : }
   11993             : |  TIME '(' Iconst ')' opt_timezone
   11994             :  { 
   11995           0 :  $$ = cat_str(4,mm_strdup("time ("),$3,mm_strdup(")"),$5);
   11996             : }
   11997             : |  TIME opt_timezone
   11998             :  { 
   11999           0 :  $$ = cat_str(2,mm_strdup("time"),$2);
   12000             : }
   12001             : ;
   12002             : 
   12003             : 
   12004             :  ConstInterval:
   12005             :  INTERVAL
   12006             :  { 
   12007           2 :  $$ = mm_strdup("interval");
   12008             : }
   12009             : ;
   12010             : 
   12011             : 
   12012             :  opt_timezone:
   12013             :  WITH_LA TIME ZONE
   12014             :  { 
   12015           0 :  $$ = mm_strdup("with time zone");
   12016             : }
   12017             : |  WITHOUT_LA TIME ZONE
   12018             :  { 
   12019           2 :  $$ = mm_strdup("without time zone");
   12020             : }
   12021             : | 
   12022             :  { 
   12023          14 :  $$=EMPTY; }
   12024             : ;
   12025             : 
   12026             : 
   12027             :  opt_interval:
   12028             :  YEAR_P
   12029             :  { 
   12030           0 :  $$ = mm_strdup("year");
   12031             : }
   12032             : |  MONTH_P
   12033             :  { 
   12034           0 :  $$ = mm_strdup("month");
   12035             : }
   12036             : |  DAY_P
   12037             :  { 
   12038           0 :  $$ = mm_strdup("day");
   12039             : }
   12040             : |  HOUR_P
   12041             :  { 
   12042           0 :  $$ = mm_strdup("hour");
   12043             : }
   12044             : |  MINUTE_P
   12045             :  { 
   12046           0 :  $$ = mm_strdup("minute");
   12047             : }
   12048             : |  interval_second
   12049             :  { 
   12050           0 :  $$ = $1;
   12051             : }
   12052             : |  YEAR_P TO MONTH_P
   12053             :  { 
   12054           0 :  $$ = mm_strdup("year to month");
   12055             : }
   12056             : |  DAY_P TO HOUR_P
   12057             :  { 
   12058           0 :  $$ = mm_strdup("day to hour");
   12059             : }
   12060             : |  DAY_P TO MINUTE_P
   12061             :  { 
   12062           0 :  $$ = mm_strdup("day to minute");
   12063             : }
   12064             : |  DAY_P TO interval_second
   12065             :  { 
   12066           0 :  $$ = cat_str(2,mm_strdup("day to"),$3);
   12067             : }
   12068             : |  HOUR_P TO MINUTE_P
   12069             :  { 
   12070           0 :  $$ = mm_strdup("hour to minute");
   12071             : }
   12072             : |  HOUR_P TO interval_second
   12073             :  { 
   12074           0 :  $$ = cat_str(2,mm_strdup("hour to"),$3);
   12075             : }
   12076             : |  MINUTE_P TO interval_second
   12077             :  { 
   12078           0 :  $$ = cat_str(2,mm_strdup("minute to"),$3);
   12079             : }
   12080             : | 
   12081             :  { 
   12082         100 :  $$=EMPTY; }
   12083             : ;
   12084             : 
   12085             : 
   12086             :  interval_second:
   12087             :  SECOND_P
   12088             :  { 
   12089           0 :  $$ = mm_strdup("second");
   12090             : }
   12091             : |  SECOND_P '(' Iconst ')'
   12092             :  { 
   12093           0 :  $$ = cat_str(3,mm_strdup("second ("),$3,mm_strdup(")"));
   12094             : }
   12095             : ;
   12096             : 
   12097             : 
   12098             :  JsonType:
   12099             :  JSON
   12100             :  { 
   12101           2 :  $$ = mm_strdup("json");
   12102             : }
   12103             : ;
   12104             : 
   12105             : 
   12106             :  a_expr:
   12107             :  c_expr
   12108             :  { 
   12109        1368 :  $$ = $1;
   12110             : }
   12111             : |  a_expr TYPECAST Typename
   12112             :  { 
   12113          22 :  $$ = cat_str(3,$1,mm_strdup("::"),$3);
   12114             : }
   12115             : |  a_expr COLLATE any_name
   12116             :  { 
   12117           2 :  $$ = cat_str(3,$1,mm_strdup("collate"),$3);
   12118             : }
   12119             : |  a_expr AT TIME ZONE a_expr %prec AT
   12120             :  { 
   12121           0 :  $$ = cat_str(3,$1,mm_strdup("at time zone"),$5);
   12122             : }
   12123             : |  a_expr AT LOCAL %prec AT
   12124             :  { 
   12125           0 :  $$ = cat_str(2,$1,mm_strdup("at local"));
   12126             : }
   12127             : |  '+' a_expr %prec UMINUS
   12128             :  { 
   12129           0 :  $$ = cat_str(2,mm_strdup("+"),$2);
   12130             : }
   12131             : |  '-' a_expr %prec UMINUS
   12132             :  { 
   12133           6 :  $$ = cat_str(2,mm_strdup("-"),$2);
   12134             : }
   12135             : |  a_expr '+' a_expr
   12136             :  { 
   12137          12 :  $$ = cat_str(3,$1,mm_strdup("+"),$3);
   12138             : }
   12139             : |  a_expr '-' a_expr
   12140             :  { 
   12141           2 :  $$ = cat_str(3,$1,mm_strdup("-"),$3);
   12142             : }
   12143             : |  a_expr '*' a_expr
   12144             :  { 
   12145           0 :  $$ = cat_str(3,$1,mm_strdup("*"),$3);
   12146             : }
   12147             : |  a_expr '/' a_expr
   12148             :  { 
   12149           0 :  $$ = cat_str(3,$1,mm_strdup("/"),$3);
   12150             : }
   12151             : |  a_expr '%' a_expr
   12152             :  { 
   12153           0 :  $$ = cat_str(3,$1,mm_strdup("%"),$3);
   12154             : }
   12155             : |  a_expr '^' a_expr
   12156             :  { 
   12157           0 :  $$ = cat_str(3,$1,mm_strdup("^"),$3);
   12158             : }
   12159             : |  a_expr '<' a_expr
   12160             :  { 
   12161           0 :  $$ = cat_str(3,$1,mm_strdup("<"),$3);
   12162             : }
   12163             : |  a_expr '>' a_expr
   12164             :  { 
   12165           0 :  $$ = cat_str(3,$1,mm_strdup(">"),$3);
   12166             : }
   12167             : |  a_expr '=' a_expr
   12168             :  { 
   12169          64 :  $$ = cat_str(3,$1,mm_strdup("="),$3);
   12170             : }
   12171             : |  a_expr LESS_EQUALS a_expr
   12172             :  { 
   12173           2 :  $$ = cat_str(3,$1,mm_strdup("<="),$3);
   12174             : }
   12175             : |  a_expr GREATER_EQUALS a_expr
   12176             :  { 
   12177           0 :  $$ = cat_str(3,$1,mm_strdup(">="),$3);
   12178             : }
   12179             : |  a_expr NOT_EQUALS a_expr
   12180             :  { 
   12181           0 :  $$ = cat_str(3,$1,mm_strdup("<>"),$3);
   12182             : }
   12183             : |  a_expr qual_Op a_expr %prec Op
   12184             :  { 
   12185           4 :  $$ = cat_str(3,$1,$2,$3);
   12186             : }
   12187             : |  qual_Op a_expr %prec Op
   12188             :  { 
   12189           0 :  $$ = cat_str(2,$1,$2);
   12190             : }
   12191             : |  a_expr AND a_expr
   12192             :  { 
   12193           0 :  $$ = cat_str(3,$1,mm_strdup("and"),$3);
   12194             : }
   12195             : |  a_expr OR a_expr
   12196             :  { 
   12197           0 :  $$ = cat_str(3,$1,mm_strdup("or"),$3);
   12198             : }
   12199             : |  NOT a_expr
   12200             :  { 
   12201           0 :  $$ = cat_str(2,mm_strdup("not"),$2);
   12202             : }
   12203             : |  NOT_LA a_expr %prec NOT
   12204             :  { 
   12205           0 :  $$ = cat_str(2,mm_strdup("not"),$2);
   12206             : }
   12207             : |  a_expr LIKE a_expr
   12208             :  { 
   12209           0 :  $$ = cat_str(3,$1,mm_strdup("like"),$3);
   12210             : }
   12211             : |  a_expr LIKE a_expr ESCAPE a_expr %prec LIKE
   12212             :  { 
   12213           0 :  $$ = cat_str(5,$1,mm_strdup("like"),$3,mm_strdup("escape"),$5);
   12214             : }
   12215             : |  a_expr NOT_LA LIKE a_expr %prec NOT_LA
   12216             :  { 
   12217           0 :  $$ = cat_str(3,$1,mm_strdup("not like"),$4);
   12218             : }
   12219             : |  a_expr NOT_LA LIKE a_expr ESCAPE a_expr %prec NOT_LA
   12220             :  { 
   12221           0 :  $$ = cat_str(5,$1,mm_strdup("not like"),$4,mm_strdup("escape"),$6);
   12222             : }
   12223             : |  a_expr ILIKE a_expr
   12224             :  { 
   12225           0 :  $$ = cat_str(3,$1,mm_strdup("ilike"),$3);
   12226             : }
   12227             : |  a_expr ILIKE a_expr ESCAPE a_expr %prec ILIKE
   12228             :  { 
   12229           0 :  $$ = cat_str(5,$1,mm_strdup("ilike"),$3,mm_strdup("escape"),$5);
   12230             : }
   12231             : |  a_expr NOT_LA ILIKE a_expr %prec NOT_LA
   12232             :  { 
   12233           0 :  $$ = cat_str(3,$1,mm_strdup("not ilike"),$4);
   12234             : }
   12235             : |  a_expr NOT_LA ILIKE a_expr ESCAPE a_expr %prec NOT_LA
   12236             :  { 
   12237           0 :  $$ = cat_str(5,$1,mm_strdup("not ilike"),$4,mm_strdup("escape"),$6);
   12238             : }
   12239             : |  a_expr SIMILAR TO a_expr %prec SIMILAR
   12240             :  { 
   12241           0 :  $$ = cat_str(3,$1,mm_strdup("similar to"),$4);
   12242             : }
   12243             : |  a_expr SIMILAR TO a_expr ESCAPE a_expr %prec SIMILAR
   12244             :  { 
   12245           0 :  $$ = cat_str(5,$1,mm_strdup("similar to"),$4,mm_strdup("escape"),$6);
   12246             : }
   12247             : |  a_expr NOT_LA SIMILAR TO a_expr %prec NOT_LA
   12248             :  { 
   12249           0 :  $$ = cat_str(3,$1,mm_strdup("not similar to"),$5);
   12250             : }
   12251             : |  a_expr NOT_LA SIMILAR TO a_expr ESCAPE a_expr %prec NOT_LA
   12252             :  { 
   12253           0 :  $$ = cat_str(5,$1,mm_strdup("not similar to"),$5,mm_strdup("escape"),$7);
   12254             : }
   12255             : |  a_expr IS NULL_P %prec IS
   12256             :  { 
   12257           0 :  $$ = cat_str(2,$1,mm_strdup("is null"));
   12258             : }
   12259             : |  a_expr ISNULL
   12260             :  { 
   12261           0 :  $$ = cat_str(2,$1,mm_strdup("isnull"));
   12262             : }
   12263             : |  a_expr IS NOT NULL_P %prec IS
   12264             :  { 
   12265           0 :  $$ = cat_str(2,$1,mm_strdup("is not null"));
   12266             : }
   12267             : |  a_expr NOTNULL
   12268             :  { 
   12269           0 :  $$ = cat_str(2,$1,mm_strdup("notnull"));
   12270             : }
   12271             : |  row OVERLAPS row
   12272             :  { 
   12273           0 :  $$ = cat_str(3,$1,mm_strdup("overlaps"),$3);
   12274             : }
   12275             : |  a_expr IS TRUE_P %prec IS
   12276             :  { 
   12277           0 :  $$ = cat_str(2,$1,mm_strdup("is true"));
   12278             : }
   12279             : |  a_expr IS NOT TRUE_P %prec IS
   12280             :  { 
   12281           0 :  $$ = cat_str(2,$1,mm_strdup("is not true"));
   12282             : }
   12283             : |  a_expr IS FALSE_P %prec IS
   12284             :  { 
   12285           0 :  $$ = cat_str(2,$1,mm_strdup("is false"));
   12286             : }
   12287             : |  a_expr IS NOT FALSE_P %prec IS
   12288             :  { 
   12289           0 :  $$ = cat_str(2,$1,mm_strdup("is not false"));
   12290             : }
   12291             : |  a_expr IS UNKNOWN %prec IS
   12292             :  { 
   12293           0 :  $$ = cat_str(2,$1,mm_strdup("is unknown"));
   12294             : }
   12295             : |  a_expr IS NOT UNKNOWN %prec IS
   12296             :  { 
   12297           0 :  $$ = cat_str(2,$1,mm_strdup("is not unknown"));
   12298             : }
   12299             : |  a_expr IS DISTINCT FROM a_expr %prec IS
   12300             :  { 
   12301           0 :  $$ = cat_str(3,$1,mm_strdup("is distinct from"),$5);
   12302             : }
   12303             : |  a_expr IS NOT DISTINCT FROM a_expr %prec IS
   12304             :  { 
   12305           0 :  $$ = cat_str(3,$1,mm_strdup("is not distinct from"),$6);
   12306             : }
   12307             : |  a_expr BETWEEN opt_asymmetric b_expr AND a_expr %prec BETWEEN
   12308             :  { 
   12309           0 :  $$ = cat_str(6,$1,mm_strdup("between"),$3,$4,mm_strdup("and"),$6);
   12310             : }
   12311             : |  a_expr NOT_LA BETWEEN opt_asymmetric b_expr AND a_expr %prec NOT_LA
   12312             :  { 
   12313           0 :  $$ = cat_str(6,$1,mm_strdup("not between"),$4,$5,mm_strdup("and"),$7);
   12314             : }
   12315             : |  a_expr BETWEEN SYMMETRIC b_expr AND a_expr %prec BETWEEN
   12316             :  { 
   12317           0 :  $$ = cat_str(5,$1,mm_strdup("between symmetric"),$4,mm_strdup("and"),$6);
   12318             : }
   12319             : |  a_expr NOT_LA BETWEEN SYMMETRIC b_expr AND a_expr %prec NOT_LA
   12320             :  { 
   12321           0 :  $$ = cat_str(5,$1,mm_strdup("not between symmetric"),$5,mm_strdup("and"),$7);
   12322             : }
   12323             : |  a_expr IN_P in_expr
   12324             :  { 
   12325           0 :  $$ = cat_str(3,$1,mm_strdup("in"),$3);
   12326             : }
   12327             : |  a_expr NOT_LA IN_P in_expr %prec NOT_LA
   12328             :  { 
   12329           0 :  $$ = cat_str(3,$1,mm_strdup("not in"),$4);
   12330             : }
   12331             : |  a_expr subquery_Op sub_type select_with_parens %prec Op
   12332             :  { 
   12333           0 :  $$ = cat_str(4,$1,$2,$3,$4);
   12334             : }
   12335             : |  a_expr subquery_Op sub_type '(' a_expr ')' %prec Op
   12336             :  { 
   12337           0 :  $$ = cat_str(6,$1,$2,$3,mm_strdup("("),$5,mm_strdup(")"));
   12338             : }
   12339             : |  UNIQUE opt_unique_null_treatment select_with_parens
   12340             :  { 
   12341           0 : mmerror(PARSE_ERROR, ET_WARNING, "unsupported feature will be passed to server");
   12342           0 :  $$ = cat_str(3,mm_strdup("unique"),$2,$3);
   12343             : }
   12344             : |  a_expr IS DOCUMENT_P %prec IS
   12345             :  { 
   12346           0 :  $$ = cat_str(2,$1,mm_strdup("is document"));
   12347             : }
   12348             : |  a_expr IS NOT DOCUMENT_P %prec IS
   12349             :  { 
   12350           0 :  $$ = cat_str(2,$1,mm_strdup("is not document"));
   12351             : }
   12352             : |  a_expr IS NORMALIZED %prec IS
   12353             :  { 
   12354           0 :  $$ = cat_str(2,$1,mm_strdup("is normalized"));
   12355             : }
   12356             : |  a_expr IS unicode_normal_form NORMALIZED %prec IS
   12357             :  { 
   12358           0 :  $$ = cat_str(4,$1,mm_strdup("is"),$3,mm_strdup("normalized"));
   12359             : }
   12360             : |  a_expr IS NOT NORMALIZED %prec IS
   12361             :  { 
   12362           0 :  $$ = cat_str(2,$1,mm_strdup("is not normalized"));
   12363             : }
   12364             : |  a_expr IS NOT unicode_normal_form NORMALIZED %prec IS
   12365             :  { 
   12366           0 :  $$ = cat_str(4,$1,mm_strdup("is not"),$4,mm_strdup("normalized"));
   12367             : }
   12368             : |  a_expr IS json_predicate_type_constraint json_key_uniqueness_constraint_opt %prec IS
   12369             :  { 
   12370          14 :  $$ = cat_str(4,$1,mm_strdup("is"),$3,$4);
   12371             : }
   12372             : |  a_expr IS NOT json_predicate_type_constraint json_key_uniqueness_constraint_opt %prec IS
   12373             :  { 
   12374           2 :  $$ = cat_str(4,$1,mm_strdup("is not"),$4,$5);
   12375             : }
   12376             : |  DEFAULT
   12377             :  { 
   12378          32 :  $$ = mm_strdup("default");
   12379             : }
   12380             : ;
   12381             : 
   12382             : 
   12383             :  b_expr:
   12384             :  c_expr
   12385             :  { 
   12386           4 :  $$ = $1;
   12387             : }
   12388             : |  b_expr TYPECAST Typename
   12389             :  { 
   12390           0 :  $$ = cat_str(3,$1,mm_strdup("::"),$3);
   12391             : }
   12392             : |  '+' b_expr %prec UMINUS
   12393             :  { 
   12394           0 :  $$ = cat_str(2,mm_strdup("+"),$2);
   12395             : }
   12396             : |  '-' b_expr %prec UMINUS
   12397             :  { 
   12398           0 :  $$ = cat_str(2,mm_strdup("-"),$2);
   12399             : }
   12400             : |  b_expr '+' b_expr
   12401             :  { 
   12402           0 :  $$ = cat_str(3,$1,mm_strdup("+"),$3);
   12403             : }
   12404             : |  b_expr '-' b_expr
   12405             :  { 
   12406           0 :  $$ = cat_str(3,$1,mm_strdup("-"),$3);
   12407             : }
   12408             : |  b_expr '*' b_expr
   12409             :  { 
   12410           0 :  $$ = cat_str(3,$1,mm_strdup("*"),$3);
   12411             : }
   12412             : |  b_expr '/' b_expr
   12413             :  { 
   12414           0 :  $$ = cat_str(3,$1,mm_strdup("/"),$3);
   12415             : }
   12416             : |  b_expr '%' b_expr
   12417             :  { 
   12418           0 :  $$ = cat_str(3,$1,mm_strdup("%"),$3);
   12419             : }
   12420             : |  b_expr '^' b_expr
   12421             :  { 
   12422           0 :  $$ = cat_str(3,$1,mm_strdup("^"),$3);
   12423             : }
   12424             : |  b_expr '<' b_expr
   12425             :  { 
   12426           0 :  $$ = cat_str(3,$1,mm_strdup("<"),$3);
   12427             : }
   12428             : |  b_expr '>' b_expr
   12429             :  { 
   12430           0 :  $$ = cat_str(3,$1,mm_strdup(">"),$3);
   12431             : }
   12432             : |  b_expr '=' b_expr
   12433             :  { 
   12434           0 :  $$ = cat_str(3,$1,mm_strdup("="),$3);
   12435             : }
   12436             : |  b_expr LESS_EQUALS b_expr
   12437             :  { 
   12438           0 :  $$ = cat_str(3,$1,mm_strdup("<="),$3);
   12439             : }
   12440             : |  b_expr GREATER_EQUALS b_expr
   12441             :  { 
   12442           0 :  $$ = cat_str(3,$1,mm_strdup(">="),$3);
   12443             : }
   12444             : |  b_expr NOT_EQUALS b_expr
   12445             :  { 
   12446           0 :  $$ = cat_str(3,$1,mm_strdup("<>"),$3);
   12447             : }
   12448             : |  b_expr qual_Op b_expr %prec Op
   12449             :  { 
   12450           0 :  $$ = cat_str(3,$1,$2,$3);
   12451             : }
   12452             : |  qual_Op b_expr %prec Op
   12453             :  { 
   12454           0 :  $$ = cat_str(2,$1,$2);
   12455             : }
   12456             : |  b_expr IS DISTINCT FROM b_expr %prec IS
   12457             :  { 
   12458           0 :  $$ = cat_str(3,$1,mm_strdup("is distinct from"),$5);
   12459             : }
   12460             : |  b_expr IS NOT DISTINCT FROM b_expr %prec IS
   12461             :  { 
   12462           0 :  $$ = cat_str(3,$1,mm_strdup("is not distinct from"),$6);
   12463             : }
   12464             : |  b_expr IS DOCUMENT_P %prec IS
   12465             :  { 
   12466           0 :  $$ = cat_str(2,$1,mm_strdup("is document"));
   12467             : }
   12468             : |  b_expr IS NOT DOCUMENT_P %prec IS
   12469             :  { 
   12470           0 :  $$ = cat_str(2,$1,mm_strdup("is not document"));
   12471             : }
   12472             : ;
   12473             : 
   12474             : 
   12475             :  c_expr:
   12476             :  columnref
   12477             :  { 
   12478         310 :  $$ = $1;
   12479             : }
   12480             : |  AexprConst
   12481             :  { 
   12482         934 :  $$ = $1;
   12483             : }
   12484             : |  ecpg_param opt_indirection
   12485             :  { 
   12486          22 :  $$ = cat_str(2,$1,$2);
   12487             : }
   12488             : |  '(' a_expr ')' opt_indirection
   12489             :  { 
   12490           0 :  $$ = cat_str(4,mm_strdup("("),$2,mm_strdup(")"),$4);
   12491             : }
   12492             : |  case_expr
   12493             :  { 
   12494           0 :  $$ = $1;
   12495             : }
   12496             : |  func_expr
   12497             :  { 
   12498         100 :  $$ = $1;
   12499             : }
   12500             : |  select_with_parens %prec UMINUS
   12501             :  { 
   12502           4 :  $$ = $1;
   12503             : }
   12504             : |  select_with_parens indirection
   12505             :  { 
   12506           0 :  $$ = cat_str(2,$1,$2);
   12507             : }
   12508             : |  EXISTS select_with_parens
   12509             :  { 
   12510           0 :  $$ = cat_str(2,mm_strdup("exists"),$2);
   12511             : }
   12512             : |  ARRAY select_with_parens
   12513             :  { 
   12514           0 :  $$ = cat_str(2,mm_strdup("array"),$2);
   12515             : }
   12516             : |  ARRAY array_expr
   12517             :  { 
   12518           0 :  $$ = cat_str(2,mm_strdup("array"),$2);
   12519             : }
   12520             : |  explicit_row
   12521             :  { 
   12522           0 :  $$ = $1;
   12523             : }
   12524             : |  implicit_row
   12525             :  { 
   12526           2 :  $$ = $1;
   12527             : }
   12528             : |  GROUPING '(' expr_list ')'
   12529             :  { 
   12530           0 :  $$ = cat_str(3,mm_strdup("grouping ("),$3,mm_strdup(")"));
   12531             : }
   12532             : ;
   12533             : 
   12534             : 
   12535             :  func_application:
   12536             :  func_name '(' ')'
   12537             :  { 
   12538          30 :  $$ = cat_str(2,$1,mm_strdup("( )"));
   12539             : }
   12540             : |  func_name '(' func_arg_list opt_sort_clause ')'
   12541             :  { 
   12542           6 :  $$ = cat_str(5,$1,mm_strdup("("),$3,$4,mm_strdup(")"));
   12543             : }
   12544             : |  func_name '(' VARIADIC func_arg_expr opt_sort_clause ')'
   12545             :  { 
   12546           0 :  $$ = cat_str(5,$1,mm_strdup("( variadic"),$4,$5,mm_strdup(")"));
   12547             : }
   12548             : |  func_name '(' func_arg_list ',' VARIADIC func_arg_expr opt_sort_clause ')'
   12549             :  { 
   12550           0 :  $$ = cat_str(7,$1,mm_strdup("("),$3,mm_strdup(", variadic"),$6,$7,mm_strdup(")"));
   12551             : }
   12552             : |  func_name '(' ALL func_arg_list opt_sort_clause ')'
   12553             :  { 
   12554           0 :  $$ = cat_str(5,$1,mm_strdup("( all"),$4,$5,mm_strdup(")"));
   12555             : }
   12556             : |  func_name '(' DISTINCT func_arg_list opt_sort_clause ')'
   12557             :  { 
   12558           0 :  $$ = cat_str(5,$1,mm_strdup("( distinct"),$4,$5,mm_strdup(")"));
   12559             : }
   12560             : |  func_name '(' '*' ')'
   12561             :  { 
   12562           4 :  $$ = cat_str(2,$1,mm_strdup("( * )"));
   12563             : }
   12564             : ;
   12565             : 
   12566             : 
   12567             :  func_expr:
   12568             :  func_application within_group_clause filter_clause over_clause
   12569             :  { 
   12570          38 :  $$ = cat_str(4,$1,$2,$3,$4);
   12571             : }
   12572             : |  json_aggregate_func filter_clause over_clause
   12573             :  { 
   12574           0 :  $$ = cat_str(3,$1,$2,$3);
   12575             : }
   12576             : |  func_expr_common_subexpr
   12577             :  { 
   12578          62 :  $$ = $1;
   12579             : }
   12580             : ;
   12581             : 
   12582             : 
   12583             :  func_expr_windowless:
   12584             :  func_application
   12585             :  { 
   12586           2 :  $$ = $1;
   12587             : }
   12588             : |  func_expr_common_subexpr
   12589             :  { 
   12590           0 :  $$ = $1;
   12591             : }
   12592             : |  json_aggregate_func
   12593             :  { 
   12594           0 :  $$ = $1;
   12595             : }
   12596             : ;
   12597             : 
   12598             : 
   12599             :  func_expr_common_subexpr:
   12600             :  COLLATION FOR '(' a_expr ')'
   12601             :  { 
   12602           0 :  $$ = cat_str(3,mm_strdup("collation for ("),$4,mm_strdup(")"));
   12603             : }
   12604             : |  CURRENT_DATE
   12605             :  { 
   12606           0 :  $$ = mm_strdup("current_date");
   12607             : }
   12608             : |  CURRENT_TIME
   12609             :  { 
   12610           0 :  $$ = mm_strdup("current_time");
   12611             : }
   12612             : |  CURRENT_TIME '(' Iconst ')'
   12613             :  { 
   12614           0 :  $$ = cat_str(3,mm_strdup("current_time ("),$3,mm_strdup(")"));
   12615             : }
   12616             : |  CURRENT_TIMESTAMP
   12617             :  { 
   12618           0 :  $$ = mm_strdup("current_timestamp");
   12619             : }
   12620             : |  CURRENT_TIMESTAMP '(' Iconst ')'
   12621             :  { 
   12622           0 :  $$ = cat_str(3,mm_strdup("current_timestamp ("),$3,mm_strdup(")"));
   12623             : }
   12624             : |  LOCALTIME
   12625             :  { 
   12626           0 :  $$ = mm_strdup("localtime");
   12627             : }
   12628             : |  LOCALTIME '(' Iconst ')'
   12629             :  { 
   12630           0 :  $$ = cat_str(3,mm_strdup("localtime ("),$3,mm_strdup(")"));
   12631             : }
   12632             : |  LOCALTIMESTAMP
   12633             :  { 
   12634           0 :  $$ = mm_strdup("localtimestamp");
   12635             : }
   12636             : |  LOCALTIMESTAMP '(' Iconst ')'
   12637             :  { 
   12638           0 :  $$ = cat_str(3,mm_strdup("localtimestamp ("),$3,mm_strdup(")"));
   12639             : }
   12640             : |  CURRENT_ROLE
   12641             :  { 
   12642           0 :  $$ = mm_strdup("current_role");
   12643             : }
   12644             : |  CURRENT_USER
   12645             :  { 
   12646           0 :  $$ = mm_strdup("current_user");
   12647             : }
   12648             : |  SESSION_USER
   12649             :  { 
   12650           0 :  $$ = mm_strdup("session_user");
   12651             : }
   12652             : |  SYSTEM_USER
   12653             :  { 
   12654           0 :  $$ = mm_strdup("system_user");
   12655             : }
   12656             : |  USER
   12657             :  { 
   12658           0 :  $$ = mm_strdup("user");
   12659             : }
   12660             : |  CURRENT_CATALOG
   12661             :  { 
   12662           0 :  $$ = mm_strdup("current_catalog");
   12663             : }
   12664             : |  CURRENT_SCHEMA
   12665             :  { 
   12666           0 :  $$ = mm_strdup("current_schema");
   12667             : }
   12668             : |  CAST '(' a_expr AS Typename ')'
   12669             :  { 
   12670           4 :  $$ = cat_str(5,mm_strdup("cast ("),$3,mm_strdup("as"),$5,mm_strdup(")"));
   12671             : }
   12672             : |  EXTRACT '(' extract_list ')'
   12673             :  { 
   12674           0 :  $$ = cat_str(3,mm_strdup("extract ("),$3,mm_strdup(")"));
   12675             : }
   12676             : |  NORMALIZE '(' a_expr ')'
   12677             :  { 
   12678           0 :  $$ = cat_str(3,mm_strdup("normalize ("),$3,mm_strdup(")"));
   12679             : }
   12680             : |  NORMALIZE '(' a_expr ',' unicode_normal_form ')'
   12681             :  { 
   12682           0 :  $$ = cat_str(5,mm_strdup("normalize ("),$3,mm_strdup(","),$5,mm_strdup(")"));
   12683             : }
   12684             : |  OVERLAY '(' overlay_list ')'
   12685             :  { 
   12686           0 :  $$ = cat_str(3,mm_strdup("overlay ("),$3,mm_strdup(")"));
   12687             : }
   12688             : |  OVERLAY '(' func_arg_list_opt ')'
   12689             :  { 
   12690           0 :  $$ = cat_str(3,mm_strdup("overlay ("),$3,mm_strdup(")"));
   12691             : }
   12692             : |  POSITION '(' position_list ')'
   12693             :  { 
   12694           0 :  $$ = cat_str(3,mm_strdup("position ("),$3,mm_strdup(")"));
   12695             : }
   12696             : |  SUBSTRING '(' substr_list ')'
   12697             :  { 
   12698           0 :  $$ = cat_str(3,mm_strdup("substring ("),$3,mm_strdup(")"));
   12699             : }
   12700             : |  SUBSTRING '(' func_arg_list_opt ')'
   12701             :  { 
   12702           0 :  $$ = cat_str(3,mm_strdup("substring ("),$3,mm_strdup(")"));
   12703             : }
   12704             : |  TREAT '(' a_expr AS Typename ')'
   12705             :  { 
   12706           0 :  $$ = cat_str(5,mm_strdup("treat ("),$3,mm_strdup("as"),$5,mm_strdup(")"));
   12707             : }
   12708             : |  TRIM '(' BOTH trim_list ')'
   12709             :  { 
   12710           0 :  $$ = cat_str(3,mm_strdup("trim ( both"),$4,mm_strdup(")"));
   12711             : }
   12712             : |  TRIM '(' LEADING trim_list ')'
   12713             :  { 
   12714           0 :  $$ = cat_str(3,mm_strdup("trim ( leading"),$4,mm_strdup(")"));
   12715             : }
   12716             : |  TRIM '(' TRAILING trim_list ')'
   12717             :  { 
   12718           0 :  $$ = cat_str(3,mm_strdup("trim ( trailing"),$4,mm_strdup(")"));
   12719             : }
   12720             : |  TRIM '(' trim_list ')'
   12721             :  { 
   12722           0 :  $$ = cat_str(3,mm_strdup("trim ("),$3,mm_strdup(")"));
   12723             : }
   12724             : |  NULLIF '(' a_expr ',' a_expr ')'
   12725             :  { 
   12726           2 :  $$ = cat_str(5,mm_strdup("nullif ("),$3,mm_strdup(","),$5,mm_strdup(")"));
   12727             : }
   12728             : |  COALESCE '(' expr_list ')'
   12729             :  { 
   12730           0 :  $$ = cat_str(3,mm_strdup("coalesce ("),$3,mm_strdup(")"));
   12731             : }
   12732             : |  GREATEST '(' expr_list ')'
   12733             :  { 
   12734           0 :  $$ = cat_str(3,mm_strdup("greatest ("),$3,mm_strdup(")"));
   12735             : }
   12736             : |  LEAST '(' expr_list ')'
   12737             :  { 
   12738           0 :  $$ = cat_str(3,mm_strdup("least ("),$3,mm_strdup(")"));
   12739             : }
   12740             : |  XMLCONCAT '(' expr_list ')'
   12741             :  { 
   12742           0 :  $$ = cat_str(3,mm_strdup("xmlconcat ("),$3,mm_strdup(")"));
   12743             : }
   12744             : |  XMLELEMENT '(' NAME_P ColLabel ')'
   12745             :  { 
   12746           0 :  $$ = cat_str(3,mm_strdup("xmlelement ( name"),$4,mm_strdup(")"));
   12747             : }
   12748             : |  XMLELEMENT '(' NAME_P ColLabel ',' xml_attributes ')'
   12749             :  { 
   12750           0 :  $$ = cat_str(5,mm_strdup("xmlelement ( name"),$4,mm_strdup(","),$6,mm_strdup(")"));
   12751             : }
   12752             : |  XMLELEMENT '(' NAME_P ColLabel ',' expr_list ')'
   12753             :  { 
   12754           0 :  $$ = cat_str(5,mm_strdup("xmlelement ( name"),$4,mm_strdup(","),$6,mm_strdup(")"));
   12755             : }
   12756             : |  XMLELEMENT '(' NAME_P ColLabel ',' xml_attributes ',' expr_list ')'
   12757             :  { 
   12758           0 :  $$ = cat_str(7,mm_strdup("xmlelement ( name"),$4,mm_strdup(","),$6,mm_strdup(","),$8,mm_strdup(")"));
   12759             : }
   12760             : |  XMLEXISTS '(' c_expr xmlexists_argument ')'
   12761             :  { 
   12762           0 :  $$ = cat_str(4,mm_strdup("xmlexists ("),$3,$4,mm_strdup(")"));
   12763             : }
   12764             : |  XMLFOREST '(' xml_attribute_list ')'
   12765             :  { 
   12766           0 :  $$ = cat_str(3,mm_strdup("xmlforest ("),$3,mm_strdup(")"));
   12767             : }
   12768             : |  XMLPARSE '(' document_or_content a_expr xml_whitespace_option ')'
   12769             :  { 
   12770           0 :  $$ = cat_str(5,mm_strdup("xmlparse ("),$3,$4,$5,mm_strdup(")"));
   12771             : }
   12772             : |  XMLPI '(' NAME_P ColLabel ')'
   12773             :  { 
   12774           0 :  $$ = cat_str(3,mm_strdup("xmlpi ( name"),$4,mm_strdup(")"));
   12775             : }
   12776             : |  XMLPI '(' NAME_P ColLabel ',' a_expr ')'
   12777             :  { 
   12778           0 :  $$ = cat_str(5,mm_strdup("xmlpi ( name"),$4,mm_strdup(","),$6,mm_strdup(")"));
   12779             : }
   12780             : |  XMLROOT '(' a_expr ',' xml_root_version opt_xml_root_standalone ')'
   12781             :  { 
   12782           0 :  $$ = cat_str(6,mm_strdup("xmlroot ("),$3,mm_strdup(","),$5,$6,mm_strdup(")"));
   12783             : }
   12784             : |  XMLSERIALIZE '(' document_or_content a_expr AS SimpleTypename xml_indent_option ')'
   12785             :  { 
   12786           0 :  $$ = cat_str(7,mm_strdup("xmlserialize ("),$3,$4,mm_strdup("as"),$6,$7,mm_strdup(")"));
   12787             : }
   12788             : |  JSON_OBJECT '(' func_arg_list ')'
   12789             :  { 
   12790           0 :  $$ = cat_str(3,mm_strdup("json_object ("),$3,mm_strdup(")"));
   12791             : }
   12792             : |  JSON_OBJECT '(' json_name_and_value_list json_object_constructor_null_clause_opt json_key_uniqueness_constraint_opt json_returning_clause_opt ')'
   12793             :  { 
   12794           6 :  $$ = cat_str(6,mm_strdup("json_object ("),$3,$4,$5,$6,mm_strdup(")"));
   12795             : }
   12796             : |  JSON_OBJECT '(' json_returning_clause_opt ')'
   12797             :  { 
   12798           4 :  $$ = cat_str(3,mm_strdup("json_object ("),$3,mm_strdup(")"));
   12799             : }
   12800             : |  JSON_ARRAY '(' json_value_expr_list json_array_constructor_null_clause_opt json_returning_clause_opt ')'
   12801             :  { 
   12802           0 :  $$ = cat_str(5,mm_strdup("json_array ("),$3,$4,$5,mm_strdup(")"));
   12803             : }
   12804             : |  JSON_ARRAY '(' select_no_parens json_format_clause_opt json_returning_clause_opt ')'
   12805             :  { 
   12806           0 :  $$ = cat_str(5,mm_strdup("json_array ("),$3,$4,$5,mm_strdup(")"));
   12807             : }
   12808             : |  JSON_ARRAY '(' json_returning_clause_opt ')'
   12809             :  { 
   12810           4 :  $$ = cat_str(3,mm_strdup("json_array ("),$3,mm_strdup(")"));
   12811             : }
   12812             : |  JSON '(' json_value_expr json_key_uniqueness_constraint_opt ')'
   12813             :  { 
   12814          16 :  $$ = cat_str(4,mm_strdup("json ("),$3,$4,mm_strdup(")"));
   12815             : }
   12816             : |  JSON_SCALAR '(' a_expr ')'
   12817             :  { 
   12818          14 :  $$ = cat_str(3,mm_strdup("json_scalar ("),$3,mm_strdup(")"));
   12819             : }
   12820             : |  JSON_SERIALIZE '(' json_value_expr json_returning_clause_opt ')'
   12821             :  { 
   12822          12 :  $$ = cat_str(4,mm_strdup("json_serialize ("),$3,$4,mm_strdup(")"));
   12823             : }
   12824             : |  MERGE_ACTION '(' ')'
   12825             :  { 
   12826           0 :  $$ = mm_strdup("merge_action ( )");
   12827             : }
   12828             : |  JSON_QUERY '(' json_value_expr ',' a_expr json_passing_clause_opt json_returning_clause_opt json_wrapper_behavior json_quotes_clause_opt json_behavior_clause_opt ')'
   12829             :  { 
   12830           0 :  $$ = cat_str(10,mm_strdup("json_query ("),$3,mm_strdup(","),$5,$6,$7,$8,$9,$10,mm_strdup(")"));
   12831             : }
   12832             : |  JSON_EXISTS '(' json_value_expr ',' a_expr json_passing_clause_opt json_on_error_clause_opt ')'
   12833             :  { 
   12834           0 :  $$ = cat_str(7,mm_strdup("json_exists ("),$3,mm_strdup(","),$5,$6,$7,mm_strdup(")"));
   12835             : }
   12836             : |  JSON_VALUE '(' json_value_expr ',' a_expr json_passing_clause_opt json_returning_clause_opt json_behavior_clause_opt ')'
   12837             :  { 
   12838           0 :  $$ = cat_str(8,mm_strdup("json_value ("),$3,mm_strdup(","),$5,$6,$7,$8,mm_strdup(")"));
   12839             : }
   12840             : ;
   12841             : 
   12842             : 
   12843             :  xml_root_version:
   12844             :  VERSION_P a_expr
   12845             :  { 
   12846           0 :  $$ = cat_str(2,mm_strdup("version"),$2);
   12847             : }
   12848             : |  VERSION_P NO VALUE_P
   12849             :  { 
   12850           0 :  $$ = mm_strdup("version no value");
   12851             : }
   12852             : ;
   12853             : 
   12854             : 
   12855             :  opt_xml_root_standalone:
   12856             :  ',' STANDALONE_P YES_P
   12857             :  { 
   12858           0 :  $$ = mm_strdup(", standalone yes");
   12859             : }
   12860             : |  ',' STANDALONE_P NO
   12861             :  { 
   12862           0 :  $$ = mm_strdup(", standalone no");
   12863             : }
   12864             : |  ',' STANDALONE_P NO VALUE_P
   12865             :  { 
   12866           0 :  $$ = mm_strdup(", standalone no value");
   12867             : }
   12868             : | 
   12869             :  { 
   12870           0 :  $$=EMPTY; }
   12871             : ;
   12872             : 
   12873             : 
   12874             :  xml_attributes:
   12875             :  XMLATTRIBUTES '(' xml_attribute_list ')'
   12876             :  { 
   12877           0 :  $$ = cat_str(3,mm_strdup("xmlattributes ("),$3,mm_strdup(")"));
   12878             : }
   12879             : ;
   12880             : 
   12881             : 
   12882             :  xml_attribute_list:
   12883             :  xml_attribute_el
   12884             :  { 
   12885           0 :  $$ = $1;
   12886             : }
   12887             : |  xml_attribute_list ',' xml_attribute_el
   12888             :  { 
   12889           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   12890             : }
   12891             : ;
   12892             : 
   12893             : 
   12894             :  xml_attribute_el:
   12895             :  a_expr AS ColLabel
   12896             :  { 
   12897           0 :  $$ = cat_str(3,$1,mm_strdup("as"),$3);
   12898             : }
   12899             : |  a_expr
   12900             :  { 
   12901           0 :  $$ = $1;
   12902             : }
   12903             : ;
   12904             : 
   12905             : 
   12906             :  document_or_content:
   12907             :  DOCUMENT_P
   12908             :  { 
   12909           0 :  $$ = mm_strdup("document");
   12910             : }
   12911             : |  CONTENT_P
   12912             :  { 
   12913           0 :  $$ = mm_strdup("content");
   12914             : }
   12915             : ;
   12916             : 
   12917             : 
   12918             :  xml_indent_option:
   12919             :  INDENT
   12920             :  { 
   12921           0 :  $$ = mm_strdup("indent");
   12922             : }
   12923             : |  NO INDENT
   12924             :  { 
   12925           0 :  $$ = mm_strdup("no indent");
   12926             : }
   12927             : | 
   12928             :  { 
   12929           0 :  $$=EMPTY; }
   12930             : ;
   12931             : 
   12932             : 
   12933             :  xml_whitespace_option:
   12934             :  PRESERVE WHITESPACE_P
   12935             :  { 
   12936           0 :  $$ = mm_strdup("preserve whitespace");
   12937             : }
   12938             : |  STRIP_P WHITESPACE_P
   12939             :  { 
   12940           0 :  $$ = mm_strdup("strip whitespace");
   12941             : }
   12942             : | 
   12943             :  { 
   12944           0 :  $$=EMPTY; }
   12945             : ;
   12946             : 
   12947             : 
   12948             :  xmlexists_argument:
   12949             :  PASSING c_expr
   12950             :  { 
   12951           0 :  $$ = cat_str(2,mm_strdup("passing"),$2);
   12952             : }
   12953             : |  PASSING c_expr xml_passing_mech
   12954             :  { 
   12955           0 :  $$ = cat_str(3,mm_strdup("passing"),$2,$3);
   12956             : }
   12957             : |  PASSING xml_passing_mech c_expr
   12958             :  { 
   12959           0 :  $$ = cat_str(3,mm_strdup("passing"),$2,$3);
   12960             : }
   12961             : |  PASSING xml_passing_mech c_expr xml_passing_mech
   12962             :  { 
   12963           0 :  $$ = cat_str(4,mm_strdup("passing"),$2,$3,$4);
   12964             : }
   12965             : ;
   12966             : 
   12967             : 
   12968             :  xml_passing_mech:
   12969             :  BY REF_P
   12970             :  { 
   12971           0 :  $$ = mm_strdup("by ref");
   12972             : }
   12973             : |  BY VALUE_P
   12974             :  { 
   12975           0 :  $$ = mm_strdup("by value");
   12976             : }
   12977             : ;
   12978             : 
   12979             : 
   12980             :  within_group_clause:
   12981             :  WITHIN GROUP_P '(' sort_clause ')'
   12982             :  { 
   12983           0 :  $$ = cat_str(3,mm_strdup("within group ("),$4,mm_strdup(")"));
   12984             : }
   12985             : | 
   12986             :  { 
   12987          38 :  $$=EMPTY; }
   12988             : ;
   12989             : 
   12990             : 
   12991             :  filter_clause:
   12992             :  FILTER '(' WHERE a_expr ')'
   12993             :  { 
   12994           0 :  $$ = cat_str(3,mm_strdup("filter ( where"),$4,mm_strdup(")"));
   12995             : }
   12996             : | 
   12997             :  { 
   12998          38 :  $$=EMPTY; }
   12999             : ;
   13000             : 
   13001             : 
   13002             :  window_clause:
   13003             :  WINDOW window_definition_list
   13004             :  { 
   13005           0 :  $$ = cat_str(2,mm_strdup("window"),$2);
   13006             : }
   13007             : | 
   13008             :  { 
   13009         238 :  $$=EMPTY; }
   13010             : ;
   13011             : 
   13012             : 
   13013             :  window_definition_list:
   13014             :  window_definition
   13015             :  { 
   13016           0 :  $$ = $1;
   13017             : }
   13018             : |  window_definition_list ',' window_definition
   13019             :  { 
   13020           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   13021             : }
   13022             : ;
   13023             : 
   13024             : 
   13025             :  window_definition:
   13026             :  ColId AS window_specification
   13027             :  { 
   13028           0 :  $$ = cat_str(3,$1,mm_strdup("as"),$3);
   13029             : }
   13030             : ;
   13031             : 
   13032             : 
   13033             :  over_clause:
   13034             :  OVER window_specification
   13035             :  { 
   13036           0 :  $$ = cat_str(2,mm_strdup("over"),$2);
   13037             : }
   13038             : |  OVER ColId
   13039             :  { 
   13040           0 :  $$ = cat_str(2,mm_strdup("over"),$2);
   13041             : }
   13042             : | 
   13043             :  { 
   13044          38 :  $$=EMPTY; }
   13045             : ;
   13046             : 
   13047             : 
   13048             :  window_specification:
   13049             :  '(' opt_existing_window_name opt_partition_clause opt_sort_clause opt_frame_clause ')'
   13050             :  { 
   13051           0 :  $$ = cat_str(6,mm_strdup("("),$2,$3,$4,$5,mm_strdup(")"));
   13052             : }
   13053             : ;
   13054             : 
   13055             : 
   13056             :  opt_existing_window_name:
   13057             :  ColId
   13058             :  { 
   13059           0 :  $$ = $1;
   13060             : }
   13061             : |  %prec Op
   13062             :  { 
   13063           0 :  $$=EMPTY; }
   13064             : ;
   13065             : 
   13066             : 
   13067             :  opt_partition_clause:
   13068             :  PARTITION BY expr_list
   13069             :  { 
   13070           0 :  $$ = cat_str(2,mm_strdup("partition by"),$3);
   13071             : }
   13072             : | 
   13073             :  { 
   13074           0 :  $$=EMPTY; }
   13075             : ;
   13076             : 
   13077             : 
   13078             :  opt_frame_clause:
   13079             :  RANGE frame_extent opt_window_exclusion_clause
   13080             :  { 
   13081           0 :  $$ = cat_str(3,mm_strdup("range"),$2,$3);
   13082             : }
   13083             : |  ROWS frame_extent opt_window_exclusion_clause
   13084             :  { 
   13085           0 :  $$ = cat_str(3,mm_strdup("rows"),$2,$3);
   13086             : }
   13087             : |  GROUPS frame_extent opt_window_exclusion_clause
   13088             :  { 
   13089           0 :  $$ = cat_str(3,mm_strdup("groups"),$2,$3);
   13090             : }
   13091             : | 
   13092             :  { 
   13093           0 :  $$=EMPTY; }
   13094             : ;
   13095             : 
   13096             : 
   13097             :  frame_extent:
   13098             :  frame_bound
   13099             :  { 
   13100           0 :  $$ = $1;
   13101             : }
   13102             : |  BETWEEN frame_bound AND frame_bound
   13103             :  { 
   13104           0 :  $$ = cat_str(4,mm_strdup("between"),$2,mm_strdup("and"),$4);
   13105             : }
   13106             : ;
   13107             : 
   13108             : 
   13109             :  frame_bound:
   13110             :  UNBOUNDED PRECEDING
   13111             :  { 
   13112           0 :  $$ = mm_strdup("unbounded preceding");
   13113             : }
   13114             : |  UNBOUNDED FOLLOWING
   13115             :  { 
   13116           0 :  $$ = mm_strdup("unbounded following");
   13117             : }
   13118             : |  CURRENT_P ROW
   13119             :  { 
   13120           0 :  $$ = mm_strdup("current row");
   13121             : }
   13122             : |  a_expr PRECEDING
   13123             :  { 
   13124           0 :  $$ = cat_str(2,$1,mm_strdup("preceding"));
   13125             : }
   13126             : |  a_expr FOLLOWING
   13127             :  { 
   13128           0 :  $$ = cat_str(2,$1,mm_strdup("following"));
   13129             : }
   13130             : ;
   13131             : 
   13132             : 
   13133             :  opt_window_exclusion_clause:
   13134             :  EXCLUDE CURRENT_P ROW
   13135             :  { 
   13136           0 :  $$ = mm_strdup("exclude current row");
   13137             : }
   13138             : |  EXCLUDE GROUP_P
   13139             :  { 
   13140           0 :  $$ = mm_strdup("exclude group");
   13141             : }
   13142             : |  EXCLUDE TIES
   13143             :  { 
   13144           0 :  $$ = mm_strdup("exclude ties");
   13145             : }
   13146             : |  EXCLUDE NO OTHERS
   13147             :  { 
   13148           0 :  $$ = mm_strdup("exclude no others");
   13149             : }
   13150             : | 
   13151             :  { 
   13152           0 :  $$=EMPTY; }
   13153             : ;
   13154             : 
   13155             : 
   13156             :  row:
   13157             :  ROW '(' expr_list ')'
   13158             :  { 
   13159           0 :  $$ = cat_str(3,mm_strdup("row ("),$3,mm_strdup(")"));
   13160             : }
   13161             : |  ROW '(' ')'
   13162             :  { 
   13163           0 :  $$ = mm_strdup("row ( )");
   13164             : }
   13165             : |  '(' expr_list ',' a_expr ')'
   13166             :  { 
   13167           0 :  $$ = cat_str(5,mm_strdup("("),$2,mm_strdup(","),$4,mm_strdup(")"));
   13168             : }
   13169             : ;
   13170             : 
   13171             : 
   13172             :  explicit_row:
   13173             :  ROW '(' expr_list ')'
   13174             :  { 
   13175           0 :  $$ = cat_str(3,mm_strdup("row ("),$3,mm_strdup(")"));
   13176             : }
   13177             : |  ROW '(' ')'
   13178             :  { 
   13179           0 :  $$ = mm_strdup("row ( )");
   13180             : }
   13181             : ;
   13182             : 
   13183             : 
   13184             :  implicit_row:
   13185             :  '(' expr_list ',' a_expr ')'
   13186             :  { 
   13187           2 :  $$ = cat_str(5,mm_strdup("("),$2,mm_strdup(","),$4,mm_strdup(")"));
   13188             : }
   13189             : ;
   13190             : 
   13191             : 
   13192             :  sub_type:
   13193             :  ANY
   13194             :  { 
   13195           0 :  $$ = mm_strdup("any");
   13196             : }
   13197             : |  SOME
   13198             :  { 
   13199           0 :  $$ = mm_strdup("some");
   13200             : }
   13201             : |  ALL
   13202             :  { 
   13203           0 :  $$ = mm_strdup("all");
   13204             : }
   13205             : ;
   13206             : 
   13207             : 
   13208             :  all_Op:
   13209             :  Op
   13210             :  { 
   13211           0 :  $$ = $1;
   13212             : }
   13213             : |  MathOp
   13214             :  { 
   13215           0 :  $$ = $1;
   13216             : }
   13217             : ;
   13218             : 
   13219             : 
   13220             :  MathOp:
   13221             :  '+'
   13222             :  { 
   13223           0 :  $$ = mm_strdup("+");
   13224             : }
   13225             : |  '-'
   13226             :  { 
   13227           0 :  $$ = mm_strdup("-");
   13228             : }
   13229             : |  '*'
   13230             :  { 
   13231           0 :  $$ = mm_strdup("*");
   13232             : }
   13233             : |  '/'
   13234             :  { 
   13235           0 :  $$ = mm_strdup("/");
   13236             : }
   13237             : |  '%'
   13238             :  { 
   13239           0 :  $$ = mm_strdup("%");
   13240             : }
   13241             : |  '^'
   13242             :  { 
   13243           0 :  $$ = mm_strdup("^");
   13244             : }
   13245             : |  '<'
   13246             :  { 
   13247           0 :  $$ = mm_strdup("<");
   13248             : }
   13249             : |  '>'
   13250             :  { 
   13251           0 :  $$ = mm_strdup(">");
   13252             : }
   13253             : |  '='
   13254             :  { 
   13255           0 :  $$ = mm_strdup("=");
   13256             : }
   13257             : |  LESS_EQUALS
   13258             :  { 
   13259           0 :  $$ = mm_strdup("<=");
   13260             : }
   13261             : |  GREATER_EQUALS
   13262             :  { 
   13263           0 :  $$ = mm_strdup(">=");
   13264             : }
   13265             : |  NOT_EQUALS
   13266             :  { 
   13267           0 :  $$ = mm_strdup("<>");
   13268             : }
   13269             : ;
   13270             : 
   13271             : 
   13272             :  qual_Op:
   13273             :  Op
   13274             :  { 
   13275           4 :  $$ = $1;
   13276             : }
   13277             : |  OPERATOR '(' any_operator ')'
   13278             :  { 
   13279           0 :  $$ = cat_str(3,mm_strdup("operator ("),$3,mm_strdup(")"));
   13280             : }
   13281             : ;
   13282             : 
   13283             : 
   13284             :  qual_all_Op:
   13285             :  all_Op
   13286             :  { 
   13287           0 :  $$ = $1;
   13288             : }
   13289             : |  OPERATOR '(' any_operator ')'
   13290             :  { 
   13291           0 :  $$ = cat_str(3,mm_strdup("operator ("),$3,mm_strdup(")"));
   13292             : }
   13293             : ;
   13294             : 
   13295             : 
   13296             :  subquery_Op:
   13297             :  all_Op
   13298             :  { 
   13299           0 :  $$ = $1;
   13300             : }
   13301             : |  OPERATOR '(' any_operator ')'
   13302             :  { 
   13303           0 :  $$ = cat_str(3,mm_strdup("operator ("),$3,mm_strdup(")"));
   13304             : }
   13305             : |  LIKE
   13306             :  { 
   13307           0 :  $$ = mm_strdup("like");
   13308             : }
   13309             : |  NOT_LA LIKE
   13310             :  { 
   13311           0 :  $$ = mm_strdup("not like");
   13312             : }
   13313             : |  ILIKE
   13314             :  { 
   13315           0 :  $$ = mm_strdup("ilike");
   13316             : }
   13317             : |  NOT_LA ILIKE
   13318             :  { 
   13319           0 :  $$ = mm_strdup("not ilike");
   13320             : }
   13321             : ;
   13322             : 
   13323             : 
   13324             :  expr_list:
   13325             :  a_expr
   13326             :  { 
   13327         276 :  $$ = $1;
   13328             : }
   13329             : |  expr_list ',' a_expr
   13330             :  { 
   13331         498 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   13332             : }
   13333             : ;
   13334             : 
   13335             : 
   13336             :  func_arg_list:
   13337             :  func_arg_expr
   13338             :  { 
   13339           6 :  $$ = $1;
   13340             : }
   13341             : |  func_arg_list ',' func_arg_expr
   13342             :  { 
   13343           2 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   13344             : }
   13345             : ;
   13346             : 
   13347             : 
   13348             :  func_arg_expr:
   13349             :  a_expr
   13350             :  { 
   13351           8 :  $$ = $1;
   13352             : }
   13353             : |  param_name COLON_EQUALS a_expr
   13354             :  { 
   13355           0 :  $$ = cat_str(3,$1,mm_strdup(":="),$3);
   13356             : }
   13357             : |  param_name EQUALS_GREATER a_expr
   13358             :  { 
   13359           0 :  $$ = cat_str(3,$1,mm_strdup("=>"),$3);
   13360             : }
   13361             : ;
   13362             : 
   13363             : 
   13364             :  func_arg_list_opt:
   13365             :  func_arg_list
   13366             :  { 
   13367           0 :  $$ = $1;
   13368             : }
   13369             : | 
   13370             :  { 
   13371           0 :  $$=EMPTY; }
   13372             : ;
   13373             : 
   13374             : 
   13375             :  type_list:
   13376             :  Typename
   13377             :  { 
   13378          10 :  $$ = $1;
   13379             : }
   13380             : |  type_list ',' Typename
   13381             :  { 
   13382          10 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   13383             : }
   13384             : ;
   13385             : 
   13386             : 
   13387             :  array_expr:
   13388             :  '[' expr_list ']'
   13389             :  { 
   13390           0 :  $$ = cat_str(3,mm_strdup("["),$2,mm_strdup("]"));
   13391             : }
   13392             : |  '[' array_expr_list ']'
   13393             :  { 
   13394           0 :  $$ = cat_str(3,mm_strdup("["),$2,mm_strdup("]"));
   13395             : }
   13396             : |  '[' ']'
   13397             :  { 
   13398           0 :  $$ = mm_strdup("[ ]");
   13399             : }
   13400             : ;
   13401             : 
   13402             : 
   13403             :  array_expr_list:
   13404             :  array_expr
   13405             :  { 
   13406           0 :  $$ = $1;
   13407             : }
   13408             : |  array_expr_list ',' array_expr
   13409             :  { 
   13410           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   13411             : }
   13412             : ;
   13413             : 
   13414             : 
   13415             :  extract_list:
   13416             :  extract_arg FROM a_expr
   13417             :  { 
   13418           0 :  $$ = cat_str(3,$1,mm_strdup("from"),$3);
   13419             : }
   13420             : ;
   13421             : 
   13422             : 
   13423             :  extract_arg:
   13424             :  ecpg_ident
   13425             :  { 
   13426           0 :  $$ = $1;
   13427             : }
   13428             : |  YEAR_P
   13429             :  { 
   13430           0 :  $$ = mm_strdup("year");
   13431             : }
   13432             : |  MONTH_P
   13433             :  { 
   13434           0 :  $$ = mm_strdup("month");
   13435             : }
   13436             : |  DAY_P
   13437             :  { 
   13438           0 :  $$ = mm_strdup("day");
   13439             : }
   13440             : |  HOUR_P
   13441             :  { 
   13442           0 :  $$ = mm_strdup("hour");
   13443             : }
   13444             : |  MINUTE_P
   13445             :  { 
   13446           0 :  $$ = mm_strdup("minute");
   13447             : }
   13448             : |  SECOND_P
   13449             :  { 
   13450           0 :  $$ = mm_strdup("second");
   13451             : }
   13452             : |  ecpg_sconst
   13453             :  { 
   13454           0 :  $$ = $1;
   13455             : }
   13456             : ;
   13457             : 
   13458             : 
   13459             :  unicode_normal_form:
   13460             :  NFC
   13461             :  { 
   13462           0 :  $$ = mm_strdup("nfc");
   13463             : }
   13464             : |  NFD
   13465             :  { 
   13466           0 :  $$ = mm_strdup("nfd");
   13467             : }
   13468             : |  NFKC
   13469             :  { 
   13470           0 :  $$ = mm_strdup("nfkc");
   13471             : }
   13472             : |  NFKD
   13473             :  { 
   13474           0 :  $$ = mm_strdup("nfkd");
   13475             : }
   13476             : ;
   13477             : 
   13478             : 
   13479             :  overlay_list:
   13480             :  a_expr PLACING a_expr FROM a_expr FOR a_expr
   13481             :  { 
   13482           0 :  $$ = cat_str(7,$1,mm_strdup("placing"),$3,mm_strdup("from"),$5,mm_strdup("for"),$7);
   13483             : }
   13484             : |  a_expr PLACING a_expr FROM a_expr
   13485             :  { 
   13486           0 :  $$ = cat_str(5,$1,mm_strdup("placing"),$3,mm_strdup("from"),$5);
   13487             : }
   13488             : ;
   13489             : 
   13490             : 
   13491             :  position_list:
   13492             :  b_expr IN_P b_expr
   13493             :  { 
   13494           0 :  $$ = cat_str(3,$1,mm_strdup("in"),$3);
   13495             : }
   13496             : ;
   13497             : 
   13498             : 
   13499             :  substr_list:
   13500             :  a_expr FROM a_expr FOR a_expr
   13501             :  { 
   13502           0 :  $$ = cat_str(5,$1,mm_strdup("from"),$3,mm_strdup("for"),$5);
   13503             : }
   13504             : |  a_expr FOR a_expr FROM a_expr
   13505             :  { 
   13506           0 :  $$ = cat_str(5,$1,mm_strdup("for"),$3,mm_strdup("from"),$5);
   13507             : }
   13508             : |  a_expr FROM a_expr
   13509             :  { 
   13510           0 :  $$ = cat_str(3,$1,mm_strdup("from"),$3);
   13511             : }
   13512             : |  a_expr FOR a_expr
   13513             :  { 
   13514           0 :  $$ = cat_str(3,$1,mm_strdup("for"),$3);
   13515             : }
   13516             : |  a_expr SIMILAR a_expr ESCAPE a_expr
   13517             :  { 
   13518           0 :  $$ = cat_str(5,$1,mm_strdup("similar"),$3,mm_strdup("escape"),$5);
   13519             : }
   13520             : ;
   13521             : 
   13522             : 
   13523             :  trim_list:
   13524             :  a_expr FROM expr_list
   13525             :  { 
   13526           0 :  $$ = cat_str(3,$1,mm_strdup("from"),$3);
   13527             : }
   13528             : |  FROM expr_list
   13529             :  { 
   13530           0 :  $$ = cat_str(2,mm_strdup("from"),$2);
   13531             : }
   13532             : |  expr_list
   13533             :  { 
   13534           0 :  $$ = $1;
   13535             : }
   13536             : ;
   13537             : 
   13538             : 
   13539             :  in_expr:
   13540             :  select_with_parens
   13541             :  { 
   13542           0 :  $$ = $1;
   13543             : }
   13544             : |  '(' expr_list ')'
   13545             :  { 
   13546           0 :  $$ = cat_str(3,mm_strdup("("),$2,mm_strdup(")"));
   13547             : }
   13548             : ;
   13549             : 
   13550             : 
   13551             :  case_expr:
   13552             :  CASE case_arg when_clause_list case_default END_P
   13553             :  { 
   13554           0 :  $$ = cat_str(5,mm_strdup("case"),$2,$3,$4,mm_strdup("end"));
   13555             : }
   13556             : ;
   13557             : 
   13558             : 
   13559             :  when_clause_list:
   13560             :  when_clause
   13561             :  { 
   13562           0 :  $$ = $1;
   13563             : }
   13564             : |  when_clause_list when_clause
   13565             :  { 
   13566           0 :  $$ = cat_str(2,$1,$2);
   13567             : }
   13568             : ;
   13569             : 
   13570             : 
   13571             :  when_clause:
   13572             :  WHEN a_expr THEN a_expr
   13573             :  { 
   13574           0 :  $$ = cat_str(4,mm_strdup("when"),$2,mm_strdup("then"),$4);
   13575             : }
   13576             : ;
   13577             : 
   13578             : 
   13579             :  case_default:
   13580             :  ELSE a_expr
   13581             :  { 
   13582           0 :  $$ = cat_str(2,mm_strdup("else"),$2);
   13583             : }
   13584             : | 
   13585             :  { 
   13586           0 :  $$=EMPTY; }
   13587             : ;
   13588             : 
   13589             : 
   13590             :  case_arg:
   13591             :  a_expr
   13592             :  { 
   13593           0 :  $$ = $1;
   13594             : }
   13595             : | 
   13596             :  { 
   13597           0 :  $$=EMPTY; }
   13598             : ;
   13599             : 
   13600             : 
   13601             :  columnref:
   13602             :  ColId
   13603             :  { 
   13604         310 :  $$ = $1;
   13605             : }
   13606             : |  ColId indirection
   13607             :  { 
   13608           0 :  $$ = cat_str(2,$1,$2);
   13609             : }
   13610             : ;
   13611             : 
   13612             : 
   13613             :  indirection_el:
   13614             :  '.' attr_name
   13615             :  { 
   13616           0 :  $$ = cat_str(2,mm_strdup("."),$2);
   13617             : }
   13618             : |  '.' '*'
   13619             :  { 
   13620           0 :  $$ = mm_strdup(". *");
   13621             : }
   13622             : |  '[' a_expr ']'
   13623             :  { 
   13624           0 :  $$ = cat_str(3,mm_strdup("["),$2,mm_strdup("]"));
   13625             : }
   13626             : |  '[' opt_slice_bound ':' opt_slice_bound ']'
   13627             :  { 
   13628           0 :  $$ = cat_str(5,mm_strdup("["),$2,mm_strdup(":"),$4,mm_strdup("]"));
   13629             : }
   13630             : ;
   13631             : 
   13632             : 
   13633             :  opt_slice_bound:
   13634             :  a_expr
   13635             :  { 
   13636           0 :  $$ = $1;
   13637             : }
   13638             : | 
   13639             :  { 
   13640           0 :  $$=EMPTY; }
   13641             : ;
   13642             : 
   13643             : 
   13644             :  indirection:
   13645             :  indirection_el
   13646             :  { 
   13647           0 :  $$ = $1;
   13648             : }
   13649             : |  indirection indirection_el
   13650             :  { 
   13651           0 :  $$ = cat_str(2,$1,$2);
   13652             : }
   13653             : ;
   13654             : 
   13655             : 
   13656             :  opt_indirection:
   13657             : 
   13658             :  { 
   13659         380 :  $$=EMPTY; }
   13660             : |  opt_indirection indirection_el
   13661             :  { 
   13662           0 :  $$ = cat_str(2,$1,$2);
   13663             : }
   13664             : ;
   13665             : 
   13666             : 
   13667             :  opt_asymmetric:
   13668             :  ASYMMETRIC
   13669             :  { 
   13670           0 :  $$ = mm_strdup("asymmetric");
   13671             : }
   13672             : | 
   13673             :  { 
   13674           0 :  $$=EMPTY; }
   13675             : ;
   13676             : 
   13677             : 
   13678             :  json_passing_clause_opt:
   13679             :  PASSING json_arguments
   13680             :  { 
   13681           0 :  $$ = cat_str(2,mm_strdup("passing"),$2);
   13682             : }
   13683             : | 
   13684             :  { 
   13685           0 :  $$=EMPTY; }
   13686             : ;
   13687             : 
   13688             : 
   13689             :  json_arguments:
   13690             :  json_argument
   13691             :  { 
   13692           0 :  $$ = $1;
   13693             : }
   13694             : |  json_arguments ',' json_argument
   13695             :  { 
   13696           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   13697             : }
   13698             : ;
   13699             : 
   13700             : 
   13701             :  json_argument:
   13702             :  json_value_expr AS ColLabel
   13703             :  { 
   13704           0 :  $$ = cat_str(3,$1,mm_strdup("as"),$3);
   13705             : }
   13706             : ;
   13707             : 
   13708             : 
   13709             :  json_wrapper_behavior:
   13710             :  WITHOUT WRAPPER
   13711             :  { 
   13712           0 :  $$ = mm_strdup("without wrapper");
   13713             : }
   13714             : |  WITHOUT ARRAY WRAPPER
   13715             :  { 
   13716           0 :  $$ = mm_strdup("without array wrapper");
   13717             : }
   13718             : |  WITH WRAPPER
   13719             :  { 
   13720           0 :  $$ = mm_strdup("with wrapper");
   13721             : }
   13722             : |  WITH ARRAY WRAPPER
   13723             :  { 
   13724           0 :  $$ = mm_strdup("with array wrapper");
   13725             : }
   13726             : |  WITH CONDITIONAL ARRAY WRAPPER
   13727             :  { 
   13728           0 :  $$ = mm_strdup("with conditional array wrapper");
   13729             : }
   13730             : |  WITH UNCONDITIONAL ARRAY WRAPPER
   13731             :  { 
   13732           0 :  $$ = mm_strdup("with unconditional array wrapper");
   13733             : }
   13734             : |  WITH CONDITIONAL WRAPPER
   13735             :  { 
   13736           0 :  $$ = mm_strdup("with conditional wrapper");
   13737             : }
   13738             : |  WITH UNCONDITIONAL WRAPPER
   13739             :  { 
   13740           0 :  $$ = mm_strdup("with unconditional wrapper");
   13741             : }
   13742             : | 
   13743             :  { 
   13744           0 :  $$=EMPTY; }
   13745             : ;
   13746             : 
   13747             : 
   13748             :  json_behavior:
   13749             :  DEFAULT a_expr
   13750             :  { 
   13751           0 :  $$ = cat_str(2,mm_strdup("default"),$2);
   13752             : }
   13753             : |  json_behavior_type
   13754             :  { 
   13755           0 :  $$ = $1;
   13756             : }
   13757             : ;
   13758             : 
   13759             : 
   13760             :  json_behavior_type:
   13761             :  ERROR_P
   13762             :  { 
   13763           0 :  $$ = mm_strdup("error");
   13764             : }
   13765             : |  NULL_P
   13766             :  { 
   13767           0 :  $$ = mm_strdup("null");
   13768             : }
   13769             : |  TRUE_P
   13770             :  { 
   13771           0 :  $$ = mm_strdup("true");
   13772             : }
   13773             : |  FALSE_P
   13774             :  { 
   13775           0 :  $$ = mm_strdup("false");
   13776             : }
   13777             : |  UNKNOWN
   13778             :  { 
   13779           0 :  $$ = mm_strdup("unknown");
   13780             : }
   13781             : |  EMPTY_P ARRAY
   13782             :  { 
   13783           0 :  $$ = mm_strdup("empty array");
   13784             : }
   13785             : |  EMPTY_P OBJECT_P
   13786             :  { 
   13787           0 :  $$ = mm_strdup("empty object");
   13788             : }
   13789             : |  EMPTY_P
   13790             :  { 
   13791           0 :  $$ = mm_strdup("empty");
   13792             : }
   13793             : ;
   13794             : 
   13795             : 
   13796             :  json_behavior_clause_opt:
   13797             :  json_behavior ON EMPTY_P
   13798             :  { 
   13799           0 :  $$ = cat_str(2,$1,mm_strdup("on empty"));
   13800             : }
   13801             : |  json_behavior ON ERROR_P
   13802             :  { 
   13803           0 :  $$ = cat_str(2,$1,mm_strdup("on error"));
   13804             : }
   13805             : |  json_behavior ON EMPTY_P json_behavior ON ERROR_P
   13806             :  { 
   13807           0 :  $$ = cat_str(4,$1,mm_strdup("on empty"),$4,mm_strdup("on error"));
   13808             : }
   13809             : | 
   13810             :  { 
   13811           0 :  $$=EMPTY; }
   13812             : ;
   13813             : 
   13814             : 
   13815             :  json_on_error_clause_opt:
   13816             :  json_behavior ON ERROR_P
   13817             :  { 
   13818           0 :  $$ = cat_str(2,$1,mm_strdup("on error"));
   13819             : }
   13820             : | 
   13821             :  { 
   13822           0 :  $$=EMPTY; }
   13823             : ;
   13824             : 
   13825             : 
   13826             :  json_value_expr:
   13827             :  a_expr json_format_clause_opt
   13828             :  { 
   13829          42 :  $$ = cat_str(2,$1,$2);
   13830             : }
   13831             : ;
   13832             : 
   13833             : 
   13834             :  json_format_clause:
   13835             :  FORMAT_LA JSON ENCODING name
   13836             :  { 
   13837           2 :  $$ = cat_str(2,mm_strdup("format json encoding"),$4);
   13838             : }
   13839             : |  FORMAT_LA JSON
   13840             :  { 
   13841           8 :  $$ = mm_strdup("format json");
   13842             : }
   13843             : ;
   13844             : 
   13845             : 
   13846             :  json_format_clause_opt:
   13847             :  json_format_clause
   13848             :  { 
   13849          10 :  $$ = $1;
   13850             : }
   13851             : | 
   13852             :  { 
   13853          46 :  $$=EMPTY; }
   13854             : ;
   13855             : 
   13856             : 
   13857             :  json_quotes_clause_opt:
   13858             :  KEEP QUOTES ON SCALAR STRING_P
   13859             :  { 
   13860           0 :  $$ = mm_strdup("keep quotes on scalar string");
   13861             : }
   13862             : |  KEEP QUOTES
   13863             :  { 
   13864           0 :  $$ = mm_strdup("keep quotes");
   13865             : }
   13866             : |  OMIT QUOTES ON SCALAR STRING_P
   13867             :  { 
   13868           0 :  $$ = mm_strdup("omit quotes on scalar string");
   13869             : }
   13870             : |  OMIT QUOTES
   13871             :  { 
   13872           0 :  $$ = mm_strdup("omit quotes");
   13873             : }
   13874             : | 
   13875             :  { 
   13876           0 :  $$=EMPTY; }
   13877             : ;
   13878             : 
   13879             : 
   13880             :  json_returning_clause_opt:
   13881             :  RETURNING Typename json_format_clause_opt
   13882             :  { 
   13883          14 :  $$ = cat_str(3,mm_strdup("returning"),$2,$3);
   13884             : }
   13885             : | 
   13886             :  { 
   13887          12 :  $$=EMPTY; }
   13888             : ;
   13889             : 
   13890             : 
   13891             :  json_predicate_type_constraint:
   13892             :  JSON %prec UNBOUNDED
   13893             :  { 
   13894           8 :  $$ = mm_strdup("json");
   13895             : }
   13896             : |  JSON VALUE_P
   13897             :  { 
   13898           2 :  $$ = mm_strdup("json value");
   13899             : }
   13900             : |  JSON ARRAY
   13901             :  { 
   13902           2 :  $$ = mm_strdup("json array");
   13903             : }
   13904             : |  JSON OBJECT_P
   13905             :  { 
   13906           2 :  $$ = mm_strdup("json object");
   13907             : }
   13908             : |  JSON SCALAR
   13909             :  { 
   13910           2 :  $$ = mm_strdup("json scalar");
   13911             : }
   13912             : ;
   13913             : 
   13914             : 
   13915             :  json_key_uniqueness_constraint_opt:
   13916             :  WITH UNIQUE KEYS
   13917             :  { 
   13918           6 :  $$ = mm_strdup("with unique keys");
   13919             : }
   13920             : |  WITH UNIQUE %prec UNBOUNDED
   13921             :  { 
   13922           2 :  $$ = mm_strdup("with unique");
   13923             : }
   13924             : |  WITHOUT UNIQUE KEYS
   13925             :  { 
   13926           4 :  $$ = mm_strdup("without unique keys");
   13927             : }
   13928             : |  WITHOUT UNIQUE %prec UNBOUNDED
   13929             :  { 
   13930           2 :  $$ = mm_strdup("without unique");
   13931             : }
   13932             : |  %prec UNBOUNDED
   13933             :  { 
   13934          24 :  $$=EMPTY; }
   13935             : ;
   13936             : 
   13937             : 
   13938             :  json_name_and_value_list:
   13939             :  json_name_and_value
   13940             :  { 
   13941           6 :  $$ = $1;
   13942             : }
   13943             : |  json_name_and_value_list ',' json_name_and_value
   13944             :  { 
   13945           8 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   13946             : }
   13947             : ;
   13948             : 
   13949             : 
   13950             :  json_name_and_value:
   13951             :  c_expr VALUE_P json_value_expr
   13952             :  { 
   13953           0 :  $$ = cat_str(3,$1,mm_strdup("value"),$3);
   13954             : }
   13955             : |  a_expr ':' json_value_expr
   13956             :  { 
   13957          14 :  $$ = cat_str(3,$1,mm_strdup(":"),$3);
   13958             : }
   13959             : ;
   13960             : 
   13961             : 
   13962             :  json_object_constructor_null_clause_opt:
   13963             :  NULL_P ON NULL_P
   13964             :  { 
   13965           0 :  $$ = mm_strdup("null on null");
   13966             : }
   13967             : |  ABSENT ON NULL_P
   13968             :  { 
   13969           4 :  $$ = mm_strdup("absent on null");
   13970             : }
   13971             : | 
   13972             :  { 
   13973           2 :  $$=EMPTY; }
   13974             : ;
   13975             : 
   13976             : 
   13977             :  json_array_constructor_null_clause_opt:
   13978             :  NULL_P ON NULL_P
   13979             :  { 
   13980           0 :  $$ = mm_strdup("null on null");
   13981             : }
   13982             : |  ABSENT ON NULL_P
   13983             :  { 
   13984           0 :  $$ = mm_strdup("absent on null");
   13985             : }
   13986             : | 
   13987             :  { 
   13988           0 :  $$=EMPTY; }
   13989             : ;
   13990             : 
   13991             : 
   13992             :  json_value_expr_list:
   13993             :  json_value_expr
   13994             :  { 
   13995           0 :  $$ = $1;
   13996             : }
   13997             : |  json_value_expr_list ',' json_value_expr
   13998             :  { 
   13999           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   14000             : }
   14001             : ;
   14002             : 
   14003             : 
   14004             :  json_aggregate_func:
   14005             :  JSON_OBJECTAGG '(' json_name_and_value json_object_constructor_null_clause_opt json_key_uniqueness_constraint_opt json_returning_clause_opt ')'
   14006             :  { 
   14007           0 :  $$ = cat_str(6,mm_strdup("json_objectagg ("),$3,$4,$5,$6,mm_strdup(")"));
   14008             : }
   14009             : |  JSON_ARRAYAGG '(' json_value_expr json_array_aggregate_order_by_clause_opt json_array_constructor_null_clause_opt json_returning_clause_opt ')'
   14010             :  { 
   14011           0 :  $$ = cat_str(6,mm_strdup("json_arrayagg ("),$3,$4,$5,$6,mm_strdup(")"));
   14012             : }
   14013             : ;
   14014             : 
   14015             : 
   14016             :  json_array_aggregate_order_by_clause_opt:
   14017             :  ORDER BY sortby_list
   14018             :  { 
   14019           0 :  $$ = cat_str(2,mm_strdup("order by"),$3);
   14020             : }
   14021             : | 
   14022             :  { 
   14023           0 :  $$=EMPTY; }
   14024             : ;
   14025             : 
   14026             : 
   14027             :  opt_target_list:
   14028             :  target_list
   14029             :  { 
   14030         238 :  $$ = $1;
   14031             : }
   14032             : | 
   14033             :  { 
   14034           0 :  $$=EMPTY; }
   14035             : ;
   14036             : 
   14037             : 
   14038             :  target_list:
   14039             :  target_el
   14040             :  { 
   14041         242 :  $$ = $1;
   14042             : }
   14043             : |  target_list ',' target_el
   14044             :  { 
   14045         150 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   14046             : }
   14047             : ;
   14048             : 
   14049             : 
   14050             :  target_el:
   14051             :  a_expr AS ColLabel
   14052             :  { 
   14053           6 :  $$ = cat_str(3,$1,mm_strdup("as"),$3);
   14054             : }
   14055             : |  a_expr BareColLabel
   14056             :  { 
   14057          16 :  $$ = cat_str(2,$1,$2);
   14058             : }
   14059             : |  a_expr
   14060             :  { 
   14061         318 :  $$ = $1;
   14062             : }
   14063             : |  '*'
   14064             :  { 
   14065          52 :  $$ = mm_strdup("*");
   14066             : }
   14067             : ;
   14068             : 
   14069             : 
   14070             :  qualified_name_list:
   14071             :  qualified_name
   14072             :  { 
   14073           0 :  $$ = $1;
   14074             : }
   14075             : |  qualified_name_list ',' qualified_name
   14076             :  { 
   14077           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   14078             : }
   14079             : ;
   14080             : 
   14081             : 
   14082             :  qualified_name:
   14083             :  ColId
   14084             :  { 
   14085         556 :  $$ = $1;
   14086             : }
   14087             : |  ColId indirection
   14088             :  { 
   14089           0 :  $$ = cat_str(2,$1,$2);
   14090             : }
   14091             : ;
   14092             : 
   14093             : 
   14094             :  name_list:
   14095             :  name
   14096             :  { 
   14097           4 :  $$ = $1;
   14098             : }
   14099             : |  name_list ',' name
   14100             :  { 
   14101           2 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   14102             : }
   14103             : ;
   14104             : 
   14105             : 
   14106             :  name:
   14107             :  ColId
   14108             :  { 
   14109        1352 :  $$ = $1;
   14110             : }
   14111             : ;
   14112             : 
   14113             : 
   14114             :  attr_name:
   14115             :  ColLabel
   14116             :  { 
   14117           0 :  $$ = $1;
   14118             : }
   14119             : ;
   14120             : 
   14121             : 
   14122             :  file_name:
   14123             :  ecpg_sconst
   14124             :  { 
   14125           0 :  $$ = $1;
   14126             : }
   14127             : ;
   14128             : 
   14129             : 
   14130             :  func_name:
   14131             :  type_function_name
   14132             :  { 
   14133          46 :  $$ = $1;
   14134             : }
   14135             : |  ColId indirection
   14136             :  { 
   14137           0 :  $$ = cat_str(2,$1,$2);
   14138             : }
   14139             : ;
   14140             : 
   14141             : 
   14142             :  AexprConst:
   14143             :  Iconst
   14144             :  { 
   14145         320 :  $$ = $1;
   14146             : }
   14147             : |  ecpg_fconst
   14148             :  { 
   14149          42 :  $$ = $1;
   14150             : }
   14151             : |  ecpg_sconst
   14152             :  { 
   14153         306 :  $$ = $1;
   14154             : }
   14155             : |  ecpg_bconst
   14156             :  { 
   14157           2 :  $$ = $1;
   14158             : }
   14159             : |  ecpg_xconst
   14160             :  { 
   14161           2 :  $$ = $1;
   14162             : }
   14163             : |  func_name ecpg_sconst
   14164             :  { 
   14165           0 :  $$ = cat_str(2,$1,$2);
   14166             : }
   14167             : |  func_name '(' func_arg_list opt_sort_clause ')' ecpg_sconst
   14168             :  { 
   14169           0 :  $$ = cat_str(6,$1,mm_strdup("("),$3,$4,mm_strdup(")"),$6);
   14170             : }
   14171             : |  ConstTypename ecpg_sconst
   14172             :  { 
   14173           0 :  $$ = cat_str(2,$1,$2);
   14174             : }
   14175             : |  ConstInterval ecpg_sconst opt_interval
   14176             :  { 
   14177           0 :  $$ = cat_str(3,$1,$2,$3);
   14178             : }
   14179             : |  ConstInterval '(' Iconst ')' ecpg_sconst
   14180             :  { 
   14181           0 :  $$ = cat_str(5,$1,mm_strdup("("),$3,mm_strdup(")"),$5);
   14182             : }
   14183             : |  TRUE_P
   14184             :  { 
   14185           6 :  $$ = mm_strdup("true");
   14186             : }
   14187             : |  FALSE_P
   14188             :  { 
   14189           4 :  $$ = mm_strdup("false");
   14190             : }
   14191             : |  NULL_P
   14192             :  { 
   14193          64 :  $$ = mm_strdup("null");
   14194             : }
   14195         182 :     | civar         { $$ = $1; }
   14196           6 :     | civarind      { $$ = $1; }
   14197             : ;
   14198             : 
   14199             : 
   14200             :  Iconst:
   14201             :  ICONST
   14202        2354 :     { $$ = make_name(); }
   14203             : ;
   14204             : 
   14205             : 
   14206             :  SignedIconst:
   14207             :  Iconst
   14208             :  { 
   14209          44 :  $$ = $1;
   14210             : }
   14211          20 :     | civar { $$ = $1; }
   14212             : |  '+' Iconst
   14213             :  { 
   14214           0 :  $$ = cat_str(2,mm_strdup("+"),$2);
   14215             : }
   14216             : |  '-' Iconst
   14217             :  { 
   14218           0 :  $$ = cat_str(2,mm_strdup("-"),$2);
   14219             : }
   14220             : ;
   14221             : 
   14222             : 
   14223             :  RoleId:
   14224             :  RoleSpec
   14225             :  { 
   14226          54 :  $$ = $1;
   14227             : }
   14228             : ;
   14229             : 
   14230             : 
   14231             :  RoleSpec:
   14232             :  NonReservedWord
   14233             :  { 
   14234          60 :  $$ = $1;
   14235             : }
   14236             : |  CURRENT_ROLE
   14237             :  { 
   14238           0 :  $$ = mm_strdup("current_role");
   14239             : }
   14240             : |  CURRENT_USER
   14241             :  { 
   14242           0 :  $$ = mm_strdup("current_user");
   14243             : }
   14244             : |  SESSION_USER
   14245             :  { 
   14246           0 :  $$ = mm_strdup("session_user");
   14247             : }
   14248             : ;
   14249             : 
   14250             : 
   14251             :  role_list:
   14252             :  RoleSpec
   14253             :  { 
   14254           0 :  $$ = $1;
   14255             : }
   14256             : |  role_list ',' RoleSpec
   14257             :  { 
   14258           0 :  $$ = cat_str(3,$1,mm_strdup(","),$3);
   14259             : }
   14260             : ;
   14261             : 
   14262             : 
   14263             :  NonReservedWord:
   14264             :  ecpg_ident
   14265             :  { 
   14266          86 :  $$ = $1;
   14267             : }
   14268             : |  unreserved_keyword
   14269             :  { 
   14270           6 :  $$ = $1;
   14271             : }
   14272             : |  col_name_keyword
   14273             :  { 
   14274           0 :  $$ = $1;
   14275             : }
   14276             : |  type_func_name_keyword
   14277             :  { 
   14278           0 :  $$ = $1;
   14279             : }
   14280             : ;
   14281             : 
   14282             : 
   14283             :  BareColLabel:
   14284             :  ecpg_ident
   14285             :  { 
   14286          16 :  $$ = $1;
   14287             : }
   14288             : |  bare_label_keyword
   14289             :  { 
   14290           0 :  $$ = $1;
   14291             : }
   14292             : ;
   14293             : 
   14294             : 
   14295             :  unreserved_keyword:
   14296             :  ABORT_P
   14297             :  { 
   14298           0 :  $$ = mm_strdup("abort");
   14299             : }
   14300             : |  ABSENT
   14301             :  { 
   14302           0 :  $$ = mm_strdup("absent");
   14303             : }
   14304             : |  ABSOLUTE_P
   14305             :  { 
   14306           0 :  $$ = mm_strdup("absolute");
   14307             : }
   14308             : |  ACCESS
   14309             :  { 
   14310           2 :  $$ = mm_strdup("access");
   14311             : }
   14312             : |  ACTION
   14313             :  { 
   14314           0 :  $$ = mm_strdup("action");
   14315             : }
   14316             : |  ADD_P
   14317             :  { 
   14318           0 :  $$ = mm_strdup("add");
   14319             : }
   14320             : |  ADMIN
   14321             :  { 
   14322           0 :  $$ = mm_strdup("admin");
   14323             : }
   14324             : |  AFTER
   14325             :  { 
   14326           0 :  $$ = mm_strdup("after");
   14327             : }
   14328             : |  AGGREGATE
   14329             :  { 
   14330           0 :  $$ = mm_strdup("aggregate");
   14331             : }
   14332             : |  ALSO
   14333             :  { 
   14334           0 :  $$ = mm_strdup("also");
   14335             : }
   14336             : |  ALTER
   14337             :  { 
   14338           0 :  $$ = mm_strdup("alter");
   14339             : }
   14340             : |  ALWAYS
   14341             :  { 
   14342           0 :  $$ = mm_strdup("always");
   14343             : }
   14344             : |  ASENSITIVE
   14345             :  { 
   14346           0 :  $$ = mm_strdup("asensitive");
   14347             : }
   14348             : |  ASSERTION
   14349             :  { 
   14350           0 :  $$ = mm_strdup("assertion");
   14351             : }
   14352             : |  ASSIGNMENT
   14353             :  { 
   14354           0 :  $$ = mm_strdup("assignment");
   14355             : }
   14356             : |  AT
   14357             :  { 
   14358           0 :  $$ = mm_strdup("at");
   14359             : }
   14360             : |  ATOMIC
   14361             :  { 
   14362           0 :  $$ = mm_strdup("atomic");
   14363             : }
   14364             : |  ATTACH
   14365             :  { 
   14366           0 :  $$ = mm_strdup("attach");
   14367             : }
   14368             : |  ATTRIBUTE
   14369             :  { 
   14370           0 :  $$ = mm_strdup("attribute");
   14371             : }
   14372             : |  BACKWARD
   14373             :  { 
   14374           0 :  $$ = mm_strdup("backward");
   14375             : }
   14376             : |  BEFORE
   14377             :  { 
   14378           0 :  $$ = mm_strdup("before");
   14379             : }
   14380             : |  BEGIN_P
   14381             :  { 
   14382           0 :  $$ = mm_strdup("begin");
   14383             : }
   14384             : |  BREADTH
   14385             :  { 
   14386           0 :  $$ = mm_strdup("breadth");
   14387             : }
   14388             : |  BY
   14389             :  { 
   14390           0 :  $$ = mm_strdup("by");
   14391             : }
   14392             : |  CACHE
   14393             :  { 
   14394           0 :  $$ = mm_strdup("cache");
   14395             : }
   14396             : |  CALL
   14397             :  { 
   14398           0 :  $$ = mm_strdup("call");
   14399             : }
   14400             : |  CALLED
   14401             :  { 
   14402           0 :  $$ = mm_strdup("called");
   14403             : }
   14404             : |  CASCADE
   14405             :  { 
   14406           0 :  $$ = mm_strdup("cascade");
   14407             : }
   14408             : |  CASCADED
   14409             :  { 
   14410           0 :  $$ = mm_strdup("cascaded");
   14411             : }
   14412             : |  CATALOG_P
   14413             :  { 
   14414           0 :  $$ = mm_strdup("catalog");
   14415             : }
   14416             : |  CHAIN
   14417             :  { 
   14418           0 :  $$ = mm_strdup("chain");
   14419             : }
   14420             : |  CHARACTERISTICS
   14421             :  { 
   14422           0 :  $$ = mm_strdup("characteristics");
   14423             : }
   14424             : |  CHECKPOINT
   14425             :  { 
   14426           0 :  $$ = mm_strdup("checkpoint");
   14427             : }
   14428             : |  CLASS
   14429             :  { 
   14430           0 :  $$ = mm_strdup("class");
   14431             : }
   14432             : |  CLOSE
   14433             :  { 
   14434           0 :  $$ = mm_strdup("close");
   14435             : }
   14436             : |  CLUSTER
   14437             :  { 
   14438           0 :  $$ = mm_strdup("cluster");
   14439             : }
   14440             : |  COLUMNS
   14441             :  { 
   14442           0 :  $$ = mm_strdup("columns");
   14443             : }
   14444             : |  COMMENT
   14445             :  { 
   14446           2 :  $$ = mm_strdup("comment");
   14447             : }
   14448             : |  COMMENTS
   14449             :  { 
   14450           0 :  $$ = mm_strdup("comments");
   14451             : }
   14452             : |  COMMIT
   14453             :  { 
   14454           0 :  $$ = mm_strdup("commit");
   14455             : }
   14456             : |  COMMITTED
   14457             :  { 
   14458           0 :  $$ = mm_strdup("committed");
   14459             : }
   14460             : |  COMPRESSION
   14461             :  { 
   14462           0 :  $$ = mm_strdup("compression");
   14463             : }
   14464             : |  CONDITIONAL
   14465             :  { 
   14466           0 :  $$ = mm_strdup("conditional");
   14467             : }
   14468             : |  CONFIGURATION
   14469             :  { 
   14470           0 :  $$ = mm_strdup("configuration");
   14471             : }
   14472             : |  CONFLICT
   14473             :  { 
   14474           0 :  $$ = mm_strdup("conflict");
   14475             : }
   14476             : |  CONSTRAINTS
   14477             :  { 
   14478           0 :  $$ = mm_strdup("constraints");
   14479             : }
   14480             : |  CONTENT_P
   14481             :  { 
   14482           0 :  $$ = mm_strdup("content");
   14483             : }
   14484             : |  CONTINUE_P
   14485             :  { 
   14486           0 :  $$ = mm_strdup("continue");
   14487             : }
   14488             : |  CONVERSION_P
   14489             :  { 
   14490           0 :  $$ = mm_strdup("conversion");
   14491             : }
   14492             : |  COPY
   14493             :  { 
   14494           0 :  $$ = mm_strdup("copy");
   14495             : }
   14496             : |  COST
   14497             :  { 
   14498           0 :  $$ = mm_strdup("cost");
   14499             : }
   14500             : |  CSV
   14501             :  { 
   14502           0 :  $$ = mm_strdup("csv");
   14503             : }
   14504             : |  CUBE
   14505             :  { 
   14506           0 :  $$ = mm_strdup("cube");
   14507             : }
   14508             : |  CURSOR
   14509             :  { 
   14510           0 :  $$ = mm_strdup("cursor");
   14511             : }
   14512             : |  CYCLE
   14513             :  { 
   14514           0 :  $$ = mm_strdup("cycle");
   14515             : }
   14516             : |  DATA_P
   14517             :  { 
   14518           0 :  $$ = mm_strdup("data");
   14519             : }
   14520             : |  DATABASE
   14521             :  { 
   14522           4 :  $$ = mm_strdup("database");
   14523             : }
   14524             : |  DEALLOCATE
   14525             :  { 
   14526           0 :  $$ = mm_strdup("deallocate");
   14527             : }
   14528             : |  DECLARE
   14529             :  { 
   14530           0 :  $$ = mm_strdup("declare");
   14531             : }
   14532             : |  DEFAULTS
   14533             :  { 
   14534           0 :  $$ = mm_strdup("defaults");
   14535             : }
   14536             : |  DEFERRED
   14537             :  { 
   14538           0 :  $$ = mm_strdup("deferred");
   14539             : }
   14540             : |  DEFINER
   14541             :  { 
   14542           0 :  $$ = mm_strdup("definer");
   14543             : }
   14544             : |  DELETE_P
   14545             :  { 
   14546           0 :  $$ = mm_strdup("delete");
   14547             : }
   14548             : |  DELIMITER
   14549             :  { 
   14550           0 :  $$ = mm_strdup("delimiter");
   14551             : }
   14552             : |  DELIMITERS
   14553             :  { 
   14554           0 :  $$ = mm_strdup("delimiters");
   14555             : }
   14556             : |  DEPENDS
   14557             :  { 
   14558           0 :  $$ = mm_strdup("depends");
   14559             : }
   14560             : |  DEPTH
   14561             :  { 
   14562           0 :  $$ = mm_strdup("depth");
   14563             : }
   14564             : |  DETACH
   14565             :  { 
   14566           0 :  $$ = mm_strdup("detach");
   14567             : }
   14568             : |  DICTIONARY
   14569             :  { 
   14570           0 :  $$ = mm_strdup("dictionary");
   14571             : }
   14572             : |  DISABLE_P
   14573             :  { 
   14574           0 :  $$ = mm_strdup("disable");
   14575             : }
   14576             : |  DISCARD
   14577             :  { 
   14578           0 :  $$ = mm_strdup("discard");
   14579             : }
   14580             : |  DOCUMENT_P
   14581             :  { 
   14582           0 :  $$ = mm_strdup("document");
   14583             : }
   14584             : |  DOMAIN_P
   14585             :  { 
   14586           0 :  $$ = mm_strdup("domain");
   14587             : }
   14588             : |  DOUBLE_P
   14589             :  { 
   14590           0 :  $$ = mm_strdup("double");
   14591             : }
   14592             : |  DROP
   14593             :  { 
   14594           0 :  $$ = mm_strdup("drop");
   14595             : }
   14596             : |  EACH
   14597             :  { 
   14598           0 :  $$ = mm_strdup("each");
   14599             : }
   14600             : |  EMPTY_P
   14601             :  { 
   14602           0 :  $$ = mm_strdup("empty");
   14603             : }
   14604             : |  ENABLE_P
   14605             :  { 
   14606           0 :  $$ = mm_strdup("enable");
   14607             : }
   14608             : |  ENCODING
   14609             :  { 
   14610           0 :  $$ = mm_strdup("encoding");
   14611             : }
   14612             : |  ENCRYPTED
   14613             :  { 
   14614           0 :  $$ = mm_strdup("encrypted");
   14615             : }
   14616             : |  ENUM_P
   14617             :  { 
   14618           0 :  $$ = mm_strdup("enum");
   14619             : }
   14620             : |  ERROR_P
   14621             :  { 
   14622           4 :  $$ = mm_strdup("error");
   14623             : }
   14624             : |  ESCAPE
   14625             :  { 
   14626           2 :  $$ = mm_strdup("escape");
   14627             : }
   14628             : |  EVENT
   14629             :  { 
   14630           0 :  $$ = mm_strdup("event");
   14631             : }
   14632             : |  EXCLUDE
   14633             :  { 
   14634           0 :  $$ = mm_strdup("exclude");
   14635             : }
   14636             : |  EXCLUDING
   14637             :  { 
   14638           0 :  $$ = mm_strdup("excluding");
   14639             : }
   14640             : |  EXCLUSIVE
   14641             :  { 
   14642           0 :  $$ = mm_strdup("exclusive");
   14643             : }
   14644             : |  EXECUTE
   14645             :  { 
   14646           0 :  $$ = mm_strdup("execute");
   14647             : }
   14648             : |  EXPLAIN
   14649             :  { 
   14650           0 :  $$ = mm_strdup("explain");
   14651             : }
   14652             : |  EXPRESSION
   14653             :  { 
   14654           0 :  $$ = mm_strdup("expression");
   14655             : }
   14656             : |  EXTENSION
   14657             :  { 
   14658           0 :  $$ = mm_strdup("extension");
   14659             : }
   14660             : |  EXTERNAL
   14661             :  { 
   14662           0 :  $$ = mm_strdup("external");
   14663             : }
   14664             : |  FAMILY
   14665             :  { 
   14666          16 :  $$ = mm_strdup("family");
   14667             : }
   14668             : |  FILTER
   14669             :  { 
   14670           0 :  $$ = mm_strdup("filter");
   14671             : }
   14672             : |  FINALIZE
   14673             :  { 
   14674           0 :  $$ = mm_strdup("finalize");
   14675             : }
   14676             : |  FIRST_P
   14677             :  { 
   14678           4 :  $$ = mm_strdup("first");
   14679             : }
   14680             : |  FOLLOWING
   14681             :  { 
   14682           0 :  $$ = mm_strdup("following");
   14683             : }
   14684             : |  FORCE
   14685             :  { 
   14686           0 :  $$ = mm_strdup("force");
   14687             : }
   14688             : |  FORMAT
   14689             :  { 
   14690           0 :  $$ = mm_strdup("format");
   14691             : }
   14692             : |  FORWARD
   14693             :  { 
   14694           0 :  $$ = mm_strdup("forward");
   14695             : }
   14696             : |  FUNCTION
   14697             :  { 
   14698           0 :  $$ = mm_strdup("function");
   14699             : }
   14700             : |  FUNCTIONS
   14701             :  { 
   14702           0 :  $$ = mm_strdup("functions");
   14703             : }
   14704             : |  GENERATED
   14705             :  { 
   14706           0 :  $$ = mm_strdup("generated");
   14707             : }
   14708             : |  GLOBAL
   14709             :  { 
   14710           0 :  $$ = mm_strdup("global");
   14711             : }
   14712             : |  GRANTED
   14713             :  { 
   14714           0 :  $$ = mm_strdup("granted");
   14715             : }
   14716             : |  GROUPS
   14717             :  { 
   14718           0 :  $$ = mm_strdup("groups");
   14719             : }
   14720             : |  HANDLER
   14721             :  { 
   14722           0 :  $$ = mm_strdup("handler");
   14723             : }
   14724             : |  HEADER_P
   14725             :  { 
   14726           0 :  $$ = mm_strdup("header");
   14727             : }
   14728             : |  HOLD
   14729             :  { 
   14730           0 :  $$ = mm_strdup("hold");
   14731             : }
   14732             : |  IDENTITY_P
   14733             :  { 
   14734           0 :  $$ = mm_strdup("identity");
   14735             : }
   14736             : |  IF_P
   14737             :  { 
   14738           0 :  $$ = mm_strdup("if");
   14739             : }
   14740             : |  IMMEDIATE
   14741             :  { 
   14742           0 :  $$ = mm_strdup("immediate");
   14743             : }
   14744             : |  IMMUTABLE
   14745             :  { 
   14746           0 :  $$ = mm_strdup("immutable");
   14747             : }
   14748             : |  IMPLICIT_P
   14749             :  { 
   14750           0 :  $$ = mm_strdup("implicit");
   14751             : }
   14752             : |  IMPORT_P
   14753             :  { 
   14754           0 :  $$ = mm_strdup("import");
   14755             : }
   14756             : |  INCLUDE
   14757             :  { 
   14758           0 :  $$ = mm_strdup("include");
   14759             : }
   14760             : |  INCLUDING
   14761             :  { 
   14762           0 :  $$ = mm_strdup("including");
   14763             : }
   14764             : |  INCREMENT
   14765             :  { 
   14766           0 :  $$ = mm_strdup("increment");
   14767             : }
   14768             : |  INDENT
   14769             :  { 
   14770           0 :  $$ = mm_strdup("indent");
   14771             : }
   14772             : |  INDEX
   14773             :  { 
   14774           8 :  $$ = mm_strdup("index");
   14775             : }
   14776             : |  INDEXES
   14777             :  { 
   14778           0 :  $$ = mm_strdup("indexes");
   14779             : }
   14780             : |  INHERIT
   14781             :  { 
   14782           0 :  $$ = mm_strdup("inherit");
   14783             : }
   14784             : |  INHERITS
   14785             :  { 
   14786           0 :  $$ = mm_strdup("inherits");
   14787             : }
   14788             : |  INLINE_P
   14789             :  { 
   14790           0 :  $$ = mm_strdup("inline");
   14791             : }
   14792             : |  INSENSITIVE
   14793             :  { 
   14794           0 :  $$ = mm_strdup("insensitive");
   14795             : }
   14796             : |  INSERT
   14797             :  { 
   14798           0 :  $$ = mm_strdup("insert");
   14799             : }
   14800             : |  INSTEAD
   14801             :  { 
   14802           0 :  $$ = mm_strdup("instead");
   14803             : }
   14804             : |  INVOKER
   14805             :  { 
   14806           0 :  $$ = mm_strdup("invoker");
   14807             : }
   14808             : |  ISOLATION
   14809             :  { 
   14810           0 :  $$ = mm_strdup("isolation");
   14811             : }
   14812             : |  KEEP
   14813             :  { 
   14814           0 :  $$ = mm_strdup("keep");
   14815             : }
   14816             : |  KEY
   14817             :  { 
   14818           0 :  $$ = mm_strdup("key");
   14819             : }
   14820             : |  KEYS
   14821             :  { 
   14822           0 :  $$ = mm_strdup("keys");
   14823             : }
   14824             : |  LABEL
   14825             :  { 
   14826           0 :  $$ = mm_strdup("label");
   14827             : }
   14828             : |  LANGUAGE
   14829             :  { 
   14830           0 :  $$ = mm_strdup("language");
   14831             : }
   14832             : |  LARGE_P
   14833             :  { 
   14834           0 :  $$ = mm_strdup("large");
   14835             : }
   14836             : |  LAST_P
   14837             :  { 
   14838           0 :  $$ = mm_strdup("last");
   14839             : }
   14840             : |  LEAKPROOF
   14841             :  { 
   14842           0 :  $$ = mm_strdup("leakproof");
   14843             : }
   14844             : |  LEVEL
   14845             :  { 
   14846           0 :  $$ = mm_strdup("level");
   14847             : }
   14848             : |  LISTEN
   14849             :  { 
   14850           0 :  $$ = mm_strdup("listen");
   14851             : }
   14852             : |  LOAD
   14853             :  { 
   14854           0 :  $$ = mm_strdup("load");
   14855             : }
   14856             : |  LOCAL
   14857             :  { 
   14858           0 :  $$ = mm_strdup("local");
   14859             : }
   14860             : |  LOCATION
   14861             :  { 
   14862           0 :  $$ = mm_strdup("location");
   14863             : }
   14864             : |  LOCK_P
   14865             :  { 
   14866           0 :  $$ = mm_strdup("lock");
   14867             : }
   14868             : |  LOCKED
   14869             :  { 
   14870           0 :  $$ = mm_strdup("locked");
   14871             : }
   14872             : |  LOGGED
   14873             :  { 
   14874           0 :  $$ = mm_strdup("logged");
   14875             : }
   14876             : |  MAPPING
   14877             :  { 
   14878           0 :  $$ = mm_strdup("mapping");
   14879             : }
   14880             : |  MATCH
   14881             :  { 
   14882           0 :  $$ = mm_strdup("match");
   14883             : }
   14884             : |  MATCHED
   14885             :  { 
   14886           0 :  $$ = mm_strdup("matched");
   14887             : }
   14888             : |  MATERIALIZED
   14889             :  { 
   14890           0 :  $$ = mm_strdup("materialized");
   14891             : }
   14892             : |  MAXVALUE
   14893             :  { 
   14894           0 :  $$ = mm_strdup("maxvalue");
   14895             : }
   14896             : |  MERGE
   14897             :  { 
   14898           0 :  $$ = mm_strdup("merge");
   14899             : }
   14900             : |  METHOD
   14901             :  { 
   14902           0 :  $$ = mm_strdup("method");
   14903             : }
   14904             : |  MINVALUE
   14905             :  { 
   14906           0 :  $$ = mm_strdup("minvalue");
   14907             : }
   14908             : |  MODE
   14909             :  { 
   14910           0 :  $$ = mm_strdup("mode");
   14911             : }
   14912             : |  MOVE
   14913             :  { 
   14914           0 :  $$ = mm_strdup("move");
   14915             : }
   14916             : |  NAME_P
   14917             :  { 
   14918          44 :  $$ = mm_strdup("name");
   14919             : }
   14920             : |  NAMES
   14921             :  { 
   14922           0 :  $$ = mm_strdup("names");
   14923             : }
   14924             : |  NEW
   14925             :  { 
   14926           0 :  $$ = mm_strdup("new");
   14927             : }
   14928             : |  NEXT
   14929             :  { 
   14930           0 :  $$ = mm_strdup("next");
   14931             : }
   14932             : |  NFC
   14933             :  { 
   14934           0 :  $$ = mm_strdup("nfc");
   14935             : }
   14936             : |  NFD
   14937             :  { 
   14938           0 :  $$ = mm_strdup("nfd");
   14939             : }
   14940             : |  NFKC
   14941             :  { 
   14942           0 :  $$ = mm_strdup("nfkc");
   14943             : }
   14944             : |  NFKD
   14945             :  { 
   14946           0 :  $$ = mm_strdup("nfkd");
   14947             : }
   14948             : |  NO
   14949             :  { 
   14950           0 :  $$ = mm_strdup("no");
   14951             : }
   14952             : |  NORMALIZED
   14953             :  { 
   14954           0 :  $$ = mm_strdup("normalized");
   14955             : }
   14956             : |  NOTHING
   14957             :  { 
   14958           0 :  $$ = mm_strdup("nothing");
   14959             : }
   14960             : |  NOTIFY
   14961             :  { 
   14962           0 :  $$ = mm_strdup("notify");
   14963             : }
   14964             : |  NOWAIT
   14965             :  { 
   14966           0 :  $$ = mm_strdup("nowait");
   14967             : }
   14968             : |  NULLS_P
   14969             :  { 
   14970           0 :  $$ = mm_strdup("nulls");
   14971             : }
   14972             : |  OBJECT_P
   14973             :  { 
   14974           0 :  $$ = mm_strdup("object");
   14975             : }
   14976             : |  OF
   14977             :  { 
   14978           0 :  $$ = mm_strdup("of");
   14979             : }
   14980             : |  OFF
   14981             :  { 
   14982           4 :  $$ = mm_strdup("off");
   14983             : }
   14984             : |  OIDS
   14985             :  { 
   14986           0 :  $$ = mm_strdup("oids");
   14987             : }
   14988             : |  OLD
   14989             :  { 
   14990           0 :  $$ = mm_strdup("old");
   14991             : }
   14992             : |  OMIT
   14993             :  { 
   14994           0 :  $$ = mm_strdup("omit");
   14995             : }
   14996             : |  OPERATOR
   14997             :  { 
   14998           0 :  $$ = mm_strdup("operator");
   14999             : }
   15000             : |  OPTION
   15001             :  { 
   15002           0 :  $$ = mm_strdup("option");
   15003             : }
   15004             : |  OPTIONS
   15005             :  { 
   15006           0 :  $$ = mm_strdup("options");
   15007             : }
   15008             : |  ORDINALITY
   15009             :  { 
   15010           0 :  $$ = mm_strdup("ordinality");
   15011             : }
   15012             : |  OTHERS
   15013             :  { 
   15014           0 :  $$ = mm_strdup("others");
   15015             : }
   15016             : |  OVER
   15017             :  { 
   15018           0 :  $$ = mm_strdup("over");
   15019             : }
   15020             : |  OVERRIDING
   15021             :  { 
   15022           0 :  $$ = mm_strdup("overriding");
   15023             : }
   15024             : |  OWNED
   15025             :  { 
   15026           0 :  $$ = mm_strdup("owned");
   15027             : }
   15028             : |  OWNER
   15029             :  { 
   15030           0 :  $$ = mm_strdup("owner");
   15031             : }
   15032             : |  PARALLEL
   15033             :  { 
   15034           0 :  $$ = mm_strdup("parallel");
   15035             : }
   15036             : |  PARAMETER
   15037             :  { 
   15038           0 :  $$ = mm_strdup("parameter");
   15039             : }
   15040             : |  PARSER
   15041             :  { 
   15042           0 :  $$ = mm_strdup("parser");
   15043             : }
   15044             : |  PARTIAL
   15045             :  { 
   15046           0 :  $$ = mm_strdup("partial");
   15047             : }
   15048             : |  PARTITION
   15049             :  { 
   15050           0 :  $$ = mm_strdup("partition");
   15051             : }
   15052             : |  PASSING
   15053             :  { 
   15054           0 :  $$ = mm_strdup("passing");
   15055             : }
   15056             : |  PASSWORD
   15057             :  { 
   15058           0 :  $$ = mm_strdup("password");
   15059             : }
   15060             : |  PERIOD
   15061             :  { 
   15062           0 :  $$ = mm_strdup("period");
   15063             : }
   15064             : |  PLANS
   15065             :  { 
   15066           0 :  $$ = mm_strdup("plans");
   15067             : }
   15068             : |  POLICY
   15069             :  { 
   15070           0 :  $$ = mm_strdup("policy");
   15071             : }
   15072             : |  PRECEDING
   15073             :  { 
   15074           0 :  $$ = mm_strdup("preceding");
   15075             : }
   15076             : |  PREPARE
   15077             :  { 
   15078           0 :  $$ = mm_strdup("prepare");
   15079             : }
   15080             : |  PREPARED
   15081             :  { 
   15082           0 :  $$ = mm_strdup("prepared");
   15083             : }
   15084             : |  PRESERVE
   15085             :  { 
   15086           0 :  $$ = mm_strdup("preserve");
   15087             : }
   15088             : |  PRIOR
   15089             :  { 
   15090           0 :  $$ = mm_strdup("prior");
   15091             : }
   15092             : |  PRIVILEGES
   15093             :  { 
   15094           0 :  $$ = mm_strdup("privileges");
   15095             : }
   15096             : |  PROCEDURAL
   15097             :  { 
   15098           0 :  $$ = mm_strdup("procedural");
   15099             : }
   15100             : |  PROCEDURE
   15101             :  { 
   15102           0 :  $$ = mm_strdup("procedure");
   15103             : }
   15104             : |  PROCEDURES
   15105             :  { 
   15106           0 :  $$ = mm_strdup("procedures");
   15107             : }
   15108             : |  PROGRAM
   15109             :  { 
   15110           0 :  $$ = mm_strdup("program");
   15111             : }
   15112             : |  PUBLICATION
   15113             :  { 
   15114           0 :  $$ = mm_strdup("publication");
   15115             : }
   15116             : |  QUOTE
   15117             :  { 
   15118           0 :  $$ = mm_strdup("quote");
   15119             : }
   15120             : |  QUOTES
   15121             :  { 
   15122           0 :  $$ = mm_strdup("quotes");
   15123             : }
   15124             : |  RANGE
   15125             :  { 
   15126           0 :  $$ = mm_strdup("range");
   15127             : }
   15128             : |  READ
   15129             :  { 
   15130           0 :  $$ = mm_strdup("read");
   15131             : }
   15132             : |  REASSIGN
   15133             :  { 
   15134           0 :  $$ = mm_strdup("reassign");
   15135             : }
   15136             : |  RECHECK
   15137             :  { 
   15138           0 :  $$ = mm_strdup("recheck");
   15139             : }
   15140             : |  RECURSIVE
   15141             :  { 
   15142           0 :  $$ = mm_strdup("recursive");
   15143             : }
   15144             : |  REF_P
   15145             :  { 
   15146           0 :  $$ = mm_strdup("ref");
   15147             : }
   15148             : |  REFERENCING
   15149             :  { 
   15150           0 :  $$ = mm_strdup("referencing");
   15151             : }
   15152             : |  REFRESH
   15153             :  { 
   15154           0 :  $$ = mm_strdup("refresh");
   15155             : }
   15156             : |  REINDEX
   15157             :  { 
   15158           0 :  $$ = mm_strdup("reindex");
   15159             : }
   15160             : |  RELATIVE_P
   15161             :  { 
   15162           0 :  $$ = mm_strdup("relative");
   15163             : }
   15164             : |  RELEASE
   15165             :  { 
   15166           0 :  $$ = mm_strdup("release");
   15167             : }
   15168             : |  RENAME
   15169             :  { 
   15170           0 :  $$ = mm_strdup("rename");
   15171             : }
   15172             : |  REPEATABLE
   15173             :  { 
   15174           0 :  $$ = mm_strdup("repeatable");
   15175             : }
   15176             : |  REPLACE
   15177             :  { 
   15178           0 :  $$ = mm_strdup("replace");
   15179             : }
   15180             : |  REPLICA
   15181             :  { 
   15182           0 :  $$ = mm_strdup("replica");
   15183             : }
   15184             : |  RESET
   15185             :  { 
   15186           0 :  $$ = mm_strdup("reset");
   15187             : }
   15188             : |  RESTART
   15189             :  { 
   15190           0 :  $$ = mm_strdup("restart");
   15191             : }
   15192             : |  RESTRICT
   15193             :  { 
   15194           0 :  $$ = mm_strdup("restrict");
   15195             : }
   15196             : |  RETURN
   15197             :  { 
   15198           0 :  $$ = mm_strdup("return");
   15199             : }
   15200             : |  RETURNS
   15201             :  { 
   15202           0 :  $$ = mm_strdup("returns");
   15203             : }
   15204             : |  REVOKE
   15205             :  { 
   15206           0 :  $$ = mm_strdup("revoke");
   15207             : }
   15208             : |  ROLE
   15209             :  { 
   15210           0 :  $$ = mm_strdup("role");
   15211             : }
   15212             : |  ROLLBACK
   15213             :  { 
   15214           0 :  $$ = mm_strdup("rollback");
   15215             : }
   15216             : |  ROLLUP
   15217             :  { 
   15218           0 :  $$ = mm_strdup("rollup");
   15219             : }
   15220             : |  ROUTINE
   15221             :  { 
   15222           0 :  $$ = mm_strdup("routine");
   15223             : }
   15224             : |  ROUTINES
   15225             :  { 
   15226           0 :  $$ = mm_strdup("routines");
   15227             : }
   15228             : |  ROWS
   15229             :  { 
   15230           0 :  $$ = mm_strdup("rows");
   15231             : }
   15232             : |  RULE
   15233             :  { 
   15234           0 :  $$ = mm_strdup("rule");
   15235             : }
   15236             : |  SAVEPOINT
   15237             :  { 
   15238           0 :  $$ = mm_strdup("savepoint");
   15239             : }
   15240             : |  SCALAR
   15241             :  { 
   15242           0 :  $$ = mm_strdup("scalar");
   15243             : }
   15244             : |  SCHEMA
   15245             :  { 
   15246           0 :  $$ = mm_strdup("schema");
   15247             : }
   15248             : |  SCHEMAS
   15249             :  { 
   15250           0 :  $$ = mm_strdup("schemas");
   15251             : }
   15252             : |  SCROLL
   15253             :  { 
   15254           0 :  $$ = mm_strdup("scroll");
   15255             : }
   15256             : |  SEARCH
   15257             :  { 
   15258           0 :  $$ = mm_strdup("search");
   15259             : }
   15260             : |  SECURITY
   15261             :  { 
   15262           0 :  $$ = mm_strdup("security");
   15263             : }
   15264             : |  SEQUENCE
   15265             :  { 
   15266           0 :  $$ = mm_strdup("sequence");
   15267             : }
   15268             : |  SEQUENCES
   15269             :  { 
   15270           0 :  $$ = mm_strdup("sequences");
   15271             : }
   15272             : |  SERIALIZABLE
   15273             :  { 
   15274           0 :  $$ = mm_strdup("serializable");
   15275             : }
   15276             : |  SERVER
   15277             :  { 
   15278           0 :  $$ = mm_strdup("server");
   15279             : }
   15280             : |  SESSION
   15281             :  { 
   15282           0 :  $$ = mm_strdup("session");
   15283             : }
   15284             : |  SET
   15285             :  { 
   15286           0 :  $$ = mm_strdup("set");
   15287             : }
   15288             : |  SETS
   15289             :  { 
   15290           0 :  $$ = mm_strdup("sets");
   15291             : }
   15292             : |  SHARE
   15293             :  { 
   15294           0 :  $$ = mm_strdup("share");
   15295             : }
   15296             : |  SHOW
   15297             :  { 
   15298           0 :  $$ = mm_strdup("show");
   15299             : }
   15300             : |  SIMPLE
   15301             :  { 
   15302           0 :  $$ = mm_strdup("simple");
   15303             : }
   15304             : |  SKIP
   15305             :  { 
   15306           0 :  $$ = mm_strdup("skip");
   15307             : }
   15308             : |  SNAPSHOT
   15309             :  { 
   15310           0 :  $$ = mm_strdup("snapshot");
   15311             : }
   15312             : |  SQL_P
   15313             :  { 
   15314           0 :  $$ = mm_strdup("sql");
   15315             : }
   15316             : |  STABLE
   15317             :  { 
   15318           0 :  $$ = mm_strdup("stable");
   15319             : }
   15320             : |  STANDALONE_P
   15321             :  { 
   15322           0 :  $$ = mm_strdup("standalone");
   15323             : }
   15324             : |  START
   15325             :  { 
   15326           0 :  $$ = mm_strdup("start");
   15327             : }
   15328             : |  STATEMENT
   15329             :  { 
   15330           0 :  $$ = mm_strdup("statement");
   15331             : }
   15332             : |  STATISTICS
   15333             :  { 
   15334           0 :  $$ = mm_strdup("statistics");
   15335             : }
   15336             : |  STDIN
   15337             :  { 
   15338           0 :  $$ = mm_strdup("stdin");
   15339             : }
   15340             : |  STDOUT
   15341             :  { 
   15342           0 :  $$ = mm_strdup("stdout");
   15343             : }
   15344             : |  STORAGE
   15345             :  { 
   15346           0 :  $$ = mm_strdup("storage");
   15347             : }
   15348             : |  STORED
   15349             :  { 
   15350           0 :  $$ = mm_strdup("stored");
   15351             : }
   15352             : |  STRICT_P
   15353             :  { 
   15354           0 :  $$ = mm_strdup("strict");
   15355             : }
   15356             : |  STRING_P
   15357             :  { 
   15358           2 :  $$ = mm_strdup("string");
   15359             : }
   15360             : |  STRIP_P
   15361             :  { 
   15362           0 :  $$ = mm_strdup("strip");
   15363             : }
   15364             : |  SUBSCRIPTION
   15365             :  { 
   15366           0 :  $$ = mm_strdup("subscription");
   15367             : }
   15368             : |  SUPPORT
   15369             :  { 
   15370           0 :  $$ = mm_strdup("support");
   15371             : }
   15372             : |  SYSID
   15373             :  { 
   15374           0 :  $$ = mm_strdup("sysid");
   15375             : }
   15376             : |  SYSTEM_P
   15377             :  { 
   15378           0 :  $$ = mm_strdup("system");
   15379             : }
   15380             : |  TABLES
   15381             :  { 
   15382           0 :  $$ = mm_strdup("tables");
   15383             : }
   15384             : |  TABLESPACE
   15385             :  { 
   15386           0 :  $$ = mm_strdup("tablespace");
   15387             : }
   15388             : |  TEMP
   15389             :  { 
   15390           0 :  $$ = mm_strdup("temp");
   15391             : }
   15392             : |  TEMPLATE
   15393             :  { 
   15394           0 :  $$ = mm_strdup("template");
   15395             : }
   15396             : |  TEMPORARY
   15397             :  { 
   15398           0 :  $$ = mm_strdup("temporary");
   15399             : }
   15400             : |  TEXT_P
   15401             :  { 
   15402          66 :  $$ = mm_strdup("text");
   15403             : }
   15404             : |  TIES
   15405             :  { 
   15406           0 :  $$ = mm_strdup("ties");
   15407             : }
   15408             : |  TRANSACTION
   15409             :  { 
   15410           0 :  $$ = mm_strdup("transaction");
   15411             : }
   15412             : |  TRANSFORM
   15413             :  { 
   15414           0 :  $$ = mm_strdup("transform");
   15415             : }
   15416             : |  TRIGGER
   15417             :  { 
   15418           2 :  $$ = mm_strdup("trigger");
   15419             : }
   15420             : |  TRUNCATE
   15421             :  { 
   15422           0 :  $$ = mm_strdup("truncate");
   15423             : }
   15424             : |  TRUSTED
   15425             :  { 
   15426           0 :  $$ = mm_strdup("trusted");
   15427             : }
   15428             : |  TYPE_P
   15429             :  { 
   15430           0 :  $$ = mm_strdup("type");
   15431             : }
   15432             : |  TYPES_P
   15433             :  { 
   15434           0 :  $$ = mm_strdup("types");
   15435             : }
   15436             : |  UESCAPE
   15437             :  { 
   15438           0 :  $$ = mm_strdup("uescape");
   15439             : }
   15440             : |  UNBOUNDED
   15441             :  { 
   15442           0 :  $$ = mm_strdup("unbounded");
   15443             : }
   15444             : |  UNCOMMITTED
   15445             :  { 
   15446           0 :  $$ = mm_strdup("uncommitted");
   15447             : }
   15448             : |  UNCONDITIONAL
   15449             :  { 
   15450           0 :  $$ = mm_strdup("unconditional");
   15451             : }
   15452             : |  UNENCRYPTED
   15453             :  { 
   15454           0 :  $$ = mm_strdup("unencrypted");
   15455             : }
   15456             : |  UNKNOWN
   15457             :  { 
   15458           0 :  $$ = mm_strdup("unknown");
   15459             : }
   15460             : |  UNLISTEN
   15461             :  { 
   15462           0 :  $$ = mm_strdup("unlisten");
   15463             : }
   15464             : |  UNLOGGED
   15465             :  { 
   15466           0 :  $$ = mm_strdup("unlogged");
   15467             : }
   15468             : |  UNTIL
   15469             :  { 
   15470           0 :  $$ = mm_strdup("until");
   15471             : }
   15472             : |  UPDATE
   15473             :  { 
   15474           0 :  $$ = mm_strdup("update");
   15475             : }
   15476             : |  VACUUM
   15477             :  { 
   15478           0 :  $$ = mm_strdup("vacuum");
   15479             : }
   15480             : |  VALID
   15481             :  { 
   15482           0 :  $$ = mm_strdup("valid");
   15483             : }
   15484             : |  VALIDATE
   15485             :  { 
   15486           0 :  $$ = mm_strdup("validate");
   15487             : }
   15488             : |  VALIDATOR
   15489             :  { 
   15490           0 :  $$ = mm_strdup("validator");
   15491             : }
   15492             : |  VALUE_P
   15493             :  { 
   15494           0 :  $$ = mm_strdup("value");
   15495             : }
   15496             : |  VARYING
   15497             :  { 
   15498           0 :  $$ = mm_strdup("varying");
   15499             : }
   15500             : |  VERSION_P
   15501             :  { 
   15502           0 :  $$ = mm_strdup("version");
   15503             : }
   15504             : |  VIEW
   15505             :  { 
   15506           0 :  $$ = mm_strdup("view");
   15507             : }
   15508             : |  VIEWS
   15509             :  { 
   15510           0 :  $$ = mm_strdup("views");
   15511             : }
   15512             : |  VOLATILE
   15513             :  { 
   15514           0 :  $$ = mm_strdup("volatile");
   15515             : }
   15516             : |  WHITESPACE_P
   15517             :  { 
   15518           0 :  $$ = mm_strdup("whitespace");
   15519             : }
   15520             : |  WITHIN
   15521             :  { 
   15522           0 :  $$ = mm_strdup("within");
   15523             : }
   15524             : |  WITHOUT
   15525             :  { 
   15526           0 :  $$ = mm_strdup("without");
   15527             : }
   15528             : |  WORK
   15529             :  { 
   15530           0 :  $$ = mm_strdup("work");
   15531             : }
   15532             : |  WRAPPER
   15533             :  { 
   15534           0 :  $$ = mm_strdup("wrapper");
   15535             : }
   15536             : |  WRITE
   15537             :  { 
   15538           0 :  $$ = mm_strdup("write");
   15539             : }
   15540             : |  XML_P
   15541             :  { 
   15542           0 :  $$ = mm_strdup("xml");
   15543             : }
   15544             : |  YES_P
   15545             :  { 
   15546           0 :  $$ = mm_strdup("yes");
   15547             : }
   15548             : |  ZONE
   15549             :  { 
   15550           0 :  $$ = mm_strdup("zone");
   15551             : }
   15552             : ;
   15553             : 
   15554             : 
   15555             :  col_name_keyword:
   15556             :  BETWEEN
   15557             :  { 
   15558           0 :  $$ = mm_strdup("between");
   15559             : }
   15560             : |  BIGINT
   15561             :  { 
   15562           0 :  $$ = mm_strdup("bigint");
   15563             : }
   15564             : |  BIT
   15565             :  { 
   15566           0 :  $$ = mm_strdup("bit");
   15567             : }
   15568             : |  BOOLEAN_P
   15569             :  { 
   15570           0 :  $$ = mm_strdup("boolean");
   15571             : }
   15572             : |  CHARACTER
   15573             :  { 
   15574           0 :  $$ = mm_strdup("character");
   15575             : }
   15576             : |  COALESCE
   15577             :  { 
   15578           0 :  $$ = mm_strdup("coalesce");
   15579             : }
   15580             : |  DEC
   15581             :  { 
   15582          10 :  $$ = mm_strdup("dec");
   15583             : }
   15584             : |  DECIMAL_P
   15585             :  { 
   15586           0 :  $$ = mm_strdup("decimal");
   15587             : }
   15588             : |  EXISTS
   15589             :  { 
   15590           0 :  $$ = mm_strdup("exists");
   15591             : }
   15592             : |  EXTRACT
   15593             :  { 
   15594           0 :  $$ = mm_strdup("extract");
   15595             : }
   15596             : |  FLOAT_P
   15597             :  { 
   15598           0 :  $$ = mm_strdup("float");
   15599             : }
   15600             : |  GREATEST
   15601             :  { 
   15602           0 :  $$ = mm_strdup("greatest");
   15603             : }
   15604             : |  GROUPING
   15605             :  { 
   15606           0 :  $$ = mm_strdup("grouping");
   15607             : }
   15608             : |  INOUT
   15609             :  { 
   15610           0 :  $$ = mm_strdup("inout");
   15611             : }
   15612             : |  INTEGER
   15613             :  { 
   15614           4 :  $$ = mm_strdup("integer");
   15615             : }
   15616             : |  INTERVAL
   15617             :  { 
   15618           0 :  $$ = mm_strdup("interval");
   15619             : }
   15620             : |  JSON
   15621             :  { 
   15622           2 :  $$ = mm_strdup("json");
   15623             : }
   15624             : |  JSON_ARRAY
   15625             :  { 
   15626           0 :  $$ = mm_strdup("json_array");
   15627             : }
   15628             : |  JSON_ARRAYAGG
   15629             :  { 
   15630           0 :  $$ = mm_strdup("json_arrayagg");
   15631             : }
   15632             : |  JSON_EXISTS
   15633             :  { 
   15634           0 :  $$ = mm_strdup("json_exists");
   15635             : }
   15636             : |  JSON_OBJECT
   15637             :  { 
   15638           0 :  $$ = mm_strdup("json_object");
   15639             : }
   15640             : |  JSON_OBJECTAGG
   15641             :  { 
   15642           0 :  $$ = mm_strdup("json_objectagg");
   15643             : }
   15644             : |  JSON_QUERY
   15645             :  { 
   15646           0 :  $$ = mm_strdup("json_query");
   15647             : }
   15648             : |  JSON_SCALAR
   15649             :  { 
   15650           0 :  $$ = mm_strdup("json_scalar");
   15651             : }
   15652             : |  JSON_SERIALIZE
   15653             :  { 
   15654           0 :  $$ = mm_strdup("json_serialize");
   15655             : }
   15656             : |  JSON_VALUE
   15657             :  { 
   15658           0 :  $$ = mm_strdup("json_value");
   15659             : }
   15660             : |  LEAST
   15661             :  { 
   15662           0 :  $$ = mm_strdup("least");
   15663             : }
   15664             : |  MERGE_ACTION
   15665             :  { 
   15666           0 :  $$ = mm_strdup("merge_action");
   15667             : }
   15668             : |  NATIONAL
   15669             :  { 
   15670           0 :  $$ = mm_strdup("national");
   15671             : }
   15672             : |  NCHAR
   15673             :  { 
   15674           0 :  $$ = mm_strdup("nchar");
   15675             : }
   15676             : |  NONE
   15677             :  { 
   15678           0 :  $$ = mm_strdup("none");
   15679             : }
   15680             : |  NORMALIZE
   15681             :  { 
   15682           0 :  $$ = mm_strdup("normalize");
   15683             : }
   15684             : |  NULLIF
   15685             :  { 
   15686           0 :  $$ = mm_strdup("nullif");
   15687             : }
   15688             : |  NUMERIC
   15689             :  { 
   15690           0 :  $$ = mm_strdup("numeric");
   15691             : }
   15692             : |  OUT_P
   15693             :  { 
   15694           0 :  $$ = mm_strdup("out");
   15695             : }
   15696             : |  OVERLAY
   15697             :  { 
   15698           0 :  $$ = mm_strdup("overlay");
   15699             : }
   15700             : |  POSITION
   15701             :  { 
   15702           0 :  $$ = mm_strdup("position");
   15703             : }
   15704             : |  PRECISION
   15705             :  { 
   15706           0 :  $$ = mm_strdup("precision");
   15707             : }
   15708             : |  REAL
   15709             :  { 
   15710           0 :  $$ = mm_strdup("real");
   15711             : }
   15712             : |  ROW
   15713             :  { 
   15714           0 :  $$ = mm_strdup("row");
   15715             : }
   15716             : |  SETOF
   15717             :  { 
   15718           0 :  $$ = mm_strdup("setof");
   15719             : }
   15720             : |  SMALLINT
   15721             :  { 
   15722           4 :  $$ = mm_strdup("smallint");
   15723             : }
   15724             : |  SUBSTRING
   15725             :  { 
   15726           0 :  $$ = mm_strdup("substring");
   15727             : }
   15728             : |  TIME
   15729             :  { 
   15730           0 :  $$ = mm_strdup("time");
   15731             : }
   15732             : |  TIMESTAMP
   15733             :  { 
   15734          12 :  $$ = mm_strdup("timestamp");
   15735             : }
   15736             : |  TREAT
   15737             :  { 
   15738           0 :  $$ = mm_strdup("treat");
   15739             : }
   15740             : |  TRIM
   15741             :  { 
   15742           0 :  $$ = mm_strdup("trim");
   15743             : }
   15744             : |  VARCHAR
   15745             :  { 
   15746           2 :  $$ = mm_strdup("varchar");
   15747             : }
   15748             : |  XMLATTRIBUTES
   15749             :  { 
   15750           0 :  $$ = mm_strdup("xmlattributes");
   15751             : }
   15752             : |  XMLCONCAT
   15753             :  { 
   15754           0 :  $$ = mm_strdup("xmlconcat");
   15755             : }
   15756             : |  XMLELEMENT
   15757             :  { 
   15758           0 :  $$ = mm_strdup("xmlelement");
   15759             : }
   15760             : |  XMLEXISTS
   15761             :  { 
   15762           0 :  $$ = mm_strdup("xmlexists");
   15763             : }
   15764             : |  XMLFOREST
   15765             :  { 
   15766           0 :  $$ = mm_strdup("xmlforest");
   15767             : }
   15768             : |  XMLNAMESPACES
   15769             :  { 
   15770           0 :  $$ = mm_strdup("xmlnamespaces");
   15771             : }
   15772             : |  XMLPARSE
   15773             :  { 
   15774           0 :  $$ = mm_strdup("xmlparse");
   15775             : }
   15776             : |  XMLPI
   15777             :  { 
   15778           0 :  $$ = mm_strdup("xmlpi");
   15779             : }
   15780             : |  XMLROOT
   15781             :  { 
   15782           0 :  $$ = mm_strdup("xmlroot");
   15783             : }
   15784             : |  XMLSERIALIZE
   15785             :  { 
   15786           0 :  $$ = mm_strdup("xmlserialize");
   15787             : }
   15788             : |  XMLTABLE
   15789             :  { 
   15790           0 :  $$ = mm_strdup("xmltable");
   15791             : }
   15792             : ;
   15793             : 
   15794             : 
   15795             :  type_func_name_keyword:
   15796             :  AUTHORIZATION
   15797             :  { 
   15798           0 :  $$ = mm_strdup("authorization");
   15799             : }
   15800             : |  BINARY
   15801             :  { 
   15802           0 :  $$ = mm_strdup("binary");
   15803             : }
   15804             : |  COLLATION
   15805             :  { 
   15806           0 :  $$ = mm_strdup("collation");
   15807             : }
   15808             : |  CONCURRENTLY
   15809             :  { 
   15810           0 :  $$ = mm_strdup("concurrently");
   15811             : }
   15812             : |  CROSS
   15813             :  { 
   15814           0 :  $$ = mm_strdup("cross");
   15815             : }
   15816             : |  CURRENT_SCHEMA
   15817             :  { 
   15818           0 :  $$ = mm_strdup("current_schema");
   15819             : }
   15820             : |  FREEZE
   15821             :  { 
   15822           0 :  $$ = mm_strdup("freeze");
   15823             : }
   15824             : |  FULL
   15825             :  { 
   15826           0 :  $$ = mm_strdup("full");
   15827             : }
   15828             : |  ILIKE
   15829             :  { 
   15830           0 :  $$ = mm_strdup("ilike");
   15831             : }
   15832             : |  INNER_P
   15833             :  { 
   15834           0 :  $$ = mm_strdup("inner");
   15835             : }
   15836             : |  IS
   15837             :  { 
   15838           0 :  $$ = mm_strdup("is");
   15839             : }
   15840             : |  ISNULL
   15841             :  { 
   15842           0 :  $$ = mm_strdup("isnull");
   15843             : }
   15844             : |  JOIN
   15845             :  { 
   15846           0 :  $$ = mm_strdup("join");
   15847             : }
   15848             : |  LEFT
   15849             :  { 
   15850           0 :  $$ = mm_strdup("left");
   15851             : }
   15852             : |  LIKE
   15853             :  { 
   15854           0 :  $$ = mm_strdup("like");
   15855             : }
   15856             : |  NATURAL
   15857             :  { 
   15858           0 :  $$ = mm_strdup("natural");
   15859             : }
   15860             : |  NOTNULL
   15861             :  { 
   15862           0 :  $$ = mm_strdup("notnull");
   15863             : }
   15864             : |  OUTER_P
   15865             :  { 
   15866           0 :  $$ = mm_strdup("outer");
   15867             : }
   15868             : |  OVERLAPS
   15869             :  { 
   15870           0 :  $$ = mm_strdup("overlaps");
   15871             : }
   15872             : |  RIGHT
   15873             :  { 
   15874           0 :  $$ = mm_strdup("right");
   15875             : }
   15876             : |  SIMILAR
   15877             :  { 
   15878           0 :  $$ = mm_strdup("similar");
   15879             : }
   15880             : |  TABLESAMPLE
   15881             :  { 
   15882           0 :  $$ = mm_strdup("tablesample");
   15883             : }
   15884             : |  VERBOSE
   15885             :  { 
   15886           0 :  $$ = mm_strdup("verbose");
   15887             : }
   15888             : ;
   15889             : 
   15890             : 
   15891             :  reserved_keyword:
   15892             :  ALL
   15893             :  { 
   15894           0 :  $$ = mm_strdup("all");
   15895             : }
   15896             : |  ANALYSE
   15897             :  { 
   15898           0 :  $$ = mm_strdup("analyse");
   15899             : }
   15900             : |  ANALYZE
   15901             :  { 
   15902           0 :  $$ = mm_strdup("analyze");
   15903             : }
   15904             : |  AND
   15905             :  { 
   15906           0 :  $$ = mm_strdup("and");
   15907             : }
   15908             : |  ANY
   15909             :  { 
   15910           0 :  $$ = mm_strdup("any");
   15911             : }
   15912             : |  ARRAY
   15913             :  { 
   15914           0 :  $$ = mm_strdup("array");
   15915             : }
   15916             : |  AS
   15917             :  { 
   15918           0 :  $$ = mm_strdup("as");
   15919             : }
   15920             : |  ASC
   15921             :  { 
   15922           0 :  $$ = mm_strdup("asc");
   15923             : }
   15924             : |  ASYMMETRIC
   15925             :  { 
   15926           0 :  $$ = mm_strdup("asymmetric");
   15927             : }
   15928             : |  BOTH
   15929             :  { 
   15930           0 :  $$ = mm_strdup("both");
   15931             : }
   15932             : |  CASE
   15933             :  { 
   15934           0 :  $$ = mm_strdup("case");
   15935             : }
   15936             : |  CAST
   15937             :  { 
   15938           0 :  $$ = mm_strdup("cast");
   15939             : }
   15940             : |  CHECK
   15941             :  { 
   15942           0 :  $$ = mm_strdup("check");
   15943             : }
   15944             : |  COLLATE
   15945             :  { 
   15946           0 :  $$ = mm_strdup("collate");
   15947             : }
   15948             : |  COLUMN
   15949             :  { 
   15950           0 :  $$ = mm_strdup("column");
   15951             : }
   15952             : |  CONSTRAINT
   15953             :  { 
   15954           0 :  $$ = mm_strdup("constraint");
   15955             : }
   15956             : |  CREATE
   15957             :  { 
   15958           0 :  $$ = mm_strdup("create");
   15959             : }
   15960             : |  CURRENT_CATALOG
   15961             :  { 
   15962           0 :  $$ = mm_strdup("current_catalog");
   15963             : }
   15964             : |  CURRENT_DATE
   15965             :  { 
   15966           0 :  $$ = mm_strdup("current_date");
   15967             : }
   15968             : |  CURRENT_ROLE
   15969             :  { 
   15970           0 :  $$ = mm_strdup("current_role");
   15971             : }
   15972             : |  CURRENT_TIME
   15973             :  { 
   15974           0 :  $$ = mm_strdup("current_time");
   15975             : }
   15976             : |  CURRENT_TIMESTAMP
   15977             :  { 
   15978           0 :  $$ = mm_strdup("current_timestamp");
   15979             : }
   15980             : |  CURRENT_USER
   15981             :  { 
   15982           0 :  $$ = mm_strdup("current_user");
   15983             : }
   15984             : |  DEFAULT
   15985             :  { 
   15986           0 :  $$ = mm_strdup("default");
   15987             : }
   15988             : |  DEFERRABLE
   15989             :  { 
   15990           0 :  $$ = mm_strdup("deferrable");
   15991             : }
   15992             : |  DESC
   15993             :  { 
   15994           0 :  $$ = mm_strdup("desc");
   15995             : }
   15996             : |  DISTINCT
   15997             :  { 
   15998           0 :  $$ = mm_strdup("distinct");
   15999             : }
   16000             : |  DO
   16001             :  { 
   16002           0 :  $$ = mm_strdup("do");
   16003             : }
   16004             : |  ELSE
   16005             :  { 
   16006           0 :  $$ = mm_strdup("else");
   16007             : }
   16008             : |  END_P
   16009             :  { 
   16010           0 :  $$ = mm_strdup("end");
   16011             : }
   16012             : |  EXCEPT
   16013             :  { 
   16014           0 :  $$ = mm_strdup("except");
   16015             : }
   16016             : |  FALSE_P
   16017             :  { 
   16018           0 :  $$ = mm_strdup("false");
   16019             : }
   16020             : |  FETCH
   16021             :  { 
   16022           0 :  $$ = mm_strdup("fetch");
   16023             : }
   16024             : |  FOR
   16025             :  { 
   16026           0 :  $$ = mm_strdup("for");
   16027             : }
   16028             : |  FOREIGN
   16029             :  { 
   16030           0 :  $$ = mm_strdup("foreign");
   16031             : }
   16032             : |  FROM
   16033             :  { 
   16034           0 :  $$ = mm_strdup("from");
   16035             : }
   16036             : |  GRANT
   16037             :  { 
   16038           0 :  $$ = mm_strdup("grant");
   16039             : }
   16040             : |  GROUP_P
   16041             :  { 
   16042           0 :  $$ = mm_strdup("group");
   16043             : }
   16044             : |  HAVING
   16045             :  { 
   16046           0 :  $$ = mm_strdup("having");
   16047             : }
   16048             : |  IN_P
   16049             :  { 
   16050           0 :  $$ = mm_strdup("in");
   16051             : }
   16052             : |  INITIALLY
   16053             :  { 
   16054           0 :  $$ = mm_strdup("initially");
   16055             : }
   16056             : |  INTERSECT
   16057             :  { 
   16058           0 :  $$ = mm_strdup("intersect");
   16059             : }
   16060             : |  INTO
   16061             :  { 
   16062           0 :  $$ = mm_strdup("into");
   16063             : }
   16064             : |  LATERAL_P
   16065             :  { 
   16066           0 :  $$ = mm_strdup("lateral");
   16067             : }
   16068             : |  LEADING
   16069             :  { 
   16070           0 :  $$ = mm_strdup("leading");
   16071             : }
   16072             : |  LIMIT
   16073             :  { 
   16074           0 :  $$ = mm_strdup("limit");
   16075             : }
   16076             : |  LOCALTIME
   16077             :  { 
   16078           0 :  $$ = mm_strdup("localtime");
   16079             : }
   16080             : |  LOCALTIMESTAMP
   16081             :  { 
   16082           0 :  $$ = mm_strdup("localtimestamp");
   16083             : }
   16084             : |  NOT
   16085             :  { 
   16086           0 :  $$ = mm_strdup("not");
   16087             : }
   16088             : |  NULL_P
   16089             :  { 
   16090           0 :  $$ = mm_strdup("null");
   16091             : }
   16092             : |  OFFSET
   16093             :  { 
   16094           0 :  $$ = mm_strdup("offset");
   16095             : }
   16096             : |  ON
   16097             :  { 
   16098           0 :  $$ = mm_strdup("on");
   16099             : }
   16100             : |  ONLY
   16101             :  { 
   16102           0 :  $$ = mm_strdup("only");
   16103             : }
   16104             : |  OR
   16105             :  { 
   16106           0 :  $$ = mm_strdup("or");
   16107             : }
   16108             : |  ORDER
   16109             :  { 
   16110           0 :  $$ = mm_strdup("order");
   16111             : }
   16112             : |  PLACING
   16113             :  { 
   16114           0 :  $$ = mm_strdup("placing");
   16115             : }
   16116             : |  PRIMARY
   16117             :  { 
   16118           0 :  $$ = mm_strdup("primary");
   16119             : }
   16120             : |  REFERENCES
   16121             :  { 
   16122           0 :  $$ = mm_strdup("references");
   16123             : }
   16124             : |  RETURNING
   16125             :  { 
   16126           0 :  $$ = mm_strdup("returning");
   16127             : }
   16128             : |  SELECT
   16129             :  { 
   16130           0 :  $$ = mm_strdup("select");
   16131             : }
   16132             : |  SESSION_USER
   16133             :  { 
   16134           0 :  $$ = mm_strdup("session_user");
   16135             : }
   16136             : |  SOME
   16137             :  { 
   16138           0 :  $$ = mm_strdup("some");
   16139             : }
   16140             : |  SYMMETRIC
   16141             :  { 
   16142           0 :  $$ = mm_strdup("symmetric");
   16143             : }
   16144             : |  SYSTEM_USER
   16145             :  { 
   16146           0 :  $$ = mm_strdup("system_user");
   16147             : }
   16148             : |  TABLE
   16149             :  { 
   16150           0 :  $$ = mm_strdup("table");
   16151             : }
   16152             : |  THEN
   16153             :  { 
   16154           0 :  $$ = mm_strdup("then");
   16155             : }
   16156             : |  TRAILING
   16157             :  { 
   16158           0 :  $$ = mm_strdup("trailing");
   16159             : }
   16160             : |  TRUE_P
   16161             :  { 
   16162           0 :  $$ = mm_strdup("true");
   16163             : }
   16164             : |  UNIQUE
   16165             :  { 
   16166           0 :  $$ = mm_strdup("unique");
   16167             : }
   16168             : |  USER
   16169             :  { 
   16170           0 :  $$ = mm_strdup("user");
   16171             : }
   16172             : |  USING
   16173             :  { 
   16174           0 :  $$ = mm_strdup("using");
   16175             : }
   16176             : |  VARIADIC
   16177             :  { 
   16178           0 :  $$ = mm_strdup("variadic");
   16179             : }
   16180             : |  WHEN
   16181             :  { 
   16182           0 :  $$ = mm_strdup("when");
   16183             : }
   16184             : |  WHERE
   16185             :  { 
   16186           0 :  $$ = mm_strdup("where");
   16187             : }
   16188             : |  WINDOW
   16189             :  { 
   16190           0 :  $$ = mm_strdup("window");
   16191             : }
   16192             : |  WITH
   16193             :  { 
   16194           0 :  $$ = mm_strdup("with");
   16195             : }
   16196             : ;
   16197             : 
   16198             : 
   16199             :  bare_label_keyword:
   16200             :  ABORT_P
   16201             :  { 
   16202           0 :  $$ = mm_strdup("abort");
   16203             : }
   16204             : |  ABSENT
   16205             :  { 
   16206           0 :  $$ = mm_strdup("absent");
   16207             : }
   16208             : |  ABSOLUTE_P
   16209             :  { 
   16210           0 :  $$ = mm_strdup("absolute");
   16211             : }
   16212             : |  ACCESS
   16213             :  { 
   16214           0 :  $$ = mm_strdup("access");
   16215             : }
   16216             : |  ACTION
   16217             :  { 
   16218           0 :  $$ = mm_strdup("action");
   16219             : }
   16220             : |  ADD_P
   16221             :  { 
   16222           0 :  $$ = mm_strdup("add");
   16223             : }
   16224             : |  ADMIN
   16225             :  { 
   16226           0 :  $$ = mm_strdup("admin");
   16227             : }
   16228             : |  AFTER
   16229             :  { 
   16230           0 :  $$ = mm_strdup("after");
   16231             : }
   16232             : |  AGGREGATE
   16233             :  { 
   16234           0 :  $$ = mm_strdup("aggregate");
   16235             : }
   16236             : |  ALL
   16237             :  { 
   16238           0 :  $$ = mm_strdup("all");
   16239             : }
   16240             : |  ALSO
   16241             :  { 
   16242           0 :  $$ = mm_strdup("also");
   16243             : }
   16244             : |  ALTER
   16245             :  { 
   16246           0 :  $$ = mm_strdup("alter");
   16247             : }
   16248             : |  ALWAYS
   16249             :  { 
   16250           0 :  $$ = mm_strdup("always");
   16251             : }
   16252             : |  ANALYSE
   16253             :  { 
   16254           0 :  $$ = mm_strdup("analyse");
   16255             : }
   16256             : |  ANALYZE
   16257             :  { 
   16258           0 :  $$ = mm_strdup("analyze");
   16259             : }
   16260             : |  AND
   16261             :  { 
   16262           0 :  $$ = mm_strdup("and");
   16263             : }
   16264             : |  ANY
   16265             :  { 
   16266           0 :  $$ = mm_strdup("any");
   16267             : }
   16268             : |  ASC
   16269             :  { 
   16270           0 :  $$ = mm_strdup("asc");
   16271             : }
   16272             : |  ASENSITIVE
   16273             :  { 
   16274           0 :  $$ = mm_strdup("asensitive");
   16275             : }
   16276             : |  ASSERTION
   16277             :  { 
   16278           0 :  $$ = mm_strdup("assertion");
   16279             : }
   16280             : |  ASSIGNMENT
   16281             :  { 
   16282           0 :  $$ = mm_strdup("assignment");
   16283             : }
   16284             : |  ASYMMETRIC
   16285             :  { 
   16286           0 :  $$ = mm_strdup("asymmetric");
   16287             : }
   16288             : |  AT
   16289             :  { 
   16290           0 :  $$ = mm_strdup("at");
   16291             : }
   16292             : |  ATOMIC
   16293             :  { 
   16294           0 :  $$ = mm_strdup("atomic");
   16295             : }
   16296             : |  ATTACH
   16297             :  { 
   16298           0 :  $$ = mm_strdup("attach");
   16299             : }
   16300             : |  ATTRIBUTE
   16301             :  { 
   16302           0 :  $$ = mm_strdup("attribute");
   16303             : }
   16304             : |  AUTHORIZATION
   16305             :  { 
   16306           0 :  $$ = mm_strdup("authorization");
   16307             : }
   16308             : |  BACKWARD
   16309             :  { 
   16310           0 :  $$ = mm_strdup("backward");
   16311             : }
   16312             : |  BEFORE
   16313             :  { 
   16314           0 :  $$ = mm_strdup("before");
   16315             : }
   16316             : |  BEGIN_P
   16317             :  { 
   16318           0 :  $$ = mm_strdup("begin");
   16319             : }
   16320             : |  BETWEEN
   16321             :  { 
   16322           0 :  $$ = mm_strdup("between");
   16323             : }
   16324             : |  BIGINT
   16325             :  { 
   16326           0 :  $$ = mm_strdup("bigint");
   16327             : }
   16328             : |  BINARY
   16329             :  { 
   16330           0 :  $$ = mm_strdup("binary");
   16331             : }
   16332             : |  BIT
   16333             :  { 
   16334           0 :  $$ = mm_strdup("bit");
   16335             : }
   16336             : |  BOOLEAN_P
   16337             :  { 
   16338           0 :  $$ = mm_strdup("boolean");
   16339             : }
   16340             : |  BOTH
   16341             :  { 
   16342           0 :  $$ = mm_strdup("both");
   16343             : }
   16344             : |  BREADTH
   16345             :  { 
   16346           0 :  $$ = mm_strdup("breadth");
   16347             : }
   16348             : |  BY
   16349             :  { 
   16350           0 :  $$ = mm_strdup("by");
   16351             : }
   16352             : |  CACHE
   16353             :  { 
   16354           0 :  $$ = mm_strdup("cache");
   16355             : }
   16356             : |  CALL
   16357             :  { 
   16358           0 :  $$ = mm_strdup("call");
   16359             : }
   16360             : |  CALLED
   16361             :  { 
   16362           0 :  $$ = mm_strdup("called");
   16363             : }
   16364             : |  CASCADE
   16365             :  { 
   16366           0 :  $$ = mm_strdup("cascade");
   16367             : }
   16368             : |  CASCADED
   16369             :  { 
   16370           0 :  $$ = mm_strdup("cascaded");
   16371             : }
   16372             : |  CASE
   16373             :  { 
   16374           0 :  $$ = mm_strdup("case");
   16375             : }
   16376             : |  CAST
   16377             :  { 
   16378           0 :  $$ = mm_strdup("cast");
   16379             : }
   16380             : |  CATALOG_P
   16381             :  { 
   16382           0 :  $$ = mm_strdup("catalog");
   16383             : }
   16384             : |  CHAIN
   16385             :  { 
   16386           0 :  $$ = mm_strdup("chain");
   16387             : }
   16388             : |  CHARACTERISTICS
   16389             :  { 
   16390           0 :  $$ = mm_strdup("characteristics");
   16391             : }
   16392             : |  CHECK
   16393             :  { 
   16394           0 :  $$ = mm_strdup("check");
   16395             : }
   16396             : |  CHECKPOINT
   16397             :  { 
   16398           0 :  $$ = mm_strdup("checkpoint");
   16399             : }
   16400             : |  CLASS
   16401             :  { 
   16402           0 :  $$ = mm_strdup("class");
   16403             : }
   16404             : |  CLOSE
   16405             :  { 
   16406           0 :  $$ = mm_strdup("close");
   16407             : }
   16408             : |  CLUSTER
   16409             :  { 
   16410           0 :  $$ = mm_strdup("cluster");
   16411             : }
   16412             : |  COALESCE
   16413             :  { 
   16414           0 :  $$ = mm_strdup("coalesce");
   16415             : }
   16416             : |  COLLATE
   16417             :  { 
   16418           0 :  $$ = mm_strdup("collate");
   16419             : }
   16420             : |  COLLATION
   16421             :  { 
   16422           0 :  $$ = mm_strdup("collation");
   16423             : }
   16424             : |  COLUMN
   16425             :  { 
   16426           0 :  $$ = mm_strdup("column");
   16427             : }
   16428             : |  COLUMNS
   16429             :  { 
   16430           0 :  $$ = mm_strdup("columns");
   16431             : }
   16432             : |  COMMENT
   16433             :  { 
   16434           0 :  $$ = mm_strdup("comment");
   16435             : }
   16436             : |  COMMENTS
   16437             :  { 
   16438           0 :  $$ = mm_strdup("comments");
   16439             : }
   16440             : |  COMMIT
   16441             :  { 
   16442           0 :  $$ = mm_strdup("commit");
   16443             : }
   16444             : |  COMMITTED
   16445             :  { 
   16446           0 :  $$ = mm_strdup("committed");
   16447             : }
   16448             : |  COMPRESSION
   16449             :  { 
   16450           0 :  $$ = mm_strdup("compression");
   16451             : }
   16452             : |  CONCURRENTLY
   16453             :  { 
   16454           0 :  $$ = mm_strdup("concurrently");
   16455             : }
   16456             : |  CONDITIONAL
   16457             :  { 
   16458           0 :  $$ = mm_strdup("conditional");
   16459             : }
   16460             : |  CONFIGURATION
   16461             :  { 
   16462           0 :  $$ = mm_strdup("configuration");
   16463             : }
   16464             : |  CONFLICT
   16465             :  { 
   16466           0 :  $$ = mm_strdup("conflict");
   16467             : }
   16468             : |  CONNECTION
   16469             :  { 
   16470           0 :  $$ = mm_strdup("connection");
   16471             : }
   16472             : |  CONSTRAINT
   16473             :  { 
   16474           0 :  $$ = mm_strdup("constraint");
   16475             : }
   16476             : |  CONSTRAINTS
   16477             :  { 
   16478           0 :  $$ = mm_strdup("constraints");
   16479             : }
   16480             : |  CONTENT_P
   16481             :  { 
   16482           0 :  $$ = mm_strdup("content");
   16483             : }
   16484             : |  CONTINUE_P
   16485             :  { 
   16486           0 :  $$ = mm_strdup("continue");
   16487             : }
   16488             : |  CONVERSION_P
   16489             :  { 
   16490           0 :  $$ = mm_strdup("conversion");
   16491             : }
   16492             : |  COPY
   16493             :  { 
   16494           0 :  $$ = mm_strdup("copy");
   16495             : }
   16496             : |  COST
   16497             :  { 
   16498           0 :  $$ = mm_strdup("cost");
   16499             : }
   16500             : |  CROSS
   16501             :  { 
   16502           0 :  $$ = mm_strdup("cross");
   16503             : }
   16504             : |  CSV
   16505             :  { 
   16506           0 :  $$ = mm_strdup("csv");
   16507             : }
   16508             : |  CUBE
   16509             :  { 
   16510           0 :  $$ = mm_strdup("cube");
   16511             : }
   16512             : |  CURRENT_P
   16513             :  { 
   16514           0 :  $$ = mm_strdup("current");
   16515             : }
   16516             : |  CURRENT_CATALOG
   16517             :  { 
   16518           0 :  $$ = mm_strdup("current_catalog");
   16519             : }
   16520             : |  CURRENT_DATE
   16521             :  { 
   16522           0 :  $$ = mm_strdup("current_date");
   16523             : }
   16524             : |  CURRENT_ROLE
   16525             :  { 
   16526           0 :  $$ = mm_strdup("current_role");
   16527             : }
   16528             : |  CURRENT_SCHEMA
   16529             :  { 
   16530           0 :  $$ = mm_strdup("current_schema");
   16531             : }
   16532             : |  CURRENT_TIME
   16533             :  { 
   16534           0 :  $$ = mm_strdup("current_time");
   16535             : }
   16536             : |  CURRENT_TIMESTAMP
   16537             :  { 
   16538           0 :  $$ = mm_strdup("current_timestamp");
   16539             : }
   16540             : |  CURRENT_USER
   16541             :  { 
   16542           0 :  $$ = mm_strdup("current_user");
   16543             : }
   16544             : |  CURSOR
   16545             :  { 
   16546           0 :  $$ = mm_strdup("cursor");
   16547             : }
   16548             : |  CYCLE
   16549             :  { 
   16550           0 :  $$ = mm_strdup("cycle");
   16551             : }
   16552             : |  DATA_P
   16553             :  { 
   16554           0 :  $$ = mm_strdup("data");
   16555             : }
   16556             : |  DATABASE
   16557             :  { 
   16558           0 :  $$ = mm_strdup("database");
   16559             : }
   16560             : |  DEALLOCATE
   16561             :  { 
   16562           0 :  $$ = mm_strdup("deallocate");
   16563             : }
   16564             : |  DEC
   16565             :  { 
   16566           0 :  $$ = mm_strdup("dec");
   16567             : }
   16568             : |  DECIMAL_P
   16569             :  { 
   16570           0 :  $$ = mm_strdup("decimal");
   16571             : }
   16572             : |  DECLARE
   16573             :  { 
   16574           0 :  $$ = mm_strdup("declare");
   16575             : }
   16576             : |  DEFAULT
   16577             :  { 
   16578           0 :  $$ = mm_strdup("default");
   16579             : }
   16580             : |  DEFAULTS
   16581             :  { 
   16582           0 :  $$ = mm_strdup("defaults");
   16583             : }
   16584             : |  DEFERRABLE
   16585             :  { 
   16586           0 :  $$ = mm_strdup("deferrable");
   16587             : }
   16588             : |  DEFERRED
   16589             :  { 
   16590           0 :  $$ = mm_strdup("deferred");
   16591             : }
   16592             : |  DEFINER
   16593             :  { 
   16594           0 :  $$ = mm_strdup("definer");
   16595             : }
   16596             : |  DELETE_P
   16597             :  { 
   16598           0 :  $$ = mm_strdup("delete");
   16599             : }
   16600             : |  DELIMITER
   16601             :  { 
   16602           0 :  $$ = mm_strdup("delimiter");
   16603             : }
   16604             : |  DELIMITERS
   16605             :  { 
   16606           0 :  $$ = mm_strdup("delimiters");
   16607             : }
   16608             : |  DEPENDS
   16609             :  { 
   16610           0 :  $$ = mm_strdup("depends");
   16611             : }
   16612             : |  DEPTH
   16613             :  { 
   16614           0 :  $$ = mm_strdup("depth");
   16615             : }
   16616             : |  DESC
   16617             :  { 
   16618           0 :  $$ = mm_strdup("desc");
   16619             : }
   16620             : |  DETACH
   16621             :  { 
   16622           0 :  $$ = mm_strdup("detach");
   16623             : }
   16624             : |  DICTIONARY
   16625             :  { 
   16626           0 :  $$ = mm_strdup("dictionary");
   16627             : }
   16628             : |  DISABLE_P
   16629             :  { 
   16630           0 :  $$ = mm_strdup("disable");
   16631             : }
   16632             : |  DISCARD
   16633             :  { 
   16634           0 :  $$ = mm_strdup("discard");
   16635             : }
   16636             : |  DISTINCT
   16637             :  { 
   16638           0 :  $$ = mm_strdup("distinct");
   16639             : }
   16640             : |  DO
   16641             :  { 
   16642           0 :  $$ = mm_strdup("do");
   16643             : }
   16644             : |  DOCUMENT_P
   16645             :  { 
   16646           0 :  $$ = mm_strdup("document");
   16647             : }
   16648             : |  DOMAIN_P
   16649             :  { 
   16650           0 :  $$ = mm_strdup("domain");
   16651             : }
   16652             : |  DOUBLE_P
   16653             :  { 
   16654           0 :  $$ = mm_strdup("double");
   16655             : }
   16656             : |  DROP
   16657             :  { 
   16658           0 :  $$ = mm_strdup("drop");
   16659             : }
   16660             : |  EACH
   16661             :  { 
   16662           0 :  $$ = mm_strdup("each");
   16663             : }
   16664             : |  ELSE
   16665             :  { 
   16666           0 :  $$ = mm_strdup("else");
   16667             : }
   16668             : |  EMPTY_P
   16669             :  { 
   16670           0 :  $$ = mm_strdup("empty");
   16671             : }
   16672             : |  ENABLE_P
   16673             :  { 
   16674           0 :  $$ = mm_strdup("enable");
   16675             : }
   16676             : |  ENCODING
   16677             :  { 
   16678           0 :  $$ = mm_strdup("encoding");
   16679             : }
   16680             : |  ENCRYPTED
   16681             :  { 
   16682           0 :  $$ = mm_strdup("encrypted");
   16683             : }
   16684             : |  END_P
   16685             :  { 
   16686           0 :  $$ = mm_strdup("end");
   16687             : }
   16688             : |  ENUM_P
   16689             :  { 
   16690           0 :  $$ = mm_strdup("enum");
   16691             : }
   16692             : |  ERROR_P
   16693             :  { 
   16694           0 :  $$ = mm_strdup("error");
   16695             : }
   16696             : |  ESCAPE
   16697             :  { 
   16698           0 :  $$ = mm_strdup("escape");
   16699             : }
   16700             : |  EVENT
   16701             :  { 
   16702           0 :  $$ = mm_strdup("event");
   16703             : }
   16704             : |  EXCLUDE
   16705             :  { 
   16706           0 :  $$ = mm_strdup("exclude");
   16707             : }
   16708             : |  EXCLUDING
   16709             :  { 
   16710           0 :  $$ = mm_strdup("excluding");
   16711             : }
   16712             : |  EXCLUSIVE
   16713             :  { 
   16714           0 :  $$ = mm_strdup("exclusive");
   16715             : }
   16716             : |  EXECUTE
   16717             :  { 
   16718           0 :  $$ = mm_strdup("execute");
   16719             : }
   16720             : |  EXISTS
   16721             :  { 
   16722           0 :  $$ = mm_strdup("exists");
   16723             : }
   16724             : |  EXPLAIN
   16725             :  { 
   16726           0 :  $$ = mm_strdup("explain");
   16727             : }
   16728             : |  EXPRESSION
   16729             :  { 
   16730           0 :  $$ = mm_strdup("expression");
   16731             : }
   16732             : |  EXTENSION
   16733             :  { 
   16734           0 :  $$ = mm_strdup("extension");
   16735             : }
   16736             : |  EXTERNAL
   16737             :  { 
   16738           0 :  $$ = mm_strdup("external");
   16739             : }
   16740             : |  EXTRACT
   16741             :  { 
   16742           0 :  $$ = mm_strdup("extract");
   16743             : }
   16744             : |  FALSE_P
   16745             :  { 
   16746           0 :  $$ = mm_strdup("false");
   16747             : }
   16748             : |  FAMILY
   16749             :  { 
   16750           0 :  $$ = mm_strdup("family");
   16751             : }
   16752             : |  FINALIZE
   16753             :  { 
   16754           0 :  $$ = mm_strdup("finalize");
   16755             : }
   16756             : |  FIRST_P
   16757             :  { 
   16758           0 :  $$ = mm_strdup("first");
   16759             : }
   16760             : |  FLOAT_P
   16761             :  { 
   16762           0 :  $$ = mm_strdup("float");
   16763             : }
   16764             : |  FOLLOWING
   16765             :  { 
   16766           0 :  $$ = mm_strdup("following");
   16767             : }
   16768             : |  FORCE
   16769             :  { 
   16770           0 :  $$ = mm_strdup("force");
   16771             : }
   16772             : |  FOREIGN
   16773             :  { 
   16774           0 :  $$ = mm_strdup("foreign");
   16775             : }
   16776             : |  FORMAT
   16777             :  { 
   16778           0 :  $$ = mm_strdup("format");
   16779             : }
   16780             : |  FORWARD
   16781             :  { 
   16782           0 :  $$ = mm_strdup("forward");
   16783             : }
   16784             : |  FREEZE
   16785             :  { 
   16786           0 :  $$ = mm_strdup("freeze");
   16787             : }
   16788             : |  FULL
   16789             :  { 
   16790           0 :  $$ = mm_strdup("full");
   16791             : }
   16792             : |  FUNCTION
   16793             :  { 
   16794           0 :  $$ = mm_strdup("function");
   16795             : }
   16796             : |  FUNCTIONS
   16797             :  { 
   16798           0 :  $$ = mm_strdup("functions");
   16799             : }
   16800             : |  GENERATED
   16801             :  { 
   16802           0 :  $$ = mm_strdup("generated");
   16803             : }
   16804             : |  GLOBAL
   16805             :  { 
   16806           0 :  $$ = mm_strdup("global");
   16807             : }
   16808             : |  GRANTED
   16809             :  { 
   16810           0 :  $$ = mm_strdup("granted");
   16811             : }
   16812             : |  GREATEST
   16813             :  { 
   16814           0 :  $$ = mm_strdup("greatest");
   16815             : }
   16816             : |  GROUPING
   16817             :  { 
   16818           0 :  $$ = mm_strdup("grouping");
   16819             : }
   16820             : |  GROUPS
   16821             :  { 
   16822           0 :  $$ = mm_strdup("groups");
   16823             : }
   16824             : |  HANDLER
   16825             :  { 
   16826           0 :  $$ = mm_strdup("handler");
   16827             : }
   16828             : |  HEADER_P
   16829             :  { 
   16830           0 :  $$ = mm_strdup("header");
   16831             : }
   16832             : |  HOLD
   16833             :  { 
   16834           0 :  $$ = mm_strdup("hold");
   16835             : }
   16836             : |  IDENTITY_P
   16837             :  { 
   16838           0 :  $$ = mm_strdup("identity");
   16839             : }
   16840             : |  IF_P
   16841             :  { 
   16842           0 :  $$ = mm_strdup("if");
   16843             : }
   16844             : |  ILIKE
   16845             :  { 
   16846           0 :  $$ = mm_strdup("ilike");
   16847             : }
   16848             : |  IMMEDIATE
   16849             :  { 
   16850           0 :  $$ = mm_strdup("immediate");
   16851             : }
   16852             : |  IMMUTABLE
   16853             :  { 
   16854           0 :  $$ = mm_strdup("immutable");
   16855             : }
   16856             : |  IMPLICIT_P
   16857             :  { 
   16858           0 :  $$ = mm_strdup("implicit");
   16859             : }
   16860             : |  IMPORT_P
   16861             :  { 
   16862           0 :  $$ = mm_strdup("import");
   16863             : }
   16864             : |  IN_P
   16865             :  { 
   16866           0 :  $$ = mm_strdup("in");
   16867             : }
   16868             : |  INCLUDE
   16869             :  { 
   16870           0 :  $$ = mm_strdup("include");
   16871             : }
   16872             : |  INCLUDING
   16873             :  { 
   16874           0 :  $$ = mm_strdup("including");
   16875             : }
   16876             : |  INCREMENT
   16877             :  { 
   16878           0 :  $$ = mm_strdup("increment");
   16879             : }
   16880             : |  INDENT
   16881             :  { 
   16882           0 :  $$ = mm_strdup("indent");
   16883             : }
   16884             : |  INDEX
   16885             :  { 
   16886           0 :  $$ = mm_strdup("index");
   16887             : }
   16888             : |  INDEXES
   16889             :  { 
   16890           0 :  $$ = mm_strdup("indexes");
   16891             : }
   16892             : |  INHERIT
   16893             :  { 
   16894           0 :  $$ = mm_strdup("inherit");
   16895             : }
   16896             : |  INHERITS
   16897             :  { 
   16898           0 :  $$ = mm_strdup("inherits");
   16899             : }
   16900             : |  INITIALLY
   16901             :  { 
   16902           0 :  $$ = mm_strdup("initially");
   16903             : }
   16904             : |  INLINE_P
   16905             :  { 
   16906           0 :  $$ = mm_strdup("inline");
   16907             : }
   16908             : |  INNER_P
   16909             :  { 
   16910           0 :  $$ = mm_strdup("inner");
   16911             : }
   16912             : |  INOUT
   16913             :  { 
   16914           0 :  $$ = mm_strdup("inout");
   16915             : }
   16916             : |  INPUT_P
   16917             :  { 
   16918           0 :  $$ = mm_strdup("input");
   16919             : }
   16920             : |  INSENSITIVE
   16921             :  { 
   16922           0 :  $$ = mm_strdup("insensitive");
   16923             : }
   16924             : |  INSERT
   16925             :  { 
   16926           0 :  $$ = mm_strdup("insert");
   16927             : }
   16928             : |  INSTEAD
   16929             :  { 
   16930           0 :  $$ = mm_strdup("instead");
   16931             : }
   16932             : |  INT_P
   16933             :  { 
   16934           0 :  $$ = mm_strdup("int");
   16935             : }
   16936             : |  INTEGER
   16937             :  { 
   16938           0 :  $$ = mm_strdup("integer");
   16939             : }
   16940             : |  INTERVAL
   16941             :  { 
   16942           0 :  $$ = mm_strdup("interval");
   16943             : }
   16944             : |  INVOKER
   16945             :  { 
   16946           0 :  $$ = mm_strdup("invoker");
   16947             : }
   16948             : |  IS
   16949             :  { 
   16950           0 :  $$ = mm_strdup("is");
   16951             : }
   16952             : |  ISOLATION
   16953             :  { 
   16954           0 :  $$ = mm_strdup("isolation");
   16955             : }
   16956             : |  JOIN
   16957             :  { 
   16958           0 :  $$ = mm_strdup("join");
   16959             : }
   16960             : |  JSON
   16961             :  { 
   16962           0 :  $$ = mm_strdup("json");
   16963             : }
   16964             : |  JSON_ARRAY
   16965             :  { 
   16966           0 :  $$ = mm_strdup("json_array");
   16967             : }
   16968             : |  JSON_ARRAYAGG
   16969             :  { 
   16970           0 :  $$ = mm_strdup("json_arrayagg");
   16971             : }
   16972             : |  JSON_EXISTS
   16973             :  { 
   16974           0 :  $$ = mm_strdup("json_exists");
   16975             : }
   16976             : |  JSON_OBJECT
   16977             :  { 
   16978           0 :  $$ = mm_strdup("json_object");
   16979             : }
   16980             : |  JSON_OBJECTAGG
   16981             :  { 
   16982           0 :  $$ = mm_strdup("json_objectagg");
   16983             : }
   16984             : |  JSON_QUERY
   16985             :  { 
   16986           0 :  $$ = mm_strdup("json_query");
   16987             : }
   16988             : |  JSON_SCALAR
   16989             :  { 
   16990           0 :  $$ = mm_strdup("json_scalar");
   16991             : }
   16992             : |  JSON_SERIALIZE
   16993             :  { 
   16994           0 :  $$ = mm_strdup("json_serialize");
   16995             : }
   16996             : |  JSON_VALUE
   16997             :  { 
   16998           0 :  $$ = mm_strdup("json_value");
   16999             : }
   17000             : |  KEEP
   17001             :  { 
   17002           0 :  $$ = mm_strdup("keep");
   17003             : }
   17004             : |  KEY
   17005             :  { 
   17006           0 :  $$ = mm_strdup("key");
   17007             : }
   17008             : |  KEYS
   17009             :  { 
   17010           0 :  $$ = mm_strdup("keys");
   17011             : }
   17012             : |  LABEL
   17013             :  { 
   17014           0 :  $$ = mm_strdup("label");
   17015             : }
   17016             : |  LANGUAGE
   17017             :  { 
   17018           0 :  $$ = mm_strdup("language");
   17019             : }
   17020             : |  LARGE_P
   17021             :  { 
   17022           0 :  $$ = mm_strdup("large");
   17023             : }
   17024             : |  LAST_P
   17025             :  { 
   17026           0 :  $$ = mm_strdup("last");
   17027             : }
   17028             : |  LATERAL_P
   17029             :  { 
   17030           0 :  $$ = mm_strdup("lateral");
   17031             : }
   17032             : |  LEADING
   17033             :  { 
   17034           0 :  $$ = mm_strdup("leading");
   17035             : }
   17036             : |  LEAKPROOF
   17037             :  { 
   17038           0 :  $$ = mm_strdup("leakproof");
   17039             : }
   17040             : |  LEAST
   17041             :  { 
   17042           0 :  $$ = mm_strdup("least");
   17043             : }
   17044             : |  LEFT
   17045             :  { 
   17046           0 :  $$ = mm_strdup("left");
   17047             : }
   17048             : |  LEVEL
   17049             :  { 
   17050           0 :  $$ = mm_strdup("level");
   17051             : }
   17052             : |  LIKE
   17053             :  { 
   17054           0 :  $$ = mm_strdup("like");
   17055             : }
   17056             : |  LISTEN
   17057             :  { 
   17058           0 :  $$ = mm_strdup("listen");
   17059             : }
   17060             : |  LOAD
   17061             :  { 
   17062           0 :  $$ = mm_strdup("load");
   17063             : }
   17064             : |  LOCAL
   17065             :  { 
   17066           0 :  $$ = mm_strdup("local");
   17067             : }
   17068             : |  LOCALTIME
   17069             :  { 
   17070           0 :  $$ = mm_strdup("localtime");
   17071             : }
   17072             : |  LOCALTIMESTAMP
   17073             :  { 
   17074           0 :  $$ = mm_strdup("localtimestamp");
   17075             : }
   17076             : |  LOCATION
   17077             :  { 
   17078           0 :  $$ = mm_strdup("location");
   17079             : }
   17080             : |  LOCK_P
   17081             :  { 
   17082           0 :  $$ = mm_strdup("lock");
   17083             : }
   17084             : |  LOCKED
   17085             :  { 
   17086           0 :  $$ = mm_strdup("locked");
   17087             : }
   17088             : |  LOGGED
   17089             :  { 
   17090           0 :  $$ = mm_strdup("logged");
   17091             : }
   17092             : |  MAPPING
   17093             :  { 
   17094           0 :  $$ = mm_strdup("mapping");
   17095             : }
   17096             : |  MATCH
   17097             :  { 
   17098           0 :  $$ = mm_strdup("match");
   17099             : }
   17100             : |  MATCHED
   17101             :  { 
   17102           0 :  $$ = mm_strdup("matched");
   17103             : }
   17104             : |  MATERIALIZED
   17105             :  { 
   17106           0 :  $$ = mm_strdup("materialized");
   17107             : }
   17108             : |  MAXVALUE
   17109             :  { 
   17110           0 :  $$ = mm_strdup("maxvalue");
   17111             : }
   17112             : |  MERGE
   17113             :  { 
   17114           0 :  $$ = mm_strdup("merge");
   17115             : }
   17116             : |  MERGE_ACTION
   17117             :  { 
   17118           0 :  $$ = mm_strdup("merge_action");
   17119             : }
   17120             : |  METHOD
   17121             :  { 
   17122           0 :  $$ = mm_strdup("method");
   17123             : }
   17124             : |  MINVALUE
   17125             :  { 
   17126           0 :  $$ = mm_strdup("minvalue");
   17127             : }
   17128             : |  MODE
   17129             :  { 
   17130           0 :  $$ = mm_strdup("mode");
   17131             : }
   17132             : |  MOVE
   17133             :  { 
   17134           0 :  $$ = mm_strdup("move");
   17135             : }
   17136             : |  NAME_P
   17137             :  { 
   17138           0 :  $$ = mm_strdup("name");
   17139             : }
   17140             : |  NAMES
   17141             :  { 
   17142           0 :  $$ = mm_strdup("names");
   17143             : }
   17144             : |  NATIONAL
   17145             :  { 
   17146           0 :  $$ = mm_strdup("national");
   17147             : }
   17148             : |  NATURAL
   17149             :  { 
   17150           0 :  $$ = mm_strdup("natural");
   17151             : }
   17152             : |  NCHAR
   17153             :  { 
   17154           0 :  $$ = mm_strdup("nchar");
   17155             : }
   17156             : |  NEW
   17157             :  { 
   17158           0 :  $$ = mm_strdup("new");
   17159             : }
   17160             : |  NEXT
   17161             :  { 
   17162           0 :  $$ = mm_strdup("next");
   17163             : }
   17164             : |  NFC
   17165             :  { 
   17166           0 :  $$ = mm_strdup("nfc");
   17167             : }
   17168             : |  NFD
   17169             :  { 
   17170           0 :  $$ = mm_strdup("nfd");
   17171             : }
   17172             : |  NFKC
   17173             :  { 
   17174           0 :  $$ = mm_strdup("nfkc");
   17175             : }
   17176             : |  NFKD
   17177             :  { 
   17178           0 :  $$ = mm_strdup("nfkd");
   17179             : }
   17180             : |  NO
   17181             :  { 
   17182           0 :  $$ = mm_strdup("no");
   17183             : }
   17184             : |  NONE
   17185             :  { 
   17186           0 :  $$ = mm_strdup("none");
   17187             : }
   17188             : |  NORMALIZE
   17189             :  { 
   17190           0 :  $$ = mm_strdup("normalize");
   17191             : }
   17192             : |  NORMALIZED
   17193             :  { 
   17194           0 :  $$ = mm_strdup("normalized");
   17195             : }
   17196             : |  NOT
   17197             :  { 
   17198           0 :  $$ = mm_strdup("not");
   17199             : }
   17200             : |  NOTHING
   17201             :  { 
   17202           0 :  $$ = mm_strdup("nothing");
   17203             : }
   17204             : |  NOTIFY
   17205             :  { 
   17206           0 :  $$ = mm_strdup("notify");
   17207             : }
   17208             : |  NOWAIT
   17209             :  { 
   17210           0 :  $$ = mm_strdup("nowait");
   17211             : }
   17212             : |  NULL_P
   17213             :  { 
   17214           0 :  $$ = mm_strdup("null");
   17215             : }
   17216             : |  NULLIF
   17217             :  { 
   17218           0 :  $$ = mm_strdup("nullif");
   17219             : }
   17220             : |  NULLS_P
   17221             :  { 
   17222           0 :  $$ = mm_strdup("nulls");
   17223             : }
   17224             : |  NUMERIC
   17225             :  { 
   17226           0 :  $$ = mm_strdup("numeric");
   17227             : }
   17228             : |  OBJECT_P
   17229             :  { 
   17230           0 :  $$ = mm_strdup("object");
   17231             : }
   17232             : |  OF
   17233             :  { 
   17234           0 :  $$ = mm_strdup("of");
   17235             : }
   17236             : |  OFF
   17237             :  { 
   17238           0 :  $$ = mm_strdup("off");
   17239             : }
   17240             : |  OIDS
   17241             :  { 
   17242           0 :  $$ = mm_strdup("oids");
   17243             : }
   17244             : |  OLD
   17245             :  { 
   17246           0 :  $$ = mm_strdup("old");
   17247             : }
   17248             : |  OMIT
   17249             :  { 
   17250           0 :  $$ = mm_strdup("omit");
   17251             : }
   17252             : |  ONLY
   17253             :  { 
   17254           0 :  $$ = mm_strdup("only");
   17255             : }
   17256             : |  OPERATOR
   17257             :  { 
   17258           0 :  $$ = mm_strdup("operator");
   17259             : }
   17260             : |  OPTION
   17261             :  { 
   17262           0 :  $$ = mm_strdup("option");
   17263             : }
   17264             : |  OPTIONS
   17265             :  { 
   17266           0 :  $$ = mm_strdup("options");
   17267             : }
   17268             : |  OR
   17269             :  { 
   17270           0 :  $$ = mm_strdup("or");
   17271             : }
   17272             : |  ORDINALITY
   17273             :  { 
   17274           0 :  $$ = mm_strdup("ordinality");
   17275             : }
   17276             : |  OTHERS
   17277             :  { 
   17278           0 :  $$ = mm_strdup("others");
   17279             : }
   17280             : |  OUT_P
   17281             :  { 
   17282           0 :  $$ = mm_strdup("out");
   17283             : }
   17284             : |  OUTER_P
   17285             :  { 
   17286           0 :  $$ = mm_strdup("outer");
   17287             : }
   17288             : |  OVERLAY
   17289             :  { 
   17290           0 :  $$ = mm_strdup("overlay");
   17291             : }
   17292             : |  OVERRIDING
   17293             :  { 
   17294           0 :  $$ = mm_strdup("overriding");
   17295             : }
   17296             : |  OWNED
   17297             :  { 
   17298           0 :  $$ = mm_strdup("owned");
   17299             : }
   17300             : |  OWNER
   17301             :  { 
   17302           0 :  $$ = mm_strdup("owner");
   17303             : }
   17304             : |  PARALLEL
   17305             :  { 
   17306           0 :  $$ = mm_strdup("parallel");
   17307             : }
   17308             : |  PARAMETER
   17309             :  { 
   17310           0 :  $$ = mm_strdup("parameter");
   17311             : }
   17312             : |  PARSER
   17313             :  { 
   17314           0 :  $$ = mm_strdup("parser");
   17315             : }
   17316             : |  PARTIAL
   17317             :  { 
   17318           0 :  $$ = mm_strdup("partial");
   17319             : }
   17320             : |  PARTITION
   17321             :  { 
   17322           0 :  $$ = mm_strdup("partition");
   17323             : }
   17324             : |  PASSING
   17325             :  { 
   17326           0 :  $$ = mm_strdup("passing");
   17327             : }
   17328             : |  PASSWORD
   17329             :  { 
   17330           0 :  $$ = mm_strdup("password");
   17331             : }
   17332             : |  PERIOD
   17333             :  { 
   17334           0 :  $$ = mm_strdup("period");
   17335             : }
   17336             : |  PLACING
   17337             :  { 
   17338           0 :  $$ = mm_strdup("placing");
   17339             : }
   17340             : |  PLANS
   17341             :  { 
   17342           0 :  $$ = mm_strdup("plans");
   17343             : }
   17344             : |  POLICY
   17345             :  { 
   17346           0 :  $$ = mm_strdup("policy");
   17347             : }
   17348             : |  POSITION
   17349             :  { 
   17350           0 :  $$ = mm_strdup("position");
   17351             : }
   17352             : |  PRECEDING
   17353             :  { 
   17354           0 :  $$ = mm_strdup("preceding");
   17355             : }
   17356             : |  PREPARE
   17357             :  { 
   17358           0 :  $$ = mm_strdup("prepare");
   17359             : }
   17360             : |  PREPARED
   17361             :  { 
   17362           0 :  $$ = mm_strdup("prepared");
   17363             : }
   17364             : |  PRESERVE
   17365             :  { 
   17366           0 :  $$ = mm_strdup("preserve");
   17367             : }
   17368             : |  PRIMARY
   17369             :  { 
   17370           0 :  $$ = mm_strdup("primary");
   17371             : }
   17372             : |  PRIOR
   17373             :  { 
   17374           0 :  $$ = mm_strdup("prior");
   17375             : }
   17376             : |  PRIVILEGES
   17377             :  { 
   17378           0 :  $$ = mm_strdup("privileges");
   17379             : }
   17380             : |  PROCEDURAL
   17381             :  { 
   17382           0 :  $$ = mm_strdup("procedural");
   17383             : }
   17384             : |  PROCEDURE
   17385             :  { 
   17386           0 :  $$ = mm_strdup("procedure");
   17387             : }
   17388             : |  PROCEDURES
   17389             :  { 
   17390           0 :  $$ = mm_strdup("procedures");
   17391             : }
   17392             : |  PROGRAM
   17393             :  { 
   17394           0 :  $$ = mm_strdup("program");
   17395             : }
   17396             : |  PUBLICATION
   17397             :  { 
   17398           0 :  $$ = mm_strdup("publication");
   17399             : }
   17400             : |  QUOTE
   17401             :  { 
   17402           0 :  $$ = mm_strdup("quote");
   17403             : }
   17404             : |  QUOTES
   17405             :  { 
   17406           0 :  $$ = mm_strdup("quotes");
   17407             : }
   17408             : |  RANGE
   17409             :  { 
   17410           0 :  $$ = mm_strdup("range");
   17411             : }
   17412             : |  READ
   17413             :  { 
   17414           0 :  $$ = mm_strdup("read");
   17415             : }
   17416             : |  REAL
   17417             :  { 
   17418           0 :  $$ = mm_strdup("real");
   17419             : }
   17420             : |  REASSIGN
   17421             :  { 
   17422           0 :  $$ = mm_strdup("reassign");
   17423             : }
   17424             : |  RECHECK
   17425             :  { 
   17426           0 :  $$ = mm_strdup("recheck");
   17427             : }
   17428             : |  RECURSIVE
   17429             :  { 
   17430           0 :  $$ = mm_strdup("recursive");
   17431             : }
   17432             : |  REF_P
   17433             :  { 
   17434           0 :  $$ = mm_strdup("ref");
   17435             : }
   17436             : |  REFERENCES
   17437             :  { 
   17438           0 :  $$ = mm_strdup("references");
   17439             : }
   17440             : |  REFERENCING
   17441             :  { 
   17442           0 :  $$ = mm_strdup("referencing");
   17443             : }
   17444             : |  REFRESH
   17445             :  { 
   17446           0 :  $$ = mm_strdup("refresh");
   17447             : }
   17448             : |  REINDEX
   17449             :  { 
   17450           0 :  $$ = mm_strdup("reindex");
   17451             : }
   17452             : |  RELATIVE_P
   17453             :  { 
   17454           0 :  $$ = mm_strdup("relative");
   17455             : }
   17456             : |  RELEASE
   17457             :  { 
   17458           0 :  $$ = mm_strdup("release");
   17459             : }
   17460             : |  RENAME
   17461             :  { 
   17462           0 :  $$ = mm_strdup("rename");
   17463             : }
   17464             : |  REPEATABLE
   17465             :  { 
   17466           0 :  $$ = mm_strdup("repeatable");
   17467             : }
   17468             : |  REPLACE
   17469             :  { 
   17470           0 :  $$ = mm_strdup("replace");
   17471             : }
   17472             : |  REPLICA
   17473             :  { 
   17474           0 :  $$ = mm_strdup("replica");
   17475             : }
   17476             : |  RESET
   17477             :  { 
   17478           0 :  $$ = mm_strdup("reset");
   17479             : }
   17480             : |  RESTART
   17481             :  { 
   17482           0 :  $$ = mm_strdup("restart");
   17483             : }
   17484             : |  RESTRICT
   17485             :  { 
   17486           0 :  $$ = mm_strdup("restrict");
   17487             : }
   17488             : |  RETURN
   17489             :  { 
   17490           0 :  $$ = mm_strdup("return");
   17491             : }
   17492             : |  RETURNS
   17493             :  { 
   17494           0 :  $$ = mm_strdup("returns");
   17495             : }
   17496             : |  REVOKE
   17497             :  { 
   17498           0 :  $$ = mm_strdup("revoke");
   17499             : }
   17500             : |  RIGHT
   17501             :  { 
   17502           0 :  $$ = mm_strdup("right");
   17503             : }
   17504             : |  ROLE
   17505             :  { 
   17506           0 :  $$ = mm_strdup("role");
   17507             : }
   17508             : |  ROLLBACK
   17509             :  { 
   17510           0 :  $$ = mm_strdup("rollback");
   17511             : }
   17512             : |  ROLLUP
   17513             :  { 
   17514           0 :  $$ = mm_strdup("rollup");
   17515             : }
   17516             : |  ROUTINE
   17517             :  { 
   17518           0 :  $$ = mm_strdup("routine");
   17519             : }
   17520             : |  ROUTINES
   17521             :  { 
   17522           0 :  $$ = mm_strdup("routines");
   17523             : }
   17524             : |  ROW
   17525             :  { 
   17526           0 :  $$ = mm_strdup("row");
   17527             : }
   17528             : |  ROWS
   17529             :  { 
   17530           0 :  $$ = mm_strdup("rows");
   17531             : }
   17532             : |  RULE
   17533             :  { 
   17534           0 :  $$ = mm_strdup("rule");
   17535             : }
   17536             : |  SAVEPOINT
   17537             :  { 
   17538           0 :  $$ = mm_strdup("savepoint");
   17539             : }
   17540             : |  SCALAR
   17541             :  { 
   17542           0 :  $$ = mm_strdup("scalar");
   17543             : }
   17544             : |  SCHEMA
   17545             :  { 
   17546           0 :  $$ = mm_strdup("schema");
   17547             : }
   17548             : |  SCHEMAS
   17549             :  { 
   17550           0 :  $$ = mm_strdup("schemas");
   17551             : }
   17552             : |  SCROLL
   17553             :  { 
   17554           0 :  $$ = mm_strdup("scroll");
   17555             : }
   17556             : |  SEARCH
   17557             :  { 
   17558           0 :  $$ = mm_strdup("search");
   17559             : }
   17560             : |  SECURITY
   17561             :  { 
   17562           0 :  $$ = mm_strdup("security");
   17563             : }
   17564             : |  SELECT
   17565             :  { 
   17566           0 :  $$ = mm_strdup("select");
   17567             : }
   17568             : |  SEQUENCE
   17569             :  { 
   17570           0 :  $$ = mm_strdup("sequence");
   17571             : }
   17572             : |  SEQUENCES
   17573             :  { 
   17574           0 :  $$ = mm_strdup("sequences");
   17575             : }
   17576             : |  SERIALIZABLE
   17577             :  { 
   17578           0 :  $$ = mm_strdup("serializable");
   17579             : }
   17580             : |  SERVER
   17581             :  { 
   17582           0 :  $$ = mm_strdup("server");
   17583             : }
   17584             : |  SESSION
   17585             :  { 
   17586           0 :  $$ = mm_strdup("session");
   17587             : }
   17588             : |  SESSION_USER
   17589             :  { 
   17590           0 :  $$ = mm_strdup("session_user");
   17591             : }
   17592             : |  SET
   17593             :  { 
   17594           0 :  $$ = mm_strdup("set");
   17595             : }
   17596             : |  SETOF
   17597             :  { 
   17598           0 :  $$ = mm_strdup("setof");
   17599             : }
   17600             : |  SETS
   17601             :  { 
   17602           0 :  $$ = mm_strdup("sets");
   17603             : }
   17604             : |  SHARE
   17605             :  { 
   17606           0 :  $$ = mm_strdup("share");
   17607             : }
   17608             : |  SHOW
   17609             :  { 
   17610           0 :  $$ = mm_strdup("show");
   17611             : }
   17612             : |  SIMILAR
   17613             :  { 
   17614           0 :  $$ = mm_strdup("similar");
   17615             : }
   17616             : |  SIMPLE
   17617             :  { 
   17618           0 :  $$ = mm_strdup("simple");
   17619             : }
   17620             : |  SKIP
   17621             :  { 
   17622           0 :  $$ = mm_strdup("skip");
   17623             : }
   17624             : |  SMALLINT
   17625             :  { 
   17626           0 :  $$ = mm_strdup("smallint");
   17627             : }
   17628             : |  SNAPSHOT
   17629             :  { 
   17630           0 :  $$ = mm_strdup("snapshot");
   17631             : }
   17632             : |  SOME
   17633             :  { 
   17634           0 :  $$ = mm_strdup("some");
   17635             : }
   17636             : |  SQL_P
   17637             :  { 
   17638           0 :  $$ = mm_strdup("sql");
   17639             : }
   17640             : |  STABLE
   17641             :  { 
   17642           0 :  $$ = mm_strdup("stable");
   17643             : }
   17644             : |  STANDALONE_P
   17645             :  { 
   17646           0 :  $$ = mm_strdup("standalone");
   17647             : }
   17648             : |  START
   17649             :  { 
   17650           0 :  $$ = mm_strdup("start");
   17651             : }
   17652             : |  STATEMENT
   17653             :  { 
   17654           0 :  $$ = mm_strdup("statement");
   17655             : }
   17656             : |  STATISTICS
   17657             :  { 
   17658           0 :  $$ = mm_strdup("statistics");
   17659             : }
   17660             : |  STDIN
   17661             :  { 
   17662           0 :  $$ = mm_strdup("stdin");
   17663             : }
   17664             : |  STDOUT
   17665             :  { 
   17666           0 :  $$ = mm_strdup("stdout");
   17667             : }
   17668             : |  STORAGE
   17669             :  { 
   17670           0 :  $$ = mm_strdup("storage");
   17671             : }
   17672             : |  STORED
   17673             :  { 
   17674           0 :  $$ = mm_strdup("stored");
   17675             : }
   17676             : |  STRICT_P
   17677             :  { 
   17678           0 :  $$ = mm_strdup("strict");
   17679             : }
   17680             : |  STRING_P
   17681             :  { 
   17682           0 :  $$ = mm_strdup("string");
   17683             : }
   17684             : |  STRIP_P
   17685             :  { 
   17686           0 :  $$ = mm_strdup("strip");
   17687             : }
   17688             : |  SUBSCRIPTION
   17689             :  { 
   17690           0 :  $$ = mm_strdup("subscription");
   17691             : }
   17692             : |  SUBSTRING
   17693             :  { 
   17694           0 :  $$ = mm_strdup("substring");
   17695             : }
   17696             : |  SUPPORT
   17697             :  { 
   17698           0 :  $$ = mm_strdup("support");
   17699             : }
   17700             : |  SYMMETRIC
   17701             :  { 
   17702           0 :  $$ = mm_strdup("symmetric");
   17703             : }
   17704             : |  SYSID
   17705             :  { 
   17706           0 :  $$ = mm_strdup("sysid");
   17707             : }
   17708             : |  SYSTEM_P
   17709             :  { 
   17710           0 :  $$ = mm_strdup("system");
   17711             : }
   17712             : |  SYSTEM_USER
   17713             :  { 
   17714           0 :  $$ = mm_strdup("system_user");
   17715             : }
   17716             : |  TABLE
   17717             :  { 
   17718           0 :  $$ = mm_strdup("table");
   17719             : }
   17720             : |  TABLES
   17721             :  { 
   17722           0 :  $$ = mm_strdup("tables");
   17723             : }
   17724             : |  TABLESAMPLE
   17725             :  { 
   17726           0 :  $$ = mm_strdup("tablesample");
   17727             : }
   17728             : |  TABLESPACE
   17729             :  { 
   17730           0 :  $$ = mm_strdup("tablespace");
   17731             : }
   17732             : |  TEMP
   17733             :  { 
   17734           0 :  $$ = mm_strdup("temp");
   17735             : }
   17736             : |  TEMPLATE
   17737             :  { 
   17738           0 :  $$ = mm_strdup("template");
   17739             : }
   17740             : |  TEMPORARY
   17741             :  { 
   17742           0 :  $$ = mm_strdup("temporary");
   17743             : }
   17744             : |  TEXT_P
   17745             :  { 
   17746           0 :  $$ = mm_strdup("text");
   17747             : }
   17748             : |  THEN
   17749             :  { 
   17750           0 :  $$ = mm_strdup("then");
   17751             : }
   17752             : |  TIES
   17753             :  { 
   17754           0 :  $$ = mm_strdup("ties");
   17755             : }
   17756             : |  TIME
   17757             :  { 
   17758           0 :  $$ = mm_strdup("time");
   17759             : }
   17760             : |  TIMESTAMP
   17761             :  { 
   17762           0 :  $$ = mm_strdup("timestamp");
   17763             : }
   17764             : |  TRAILING
   17765             :  { 
   17766           0 :  $$ = mm_strdup("trailing");
   17767             : }
   17768             : |  TRANSACTION
   17769             :  { 
   17770           0 :  $$ = mm_strdup("transaction");
   17771             : }
   17772             : |  TRANSFORM
   17773             :  { 
   17774           0 :  $$ = mm_strdup("transform");
   17775             : }
   17776             : |  TREAT
   17777             :  { 
   17778           0 :  $$ = mm_strdup("treat");
   17779             : }
   17780             : |  TRIGGER
   17781             :  { 
   17782           0 :  $$ = mm_strdup("trigger");
   17783             : }
   17784             : |  TRIM
   17785             :  { 
   17786           0 :  $$ = mm_strdup("trim");
   17787             : }
   17788             : |  TRUE_P
   17789             :  { 
   17790           0 :  $$ = mm_strdup("true");
   17791             : }
   17792             : |  TRUNCATE
   17793             :  { 
   17794           0 :  $$ = mm_strdup("truncate");
   17795             : }
   17796             : |  TRUSTED
   17797             :  { 
   17798           0 :  $$ = mm_strdup("trusted");
   17799             : }
   17800             : |  TYPE_P
   17801             :  { 
   17802           0 :  $$ = mm_strdup("type");
   17803             : }
   17804             : |  TYPES_P
   17805             :  { 
   17806           0 :  $$ = mm_strdup("types");
   17807             : }
   17808             : |  UESCAPE
   17809             :  { 
   17810           0 :  $$ = mm_strdup("uescape");
   17811             : }
   17812             : |  UNBOUNDED
   17813             :  { 
   17814           0 :  $$ = mm_strdup("unbounded");
   17815             : }
   17816             : |  UNCOMMITTED
   17817             :  { 
   17818           0 :  $$ = mm_strdup("uncommitted");
   17819             : }
   17820             : |  UNCONDITIONAL
   17821             :  { 
   17822           0 :  $$ = mm_strdup("unconditional");
   17823             : }
   17824             : |  UNENCRYPTED
   17825             :  { 
   17826           0 :  $$ = mm_strdup("unencrypted");
   17827             : }
   17828             : |  UNIQUE
   17829             :  { 
   17830           0 :  $$ = mm_strdup("unique");
   17831             : }
   17832             : |  UNKNOWN
   17833             :  { 
   17834           0 :  $$ = mm_strdup("unknown");
   17835             : }
   17836             : |  UNLISTEN
   17837             :  { 
   17838           0 :  $$ = mm_strdup("unlisten");
   17839             : }
   17840             : |  UNLOGGED
   17841             :  { 
   17842           0 :  $$ = mm_strdup("unlogged");
   17843             : }
   17844             : |  UNTIL
   17845             :  { 
   17846           0 :  $$ = mm_strdup("until");
   17847             : }
   17848             : |  UPDATE
   17849             :  { 
   17850           0 :  $$ = mm_strdup("update");
   17851             : }
   17852             : |  USER
   17853             :  { 
   17854           0 :  $$ = mm_strdup("user");
   17855             : }
   17856             : |  USING
   17857             :  { 
   17858           0 :  $$ = mm_strdup("using");
   17859             : }
   17860             : |  VACUUM
   17861             :  { 
   17862           0 :  $$ = mm_strdup("vacuum");
   17863             : }
   17864             : |  VALID
   17865             :  { 
   17866           0 :  $$ = mm_strdup("valid");
   17867             : }
   17868             : |  VALIDATE
   17869             :  { 
   17870           0 :  $$ = mm_strdup("validate");
   17871             : }
   17872             : |  VALIDATOR
   17873             :  { 
   17874           0 :  $$ = mm_strdup("validator");
   17875             : }
   17876             : |  VALUE_P
   17877             :  { 
   17878           0 :  $$ = mm_strdup("value");
   17879             : }
   17880             : |  VALUES
   17881             :  { 
   17882           0 :  $$ = mm_strdup("values");
   17883             : }
   17884             : |  VARCHAR
   17885             :  { 
   17886           0 :  $$ = mm_strdup("varchar");
   17887             : }
   17888             : |  VARIADIC
   17889             :  { 
   17890           0 :  $$ = mm_strdup("variadic");
   17891             : }
   17892             : |  VERBOSE
   17893             :  { 
   17894           0 :  $$ = mm_strdup("verbose");
   17895             : }
   17896             : |  VERSION_P
   17897             :  { 
   17898           0 :  $$ = mm_strdup("version");
   17899             : }
   17900             : |  VIEW
   17901             :  { 
   17902           0 :  $$ = mm_strdup("view");
   17903             : }
   17904             : |  VIEWS
   17905             :  { 
   17906           0 :  $$ = mm_strdup("views");
   17907             : }
   17908             : |  VOLATILE
   17909             :  { 
   17910           0 :  $$ = mm_strdup("volatile");
   17911             : }
   17912             : |  WHEN
   17913             :  { 
   17914           0 :  $$ = mm_strdup("when");
   17915             : }
   17916             : |  WHITESPACE_P
   17917             :  { 
   17918           0 :  $$ = mm_strdup("whitespace");
   17919             : }
   17920             : |  WORK
   17921             :  { 
   17922           0 :  $$ = mm_strdup("work");
   17923             : }
   17924             : |  WRAPPER
   17925             :  { 
   17926           0 :  $$ = mm_strdup("wrapper");
   17927             : }
   17928             : |  WRITE
   17929             :  { 
   17930           0 :  $$ = mm_strdup("write");
   17931             : }
   17932             : |  XML_P
   17933             :  { 
   17934           0 :  $$ = mm_strdup("xml");
   17935             : }
   17936             : |  XMLATTRIBUTES
   17937             :  { 
   17938           0 :  $$ = mm_strdup("xmlattributes");
   17939             : }
   17940             : |  XMLCONCAT
   17941             :  { 
   17942           0 :  $$ = mm_strdup("xmlconcat");
   17943             : }
   17944             : |  XMLELEMENT
   17945             :  { 
   17946           0 :  $$ = mm_strdup("xmlelement");
   17947             : }
   17948             : |  XMLEXISTS
   17949             :  { 
   17950           0 :  $$ = mm_strdup("xmlexists");
   17951             : }
   17952             : |  XMLFOREST
   17953             :  { 
   17954           0 :  $$ = mm_strdup("xmlforest");
   17955             : }
   17956             : |  XMLNAMESPACES
   17957             :  { 
   17958           0 :  $$ = mm_strdup("xmlnamespaces");
   17959             : }
   17960             : |  XMLPARSE
   17961             :  { 
   17962           0 :  $$ = mm_strdup("xmlparse");
   17963             : }
   17964             : |  XMLPI
   17965             :  { 
   17966           0 :  $$ = mm_strdup("xmlpi");
   17967             : }
   17968             : |  XMLROOT
   17969             :  { 
   17970           0 :  $$ = mm_strdup("xmlroot");
   17971             : }
   17972             : |  XMLSERIALIZE
   17973             :  { 
   17974           0 :  $$ = mm_strdup("xmlserialize");
   17975             : }
   17976             : |  XMLTABLE
   17977             :  { 
   17978           0 :  $$ = mm_strdup("xmltable");
   17979             : }
   17980             : |  YES_P
   17981             :  { 
   17982           0 :  $$ = mm_strdup("yes");
   17983             : }
   17984             : |  ZONE
   17985             :  { 
   17986           0 :  $$ = mm_strdup("zone");
   17987             : }
   17988             : ;
   17989             : 
   17990             : 
   17991             : /* trailer */
   17992             : /* src/interfaces/ecpg/preproc/ecpg.trailer */
   17993             : 
   17994             : statements: /*EMPTY*/
   17995             :                 | statements statement
   17996             :         ;
   17997             : 
   17998             : statement: ecpgstart at toplevel_stmt ';'
   17999             :                 {
   18000         196 :                     if (connection)
   18001         196 :                         free(connection);
   18002         196 :                     connection = NULL;
   18003             :                 }
   18004             :                 | ecpgstart toplevel_stmt ';'
   18005             :                 {
   18006        2164 :                     if (connection)
   18007          26 :                         free(connection);
   18008        2164 :                     connection = NULL;
   18009             :                 }
   18010             :                 | ecpgstart ECPGVarDeclaration
   18011             :                 {
   18012          48 :                     fprintf(base_yyout, "%s", $2);
   18013          48 :                     free($2);
   18014          48 :                     output_line_number();
   18015             :                 }
   18016             :                 | ECPGDeclaration
   18017       41998 :                 | c_thing               { fprintf(base_yyout, "%s", $1); free($1); }
   18018        1408 :                 | CPP_LINE              { fprintf(base_yyout, "%s", $1); free($1); }
   18019         648 :                 | '{'                   { braces_open++; fputs("{", base_yyout); }
   18020             :                 | '}'
   18021             :         {
   18022         648 :             remove_typedefs(braces_open);
   18023         648 :             remove_variables(braces_open--);
   18024         648 :             if (braces_open == 0)
   18025             :             {
   18026         284 :                 free(current_function);
   18027         284 :                 current_function = NULL;
   18028             :             }
   18029         648 :             fputs("}", base_yyout);
   18030             :         }
   18031             :         ;
   18032             : 
   18033           2 : CreateAsStmt: CREATE OptTemp TABLE create_as_target AS {FoundInto = 0;} SelectStmt opt_with_data
   18034             :         {
   18035           2 :             if (FoundInto == 1)
   18036           0 :                 mmerror(PARSE_ERROR, ET_ERROR, "CREATE TABLE AS cannot specify INTO");
   18037             : 
   18038           2 :             $$ = cat_str(7, mm_strdup("create"), $2, mm_strdup("table"), $4, mm_strdup("as"), $7, $8);
   18039             :         }
   18040           2 :         |  CREATE OptTemp TABLE IF_P NOT EXISTS create_as_target AS {FoundInto = 0;} SelectStmt opt_with_data
   18041             :         {
   18042           2 :             if (FoundInto == 1)
   18043           0 :                 mmerror(PARSE_ERROR, ET_ERROR, "CREATE TABLE AS cannot specify INTO");
   18044             : 
   18045           2 :             $$ = cat_str(7, mm_strdup("create"), $2, mm_strdup("table if not exists"), $7, mm_strdup("as"), $10, $11);
   18046             :         }
   18047             :         ;
   18048             : 
   18049             : at: AT connection_object
   18050             :         {
   18051         196 :             connection = $2;
   18052             :             /*
   18053             :              * Do we have a variable as connection target?  Remove the variable
   18054             :              * from the variable list or else it will be used twice.
   18055             :              */
   18056         196 :             if (argsinsert != NULL)
   18057           0 :                 argsinsert = NULL;
   18058             :         }
   18059             :         ;
   18060             : 
   18061             : /*
   18062             :  * the exec sql connect statement: connect to the given database
   18063             :  */
   18064             : ECPGConnect: SQL_CONNECT TO connection_target opt_connection_name opt_user
   18065         184 :             { $$ = cat_str(5, $3, mm_strdup(","), $5, mm_strdup(","), $4); }
   18066             :         | SQL_CONNECT TO DEFAULT
   18067           0 :             { $$ = mm_strdup("NULL, NULL, NULL, \"DEFAULT\""); }
   18068             :           /* also allow ORACLE syntax */
   18069             :         | SQL_CONNECT ora_user
   18070           0 :             { $$ = cat_str(3, mm_strdup("NULL,"), $2, mm_strdup(", NULL")); }
   18071             :         | DATABASE connection_target
   18072           0 :             { $$ = cat2_str($2, mm_strdup(", NULL, NULL, NULL")); }
   18073             :         ;
   18074             : 
   18075             : connection_target: opt_database_name opt_server opt_port
   18076             :         {
   18077             :             /* old style: dbname[@server][:port] */
   18078         156 :             if (strlen($2) > 0 && *($2) != '@')
   18079           0 :                 mmerror(PARSE_ERROR, ET_ERROR, "expected \"@\", found \"%s\"", $2);
   18080             : 
   18081             :             /* C strings need to be handled differently */
   18082         156 :             if ($1[0] == '\"')
   18083          10 :                 $$ = $1;
   18084             :             else
   18085         146 :                 $$ = make3_str(mm_strdup("\""), make3_str($1, $2, $3), mm_strdup("\""));
   18086             :         }
   18087             :         |  db_prefix ':' server opt_port '/' opt_database_name opt_options
   18088             :         {
   18089             :             /* new style: <tcp|unix>:postgresql://server[:port][/dbname] */
   18090          18 :             if (strncmp($1, "unix:postgresql", strlen("unix:postgresql")) != 0 && strncmp($1, "tcp:postgresql", strlen("tcp:postgresql")) != 0)
   18091           0 :                 mmerror(PARSE_ERROR, ET_ERROR, "only protocols \"tcp\" and \"unix\" and database type \"postgresql\" are supported");
   18092             : 
   18093          18 :             if (strncmp($3, "//", strlen("//")) != 0)
   18094           0 :                 mmerror(PARSE_ERROR, ET_ERROR, "expected \"://\", found \"%s\"", $3);
   18095             : 
   18096          18 :             if (strncmp($1, "unix", strlen("unix")) == 0 &&
   18097          10 :                 strncmp($3 + strlen("//"), "localhost", strlen("localhost")) != 0 &&
   18098           0 :                 strncmp($3 + strlen("//"), "127.0.0.1", strlen("127.0.0.1")) != 0)
   18099           0 :                 mmerror(PARSE_ERROR, ET_ERROR, "Unix-domain sockets only work on \"localhost\" but not on \"%s\"", $3 + strlen("//"));
   18100             : 
   18101          18 :             $$ = make3_str(make3_str(mm_strdup("\""), $1, mm_strdup(":")), $3, make3_str(make3_str($4, mm_strdup("/"), $6), $7, mm_strdup("\"")));
   18102             :         }
   18103             :         | char_variable
   18104             :         {
   18105           6 :             $$ = $1;
   18106             :         }
   18107             :         | ecpg_sconst
   18108             :         {
   18109             :             /* We can only process double quoted strings not single quotes ones,
   18110             :              * so we change the quotes.
   18111             :              * Note, that the rule for ecpg_sconst adds these single quotes. */
   18112           4 :             $1[0] = '\"';
   18113           4 :             $1[strlen($1)-1] = '\"';
   18114           4 :             $$ = $1;
   18115             :         }
   18116             :         ;
   18117             : 
   18118         170 : opt_database_name: name             { $$ = $1; }
   18119           4 :         | /*EMPTY*/         { $$ = EMPTY; }
   18120             :         ;
   18121             : 
   18122             : db_prefix: ecpg_ident cvariable
   18123             :         {
   18124          18 :             if (strcmp($2, "postgresql") != 0 && strcmp($2, "postgres") != 0)
   18125           0 :                 mmerror(PARSE_ERROR, ET_ERROR, "expected \"postgresql\", found \"%s\"", $2);
   18126             : 
   18127          18 :             if (strcmp($1, "tcp") != 0 && strcmp($1, "unix") != 0)
   18128           0 :                 mmerror(PARSE_ERROR, ET_ERROR, "invalid connection type: %s", $1);
   18129             : 
   18130          18 :             $$ = make3_str($1, mm_strdup(":"), $2);
   18131             :         }
   18132             :         ;
   18133             : 
   18134             : server: Op server_name
   18135             :         {
   18136          22 :             if (strcmp($1, "@") != 0 && strcmp($1, "//") != 0)
   18137           0 :                 mmerror(PARSE_ERROR, ET_ERROR, "expected \"@\" or \"://\", found \"%s\"", $1);
   18138             : 
   18139          22 :             $$ = make2_str($1, $2);
   18140             :         }
   18141             :         ;
   18142             : 
   18143           4 : opt_server: server          { $$ = $1; }
   18144         152 :         | /*EMPTY*/         { $$ = EMPTY; }
   18145             :         ;
   18146             : 
   18147          20 : server_name: ColId                  { $$ = $1; }
   18148           0 :         | ColId '.' server_name     { $$ = make3_str($1, mm_strdup("."), $3); }
   18149           2 :         | IP                        { $$ = make_name(); }
   18150             :         ;
   18151             : 
   18152           2 : opt_port: ':' Iconst        { $$ = make2_str(mm_strdup(":"), $2); }
   18153         172 :         | /*EMPTY*/ { $$ = EMPTY; }
   18154             :         ;
   18155             : 
   18156          76 : opt_connection_name: AS connection_object   { $$ = $2; }
   18157         108 :         | /*EMPTY*/         { $$ = mm_strdup("NULL"); }
   18158             :         ;
   18159             : 
   18160          32 : opt_user: USER ora_user     { $$ = $2; }
   18161         152 :         | /*EMPTY*/         { $$ = mm_strdup("NULL, NULL"); }
   18162             :         ;
   18163             : 
   18164             : ora_user: user_name
   18165           6 :             { $$ = cat2_str($1, mm_strdup(", NULL")); }
   18166             :         | user_name '/' user_name
   18167          10 :             { $$ = cat_str(3, $1, mm_strdup(","), $3); }
   18168             :         | user_name SQL_IDENTIFIED BY user_name
   18169          10 :             { $$ = cat_str(3, $1, mm_strdup(","), $4); }
   18170             :         | user_name USING user_name
   18171           6 :             { $$ = cat_str(3, $1, mm_strdup(","), $3); }
   18172             :         ;
   18173             : 
   18174             : user_name: RoleId
   18175             :         {
   18176          54 :             if ($1[0] == '\"')
   18177           6 :                 $$ = $1;
   18178             :             else
   18179          48 :                 $$ = make3_str(mm_strdup("\""), $1, mm_strdup("\""));
   18180             :         }
   18181             :         | ecpg_sconst
   18182             :         {
   18183           0 :             if ($1[0] == '\"')
   18184           0 :                 $$ = $1;
   18185             :             else
   18186           0 :                 $$ = make3_str(mm_strdup("\""), $1, mm_strdup("\""));
   18187             :         }
   18188             :         | civar
   18189             :         {
   18190           4 :             enum ECPGttype type = argsinsert->variable->type->type;
   18191             : 
   18192             :             /* if array see what's inside */
   18193           4 :             if (type == ECPGt_array)
   18194           0 :                 type = argsinsert->variable->type->u.element->type;
   18195             : 
   18196             :             /* handle varchars */
   18197           4 :             if (type == ECPGt_varchar)
   18198           0 :                 $$ = make2_str(mm_strdup(argsinsert->variable->name), mm_strdup(".arr"));
   18199             :             else
   18200           4 :                 $$ = mm_strdup(argsinsert->variable->name);
   18201             :         }
   18202             :         ;
   18203             : 
   18204             : char_variable: cvariable
   18205             :         {
   18206             :             /* check if we have a string variable */
   18207         256 :             struct variable *p = find_variable($1);
   18208         256 :             enum ECPGttype type = p->type->type;
   18209             : 
   18210             :             /* If we have just one character this is not a string */
   18211         256 :             if (atol(p->type->size) == 1)
   18212           0 :                     mmerror(PARSE_ERROR, ET_ERROR, "invalid data type");
   18213             :             else
   18214             :             {
   18215             :                 /* if array see what's inside */
   18216         256 :                 if (type == ECPGt_array)
   18217           0 :                     type = p->type->u.element->type;
   18218             : 
   18219             :                 switch (type)
   18220             :                 {
   18221         236 :                     case ECPGt_char:
   18222             :                     case ECPGt_unsigned_char:
   18223             :                     case ECPGt_string:
   18224         236 :                         $$ = $1;
   18225         236 :                         break;
   18226          20 :                     case ECPGt_varchar:
   18227          20 :                         $$ = make2_str($1, mm_strdup(".arr"));
   18228          20 :                         break;
   18229           0 :                     default:
   18230           0 :                         mmerror(PARSE_ERROR, ET_ERROR, "invalid data type");
   18231           0 :                         $$ = $1;
   18232           0 :                         break;
   18233             :                 }
   18234             :             }
   18235             :         }
   18236             :         ;
   18237             : 
   18238             : opt_options: Op connect_options
   18239             :         {
   18240           4 :             if (strlen($1) == 0)
   18241           0 :                 mmerror(PARSE_ERROR, ET_ERROR, "incomplete statement");
   18242             : 
   18243           4 :             if (strcmp($1, "?") != 0)
   18244           0 :                 mmerror(PARSE_ERROR, ET_ERROR, "unrecognized token \"%s\"", $1);
   18245             : 
   18246           4 :             $$ = make2_str(mm_strdup("?"), $2);
   18247             :         }
   18248          14 :         | /*EMPTY*/ { $$ = EMPTY; }
   18249             :         ;
   18250             : 
   18251             : connect_options:  ColId opt_opt_value
   18252             :             {
   18253           4 :                 $$ = make2_str($1, $2);
   18254             :             }
   18255             :         | ColId opt_opt_value Op connect_options
   18256             :             {
   18257           2 :                 if (strlen($3) == 0)
   18258           0 :                     mmerror(PARSE_ERROR, ET_ERROR, "incomplete statement");
   18259             : 
   18260           2 :                 if (strcmp($3, "&") != 0)
   18261           0 :                     mmerror(PARSE_ERROR, ET_ERROR, "unrecognized token \"%s\"", $3);
   18262             : 
   18263           2 :                 $$ = cat_str(3, make2_str($1, $2), $3, $4);
   18264             :             }
   18265             :         ;
   18266             : 
   18267             : opt_opt_value: /*EMPTY*/
   18268           0 :             { $$ = EMPTY; }
   18269             :         | '=' Iconst
   18270           4 :             { $$ = make2_str(mm_strdup("="), $2); }
   18271             :         | '=' ecpg_ident
   18272           2 :             { $$ = make2_str(mm_strdup("="), $2); }
   18273             :         | '=' civar
   18274           0 :             { $$ = make2_str(mm_strdup("="), $2); }
   18275             :         ;
   18276             : 
   18277             : prepared_name: name
   18278             :         {
   18279         310 :             if ($1[0] == '\"' && $1[strlen($1)-1] == '\"') /* already quoted? */
   18280          50 :                 $$ = $1;
   18281             :             else /* not quoted => convert to lowercase */
   18282             :             {
   18283             :                 size_t i;
   18284             : 
   18285        1666 :                 for (i = 0; i< strlen($1); i++)
   18286        1406 :                     $1[i] = tolower((unsigned char) $1[i]);
   18287             : 
   18288         260 :                 $$ = make3_str(mm_strdup("\""), $1, mm_strdup("\""));
   18289             :             }
   18290             :         }
   18291          28 :         | char_variable { $$ = $1; }
   18292             :         ;
   18293             : 
   18294             : /*
   18295             :  * Declare Statement
   18296             :  */
   18297             : ECPGDeclareStmt: DECLARE prepared_name STATEMENT
   18298             :         {
   18299          10 :             struct declared_list *ptr = NULL;
   18300             :             /* Check whether the declared name has been defined or not */
   18301          30 :             for (ptr = g_declared_list; ptr != NULL; ptr = ptr->next)
   18302             :             {
   18303          20 :                 if (strcmp($2, ptr->name) == 0)
   18304             :                 {
   18305             :                     /* re-definition is not allowed */
   18306           0 :                     mmerror(PARSE_ERROR, ET_ERROR, "name \"%s\" is already declared", ptr->name);
   18307             :                 }
   18308             :             }
   18309             : 
   18310             :             /* Add a new declared name into the g_declared_list */
   18311          10 :             ptr = NULL;
   18312          10 :             ptr = (struct declared_list *)mm_alloc(sizeof(struct declared_list));
   18313          10 :             if (ptr)
   18314             :             {
   18315             :                 /* initial definition */
   18316          10 :                 ptr -> name = $2;
   18317          10 :                 if (connection)
   18318           4 :                     ptr -> connection = mm_strdup(connection);
   18319             :                 else
   18320           6 :                     ptr -> connection = NULL;
   18321             : 
   18322          10 :                 ptr -> next = g_declared_list;
   18323          10 :                 g_declared_list = ptr;
   18324             :             }
   18325             : 
   18326          10 :             $$ = cat_str(3 , mm_strdup("/* declare "), mm_strdup($2), mm_strdup(" as an SQL identifier */"));
   18327             :         }
   18328             : ;
   18329             : 
   18330             : /*
   18331             :  * Declare a prepared cursor. The syntax is different from the standard
   18332             :  * declare statement, so we create a new rule.
   18333             :  */
   18334             : ECPGCursorStmt:  DECLARE cursor_name cursor_options CURSOR opt_hold FOR prepared_name
   18335             :         {
   18336             :             struct cursor *ptr, *this;
   18337          40 :             char *cursor_marker = $2[0] == ':' ? mm_strdup("$0") : mm_strdup($2);
   18338          40 :             int (* strcmp_fn)(const char *, const char *) = (($2[0] == ':' || $2[0] == '"') ? strcmp : pg_strcasecmp);
   18339          40 :             struct variable *thisquery = (struct variable *)mm_alloc(sizeof(struct variable));
   18340             :             char *comment;
   18341             :             char *con;
   18342             : 
   18343          40 :             if (INFORMIX_MODE && pg_strcasecmp($2, "database") == 0)
   18344           0 :                                 mmfatal(PARSE_ERROR, "\"database\" cannot be used as cursor name in INFORMIX mode");
   18345             : 
   18346          40 :                         check_declared_list($7);
   18347          40 :             con = connection ? connection : "NULL";
   18348          84 :             for (ptr = cur; ptr != NULL; ptr = ptr->next)
   18349             :             {
   18350          44 :                 if (strcmp_fn($2, ptr->name) == 0)
   18351             :                 {
   18352             :                     /* re-definition is a bug */
   18353           0 :                     if ($2[0] == ':')
   18354           0 :                         mmerror(PARSE_ERROR, ET_ERROR, "using variable \"%s\" in different declare statements is not supported", $2+1);
   18355             :                     else
   18356           0 :                         mmerror(PARSE_ERROR, ET_ERROR, "cursor \"%s\" is already defined", $2);
   18357             :                 }
   18358             :             }
   18359             : 
   18360          40 :             this = (struct cursor *) mm_alloc(sizeof(struct cursor));
   18361             : 
   18362             :             /* initial definition */
   18363          40 :             this->next = cur;
   18364          40 :             this->name = $2;
   18365          40 :             this->function = (current_function ? mm_strdup(current_function) : NULL);
   18366          40 :             this->connection = connection ? mm_strdup(connection) : NULL;
   18367          40 :             this->command =  cat_str(6, mm_strdup("declare"), cursor_marker, $3, mm_strdup("cursor"), $5, mm_strdup("for $1"));
   18368          40 :             this->argsresult = NULL;
   18369          40 :             this->argsresult_oos = NULL;
   18370             : 
   18371          40 :             thisquery->type = &ecpg_query;
   18372          40 :             thisquery->brace_level = 0;
   18373          40 :             thisquery->next = NULL;
   18374          40 :             thisquery->name = (char *) mm_alloc(sizeof("ECPGprepared_statement(, , __LINE__)") + strlen(con) + strlen($7));
   18375          40 :             sprintf(thisquery->name, "ECPGprepared_statement(%s, %s, __LINE__)", con, $7);
   18376             : 
   18377          40 :             this->argsinsert = NULL;
   18378          40 :             this->argsinsert_oos = NULL;
   18379          40 :             if ($2[0] == ':')
   18380             :             {
   18381           6 :                 struct variable *var = find_variable($2 + 1);
   18382           6 :                 remove_variable_from_list(&argsinsert, var);
   18383           6 :                 add_variable_to_head(&(this->argsinsert), var, &no_indicator);
   18384             :             }
   18385          40 :             add_variable_to_head(&(this->argsinsert), thisquery, &no_indicator);
   18386             : 
   18387          40 :             cur = this;
   18388             : 
   18389          40 :             comment = cat_str(3, mm_strdup("/*"), mm_strdup(this->command), mm_strdup("*/"));
   18390             : 
   18391          40 :             $$ = cat_str(2, adjust_outofscope_cursor_vars(this),
   18392             :                     comment);
   18393             :         }
   18394             :         ;
   18395             : 
   18396             : ECPGExecuteImmediateStmt: EXECUTE IMMEDIATE execstring
   18397             :             {
   18398             :               /* execute immediate means prepare the statement and
   18399             :                * immediately execute it */
   18400          14 :               $$ = $3;
   18401             :             };
   18402             : /*
   18403             :  * variable declaration outside exec sql declare block
   18404             :  */
   18405             : ECPGVarDeclaration: single_vt_declaration;
   18406             : 
   18407          18 : single_vt_declaration: type_declaration     { $$ = $1; }
   18408         496 :         | var_declaration       { $$ = $1; }
   18409             :         ;
   18410             : 
   18411           2 : precision:  NumericOnly { $$ = $1; };
   18412             : 
   18413           2 : opt_scale:  ',' NumericOnly { $$ = $2; }
   18414           0 :         | /* EMPTY */   { $$ = EMPTY; }
   18415             :         ;
   18416             : 
   18417          98 : ecpg_interval:  opt_interval    { $$ = $1; }
   18418           0 :         | YEAR_P TO MINUTE_P    { $$ = mm_strdup("year to minute"); }
   18419           0 :         | YEAR_P TO SECOND_P    { $$ = mm_strdup("year to second"); }
   18420           0 :         | DAY_P TO DAY_P        { $$ = mm_strdup("day to day"); }
   18421           0 :         | MONTH_P TO MONTH_P    { $$ = mm_strdup("month to month"); }
   18422             :         ;
   18423             : 
   18424             : /*
   18425             :  * variable declaration inside exec sql declare block
   18426             :  */
   18427             : ECPGDeclaration: sql_startdeclare
   18428         126 :         { fputs("/* exec sql begin declare section */", base_yyout); }
   18429             :         var_type_declarations sql_enddeclare
   18430             :         {
   18431         126 :             fprintf(base_yyout, "%s/* exec sql end declare section */", $3);
   18432         126 :             free($3);
   18433         126 :             output_line_number();
   18434             :         }
   18435             :         ;
   18436             : 
   18437             : sql_startdeclare: ecpgstart BEGIN_P DECLARE SQL_SECTION ';' {};
   18438             : 
   18439             : sql_enddeclare: ecpgstart END_P DECLARE SQL_SECTION ';' {};
   18440             : 
   18441           0 : var_type_declarations:  /*EMPTY*/           { $$ = EMPTY; }
   18442         126 :         | vt_declarations           { $$ = $1; }
   18443             :         ;
   18444             : 
   18445         126 : vt_declarations:  single_vt_declaration         { $$ = $1; }
   18446           0 :         | CPP_LINE              { $$ = $1; }
   18447         340 :         | vt_declarations single_vt_declaration { $$ = cat2_str($1, $2); }
   18448           4 :         | vt_declarations CPP_LINE      { $$ = cat2_str($1, $2); }
   18449             :         ;
   18450             : 
   18451          46 : variable_declarations:  var_declaration { $$ = $1; }
   18452          62 :         | variable_declarations var_declaration { $$ = cat2_str($1, $2); }
   18453             :         ;
   18454             : 
   18455             : type_declaration: S_TYPEDEF
   18456             :     {
   18457             :         /* reset this variable so we see if there was */
   18458             :         /* an initializer specified */
   18459          18 :         initializer = 0;
   18460             :     }
   18461             :     var_type opt_pointer ECPGColLabel opt_array_bounds ';'
   18462             :     {
   18463          18 :         add_typedef($5, $6.index1, $6.index2, $3.type_enum, $3.type_dimension, $3.type_index, initializer, *$4 ? 1 : 0);
   18464             : 
   18465          18 :         fprintf(base_yyout, "typedef %s %s %s %s;\n", $3.type_str, *$4 ? "*" : "", $5, $6.str);
   18466          18 :         output_line_number();
   18467          18 :         $$ = mm_strdup("");
   18468             :     };
   18469             : 
   18470             : var_declaration:
   18471             :         storage_declaration var_type
   18472             :         {
   18473           4 :             actual_type[struct_level].type_storage = $1;
   18474           4 :             actual_type[struct_level].type_enum = $2.type_enum;
   18475           4 :             actual_type[struct_level].type_str = $2.type_str;
   18476           4 :             actual_type[struct_level].type_dimension = $2.type_dimension;
   18477           4 :             actual_type[struct_level].type_index = $2.type_index;
   18478           4 :             actual_type[struct_level].type_sizeof = $2.type_sizeof;
   18479             : 
   18480           4 :             actual_startline[struct_level] = hashline_number();
   18481             :         }
   18482             :         variable_list ';'
   18483             :         {
   18484           4 :             $$ = cat_str(5, actual_startline[struct_level], $1, $2.type_str, $4, mm_strdup(";\n"));
   18485             :         }
   18486             :         | var_type
   18487             :         {
   18488         586 :             actual_type[struct_level].type_storage = EMPTY;
   18489         586 :             actual_type[struct_level].type_enum = $1.type_enum;
   18490         586 :             actual_type[struct_level].type_str = $1.type_str;
   18491         586 :             actual_type[struct_level].type_dimension = $1.type_dimension;
   18492         586 :             actual_type[struct_level].type_index = $1.type_index;
   18493         586 :             actual_type[struct_level].type_sizeof = $1.type_sizeof;
   18494             : 
   18495         586 :             actual_startline[struct_level] = hashline_number();
   18496             :         }
   18497             :         variable_list ';'
   18498             :         {
   18499         586 :             $$ = cat_str(4, actual_startline[struct_level], $1.type_str, $3, mm_strdup(";\n"));
   18500             :         }
   18501             :         | struct_union_type_with_symbol ';'
   18502             :         {
   18503          14 :             $$ = cat2_str($1, mm_strdup(";"));
   18504             :         }
   18505             :         ;
   18506             : 
   18507           0 : opt_bit_field:  ':' Iconst  { $$ =cat2_str(mm_strdup(":"), $2); }
   18508         698 :         | /* EMPTY */   { $$ = EMPTY; }
   18509             :         ;
   18510             : 
   18511             : storage_declaration: storage_clause storage_modifier
   18512           0 :             {$$ = cat2_str ($1, $2); }
   18513           4 :         | storage_clause        {$$ = $1; }
   18514           0 :         | storage_modifier      {$$ = $1; }
   18515             :         ;
   18516             : 
   18517           0 : storage_clause : S_EXTERN   { $$ = mm_strdup("extern"); }
   18518           4 :         | S_STATIC          { $$ = mm_strdup("static"); }
   18519           0 :         | S_REGISTER        { $$ = mm_strdup("register"); }
   18520           0 :         | S_AUTO            { $$ = mm_strdup("auto"); }
   18521             :         ;
   18522             : 
   18523           0 : storage_modifier : S_CONST  { $$ = mm_strdup("const"); }
   18524           0 :         | S_VOLATILE        { $$ = mm_strdup("volatile"); }
   18525             :         ;
   18526             : 
   18527             : var_type:   simple_type
   18528             :         {
   18529         452 :             $$.type_enum = $1;
   18530         452 :             $$.type_str = mm_strdup(ecpg_type_name($1));
   18531         452 :             $$.type_dimension = mm_strdup("-1");
   18532         452 :             $$.type_index = mm_strdup("-1");
   18533         452 :             $$.type_sizeof = NULL;
   18534             :         }
   18535             :         | struct_union_type
   18536             :         {
   18537          32 :             $$.type_str = $1;
   18538          32 :             $$.type_dimension = mm_strdup("-1");
   18539          32 :             $$.type_index = mm_strdup("-1");
   18540             : 
   18541          32 :             if (strncmp($1, "struct", sizeof("struct")-1) == 0)
   18542             :             {
   18543          28 :                 $$.type_enum = ECPGt_struct;
   18544          28 :                 $$.type_sizeof = ECPGstruct_sizeof;
   18545             :             }
   18546             :             else
   18547             :             {
   18548           4 :                 $$.type_enum = ECPGt_union;
   18549           4 :                 $$.type_sizeof = NULL;
   18550             :             }
   18551             :         }
   18552             :         | enum_type
   18553             :         {
   18554           0 :             $$.type_str = $1;
   18555           0 :             $$.type_enum = ECPGt_int;
   18556           0 :             $$.type_dimension = mm_strdup("-1");
   18557           0 :             $$.type_index = mm_strdup("-1");
   18558           0 :             $$.type_sizeof = NULL;
   18559             :         }
   18560             :         | NUMERIC '(' precision opt_scale ')'
   18561             :         {
   18562           0 :             $$.type_enum = ECPGt_numeric;
   18563           0 :             $$.type_str = mm_strdup("numeric");
   18564           0 :             $$.type_dimension = mm_strdup("-1");
   18565           0 :             $$.type_index = mm_strdup("-1");
   18566           0 :             $$.type_sizeof = NULL;
   18567             :         }
   18568             :         | DECIMAL_P '(' precision opt_scale ')'
   18569             :         {
   18570           0 :             $$.type_enum = ECPGt_decimal;
   18571           0 :             $$.type_str = mm_strdup("decimal");
   18572           0 :             $$.type_dimension = mm_strdup("-1");
   18573           0 :             $$.type_index = mm_strdup("-1");
   18574           0 :             $$.type_sizeof = NULL;
   18575             :         }
   18576             :         | IDENT '(' precision opt_scale ')'
   18577             :         {
   18578             :             /*
   18579             :              * In C parsing mode, NUMERIC and DECIMAL are not keywords, so
   18580             :              * they will show up here as a plain identifier, and we need
   18581             :              * this duplicate code to recognize them.
   18582             :              */
   18583           2 :             if (strcmp($1, "numeric") == 0)
   18584             :             {
   18585           2 :                 $$.type_enum = ECPGt_numeric;
   18586           2 :                 $$.type_str = mm_strdup("numeric");
   18587             :             }
   18588           0 :             else if (strcmp($1, "decimal") == 0)
   18589             :             {
   18590           0 :                 $$.type_enum = ECPGt_decimal;
   18591           0 :                 $$.type_str = mm_strdup("decimal");
   18592             :             }
   18593             :             else
   18594             :             {
   18595           0 :                 mmerror(PARSE_ERROR, ET_ERROR, "only data types numeric and decimal have precision/scale argument");
   18596           0 :                 $$.type_enum = ECPGt_numeric;
   18597           0 :                 $$.type_str = mm_strdup("numeric");
   18598             :             }
   18599             : 
   18600           2 :             $$.type_dimension = mm_strdup("-1");
   18601           2 :             $$.type_index = mm_strdup("-1");
   18602           2 :             $$.type_sizeof = NULL;
   18603             :         }
   18604             :         | VARCHAR
   18605             :         {
   18606          28 :             $$.type_enum = ECPGt_varchar;
   18607          28 :             $$.type_str = EMPTY; /*mm_strdup("varchar");*/
   18608          28 :             $$.type_dimension = mm_strdup("-1");
   18609          28 :             $$.type_index = mm_strdup("-1");
   18610          28 :             $$.type_sizeof = NULL;
   18611             :         }
   18612             :         | FLOAT_P
   18613             :         {
   18614             :             /* Note: DOUBLE is handled in simple_type */
   18615           6 :             $$.type_enum = ECPGt_float;
   18616           6 :             $$.type_str = mm_strdup("float");
   18617           6 :             $$.type_dimension = mm_strdup("-1");
   18618           6 :             $$.type_index = mm_strdup("-1");
   18619           6 :             $$.type_sizeof = NULL;
   18620             :         }
   18621             :         | NUMERIC
   18622             :         {
   18623           0 :             $$.type_enum = ECPGt_numeric;
   18624           0 :             $$.type_str = mm_strdup("numeric");
   18625           0 :             $$.type_dimension = mm_strdup("-1");
   18626           0 :             $$.type_index = mm_strdup("-1");
   18627           0 :             $$.type_sizeof = NULL;
   18628             :         }
   18629             :         | DECIMAL_P
   18630             :         {
   18631           4 :             $$.type_enum = ECPGt_decimal;
   18632           4 :             $$.type_str = mm_strdup("decimal");
   18633           4 :             $$.type_dimension = mm_strdup("-1");
   18634           4 :             $$.type_index = mm_strdup("-1");
   18635           4 :             $$.type_sizeof = NULL;
   18636             :         }
   18637             :         | TIMESTAMP
   18638             :         {
   18639           2 :             $$.type_enum = ECPGt_timestamp;
   18640           2 :             $$.type_str = mm_strdup("timestamp");
   18641           2 :             $$.type_dimension = mm_strdup("-1");
   18642           2 :             $$.type_index = mm_strdup("-1");
   18643           2 :             $$.type_sizeof = NULL;
   18644             :         }
   18645             :         | STRING_P
   18646             :         {
   18647           2 :             if (INFORMIX_MODE)
   18648             :             {
   18649             :                 /* In Informix mode, "string" is automatically a typedef */
   18650           2 :                 $$.type_enum = ECPGt_string;
   18651           2 :                 $$.type_str = mm_strdup("char");
   18652           2 :                 $$.type_dimension = mm_strdup("-1");
   18653           2 :                 $$.type_index = mm_strdup("-1");
   18654           2 :                 $$.type_sizeof = NULL;
   18655             :             }
   18656             :             else
   18657             :             {
   18658             :                 /* Otherwise, legal only if user typedef'ed it */
   18659           0 :                 struct typedefs *this = get_typedef("string", false);
   18660             : 
   18661           0 :                 $$.type_str = (this->type->type_enum == ECPGt_varchar || this->type->type_enum == ECPGt_bytea) ? EMPTY : mm_strdup(this->name);
   18662           0 :                 $$.type_enum = this->type->type_enum;
   18663           0 :                 $$.type_dimension = this->type->type_dimension;
   18664           0 :                 $$.type_index = this->type->type_index;
   18665           0 :                 if (this->type->type_sizeof && strlen(this->type->type_sizeof) != 0)
   18666           0 :                     $$.type_sizeof = this->type->type_sizeof;
   18667             :                 else
   18668           0 :                     $$.type_sizeof = cat_str(3, mm_strdup("sizeof("), mm_strdup(this->name), mm_strdup(")"));
   18669             : 
   18670           0 :                 struct_member_list[struct_level] = ECPGstruct_member_dup(this->struct_member_list);
   18671             :             }
   18672             :         }
   18673             :         | INTERVAL ecpg_interval
   18674             :         {
   18675           0 :             $$.type_enum = ECPGt_interval;
   18676           0 :             $$.type_str = mm_strdup("interval");
   18677           0 :             $$.type_dimension = mm_strdup("-1");
   18678           0 :             $$.type_index = mm_strdup("-1");
   18679           0 :             $$.type_sizeof = NULL;
   18680             :         }
   18681             :         | IDENT ecpg_interval
   18682             :         {
   18683             :             /*
   18684             :              * In C parsing mode, the above SQL type names are not keywords,
   18685             :              * so they will show up here as a plain identifier, and we need
   18686             :              * this duplicate code to recognize them.
   18687             :              *
   18688             :              * Note that we also handle the type names bytea, date, and
   18689             :              * datetime here, but not above because those are not currently
   18690             :              * SQL keywords.  If they ever become so, they must gain duplicate
   18691             :              * productions above.
   18692             :              */
   18693          98 :             if (strlen($2) != 0 && strcmp ($1, "datetime") != 0 && strcmp ($1, "interval") != 0)
   18694           0 :                 mmerror (PARSE_ERROR, ET_ERROR, "interval specification not allowed here");
   18695             : 
   18696          98 :             if (strcmp($1, "varchar") == 0)
   18697             :             {
   18698           0 :                 $$.type_enum = ECPGt_varchar;
   18699           0 :                 $$.type_str = EMPTY; /*mm_strdup("varchar");*/
   18700           0 :                 $$.type_dimension = mm_strdup("-1");
   18701           0 :                 $$.type_index = mm_strdup("-1");
   18702           0 :                 $$.type_sizeof = NULL;
   18703             :             }
   18704          98 :             else if (strcmp($1, "bytea") == 0)
   18705             :             {
   18706           8 :                 $$.type_enum = ECPGt_bytea;
   18707           8 :                 $$.type_str = EMPTY;
   18708           8 :                 $$.type_dimension = mm_strdup("-1");
   18709           8 :                 $$.type_index = mm_strdup("-1");
   18710           8 :                 $$.type_sizeof = NULL;
   18711             :             }
   18712          90 :             else if (strcmp($1, "float") == 0)
   18713             :             {
   18714           0 :                 $$.type_enum = ECPGt_float;
   18715           0 :                 $$.type_str = mm_strdup("float");
   18716           0 :                 $$.type_dimension = mm_strdup("-1");
   18717           0 :                 $$.type_index = mm_strdup("-1");
   18718           0 :                 $$.type_sizeof = NULL;
   18719             :             }
   18720          90 :             else if (strcmp($1, "double") == 0)
   18721             :             {
   18722          12 :                 $$.type_enum = ECPGt_double;
   18723          12 :                 $$.type_str = mm_strdup("double");
   18724          12 :                 $$.type_dimension = mm_strdup("-1");
   18725          12 :                 $$.type_index = mm_strdup("-1");
   18726          12 :                 $$.type_sizeof = NULL;
   18727             :             }
   18728          78 :             else if (strcmp($1, "numeric") == 0)
   18729             :             {
   18730           4 :                 $$.type_enum = ECPGt_numeric;
   18731           4 :                 $$.type_str = mm_strdup("numeric");
   18732           4 :                 $$.type_dimension = mm_strdup("-1");
   18733           4 :                 $$.type_index = mm_strdup("-1");
   18734           4 :                 $$.type_sizeof = NULL;
   18735             :             }
   18736          74 :             else if (strcmp($1, "decimal") == 0)
   18737             :             {
   18738           0 :                 $$.type_enum = ECPGt_decimal;
   18739           0 :                 $$.type_str = mm_strdup("decimal");
   18740           0 :                 $$.type_dimension = mm_strdup("-1");
   18741           0 :                 $$.type_index = mm_strdup("-1");
   18742           0 :                 $$.type_sizeof = NULL;
   18743             :             }
   18744          74 :             else if (strcmp($1, "date") == 0)
   18745             :             {
   18746          10 :                 $$.type_enum = ECPGt_date;
   18747          10 :                 $$.type_str = mm_strdup("date");
   18748          10 :                 $$.type_dimension = mm_strdup("-1");
   18749          10 :                 $$.type_index = mm_strdup("-1");
   18750          10 :                 $$.type_sizeof = NULL;
   18751             :             }
   18752          64 :             else if (strcmp($1, "timestamp") == 0)
   18753             :             {
   18754          12 :                 $$.type_enum = ECPGt_timestamp;
   18755          12 :                 $$.type_str = mm_strdup("timestamp");
   18756          12 :                 $$.type_dimension = mm_strdup("-1");
   18757          12 :                 $$.type_index = mm_strdup("-1");
   18758          12 :                 $$.type_sizeof = NULL;
   18759             :             }
   18760          52 :             else if (strcmp($1, "interval") == 0)
   18761             :             {
   18762           8 :                 $$.type_enum = ECPGt_interval;
   18763           8 :                 $$.type_str = mm_strdup("interval");
   18764           8 :                 $$.type_dimension = mm_strdup("-1");
   18765           8 :                 $$.type_index = mm_strdup("-1");
   18766           8 :                 $$.type_sizeof = NULL;
   18767             :             }
   18768          44 :             else if (strcmp($1, "datetime") == 0)
   18769             :             {
   18770           0 :                 $$.type_enum = ECPGt_timestamp;
   18771           0 :                 $$.type_str = mm_strdup("timestamp");
   18772           0 :                 $$.type_dimension = mm_strdup("-1");
   18773           0 :                 $$.type_index = mm_strdup("-1");
   18774           0 :                 $$.type_sizeof = NULL;
   18775             :             }
   18776          44 :             else if ((strcmp($1, "string") == 0) && INFORMIX_MODE)
   18777             :             {
   18778           0 :                 $$.type_enum = ECPGt_string;
   18779           0 :                 $$.type_str = mm_strdup("char");
   18780           0 :                 $$.type_dimension = mm_strdup("-1");
   18781           0 :                 $$.type_index = mm_strdup("-1");
   18782           0 :                 $$.type_sizeof = NULL;
   18783             :             }
   18784             :             else
   18785             :             {
   18786             :                 /* Otherwise, it must be a user-defined typedef name */
   18787          44 :                 struct typedefs *this = get_typedef($1, false);
   18788             : 
   18789          44 :                 $$.type_str = (this->type->type_enum == ECPGt_varchar || this->type->type_enum == ECPGt_bytea) ? EMPTY : mm_strdup(this->name);
   18790          44 :                 $$.type_enum = this->type->type_enum;
   18791          44 :                 $$.type_dimension = this->type->type_dimension;
   18792          44 :                 $$.type_index = this->type->type_index;
   18793          44 :                 if (this->type->type_sizeof && strlen(this->type->type_sizeof) != 0)
   18794           8 :                     $$.type_sizeof = this->type->type_sizeof;
   18795             :                 else
   18796          36 :                     $$.type_sizeof = cat_str(3, mm_strdup("sizeof("), mm_strdup(this->name), mm_strdup(")"));
   18797             : 
   18798          44 :                 struct_member_list[struct_level] = ECPGstruct_member_dup(this->struct_member_list);
   18799             :             }
   18800             :         }
   18801             :         | s_struct_union_symbol
   18802             :         {
   18803             :             /* this is for named structs/unions */
   18804             :             char *name;
   18805             :             struct typedefs *this;
   18806          12 :             bool forward = (forward_name != NULL && strcmp($1.symbol, forward_name) == 0 && strcmp($1.su, "struct") == 0);
   18807             : 
   18808          12 :             name = cat2_str($1.su, $1.symbol);
   18809             :             /* Do we have a forward definition? */
   18810          12 :             if (!forward)
   18811             :             {
   18812             :                 /* No */
   18813             : 
   18814          12 :                 this = get_typedef(name, false);
   18815          12 :                 $$.type_str = mm_strdup(this->name);
   18816          12 :                 $$.type_enum = this->type->type_enum;
   18817          12 :                 $$.type_dimension = this->type->type_dimension;
   18818          12 :                 $$.type_index = this->type->type_index;
   18819          12 :                 $$.type_sizeof = this->type->type_sizeof;
   18820          12 :                 struct_member_list[struct_level] = ECPGstruct_member_dup(this->struct_member_list);
   18821          12 :                 free(name);
   18822             :             }
   18823             :             else
   18824             :             {
   18825           0 :                 $$.type_str = name;
   18826           0 :                 $$.type_enum = ECPGt_long;
   18827           0 :                 $$.type_dimension = mm_strdup("-1");
   18828           0 :                 $$.type_index = mm_strdup("-1");
   18829           0 :                 $$.type_sizeof = mm_strdup("");
   18830           0 :                 struct_member_list[struct_level] = NULL;
   18831             :             }
   18832             :         }
   18833             :         ;
   18834             : 
   18835             : enum_type: ENUM_P symbol enum_definition
   18836           0 :             { $$ = cat_str(3, mm_strdup("enum"), $2, $3); }
   18837             :         | ENUM_P enum_definition
   18838           0 :             { $$ = cat2_str(mm_strdup("enum"), $2); }
   18839             :         | ENUM_P symbol
   18840           0 :             { $$ = cat2_str(mm_strdup("enum"), $2); }
   18841             :         ;
   18842             : 
   18843             : enum_definition: '{' c_list '}'
   18844           0 :             { $$ = cat_str(3, mm_strdup("{"), $2, mm_strdup("}")); };
   18845             : 
   18846             : struct_union_type_with_symbol: s_struct_union_symbol
   18847             :         {
   18848          32 :             struct_member_list[struct_level++] = NULL;
   18849          32 :             if (struct_level >= STRUCT_DEPTH)
   18850           0 :                  mmerror(PARSE_ERROR, ET_ERROR, "too many levels in nested structure/union definition");
   18851          32 :             forward_name = mm_strdup($1.symbol);
   18852             :         }
   18853             :         '{' variable_declarations '}'
   18854             :         {
   18855             :             struct typedefs *ptr, *this;
   18856             :             struct this_type su_type;
   18857             : 
   18858          32 :             ECPGfree_struct_member(struct_member_list[struct_level]);
   18859          32 :             struct_member_list[struct_level] = NULL;
   18860          32 :             struct_level--;
   18861          32 :             if (strncmp($1.su, "struct", sizeof("struct")-1) == 0)
   18862          32 :                 su_type.type_enum = ECPGt_struct;
   18863             :             else
   18864           0 :                 su_type.type_enum = ECPGt_union;
   18865          32 :             su_type.type_str = cat2_str($1.su, $1.symbol);
   18866          32 :             free(forward_name);
   18867          32 :             forward_name = NULL;
   18868             : 
   18869             :             /* This is essentially a typedef but needs the keyword struct/union as well.
   18870             :              * So we create the typedef for each struct definition with symbol */
   18871         152 :             for (ptr = types; ptr != NULL; ptr = ptr->next)
   18872             :             {
   18873         120 :                     if (strcmp(su_type.type_str, ptr->name) == 0)
   18874             :                             /* re-definition is a bug */
   18875           0 :                             mmerror(PARSE_ERROR, ET_ERROR, "type \"%s\" is already defined", su_type.type_str);
   18876             :             }
   18877             : 
   18878          32 :             this = (struct typedefs *) mm_alloc(sizeof(struct typedefs));
   18879             : 
   18880             :             /* initial definition */
   18881          32 :             this->next = types;
   18882          32 :             this->name = mm_strdup(su_type.type_str);
   18883          32 :             this->brace_level = braces_open;
   18884          32 :             this->type = (struct this_type *) mm_alloc(sizeof(struct this_type));
   18885          32 :             this->type->type_enum = su_type.type_enum;
   18886          32 :             this->type->type_str = mm_strdup(su_type.type_str);
   18887          32 :             this->type->type_dimension = mm_strdup("-1"); /* dimension of array */
   18888          32 :             this->type->type_index = mm_strdup("-1");   /* length of string */
   18889          32 :             this->type->type_sizeof = ECPGstruct_sizeof;
   18890          32 :             this->struct_member_list = struct_member_list[struct_level];
   18891             : 
   18892          32 :             types = this;
   18893          32 :             $$ = cat_str(4, su_type.type_str, mm_strdup("{"), $4, mm_strdup("}"));
   18894             :         }
   18895             :         ;
   18896             : 
   18897          18 : struct_union_type: struct_union_type_with_symbol    { $$ = $1; }
   18898             :         | s_struct_union
   18899             :         {
   18900          14 :             struct_member_list[struct_level++] = NULL;
   18901          14 :             if (struct_level >= STRUCT_DEPTH)
   18902           0 :                  mmerror(PARSE_ERROR, ET_ERROR, "too many levels in nested structure/union definition");
   18903             :         }
   18904             :         '{' variable_declarations '}'
   18905             :         {
   18906          14 :             ECPGfree_struct_member(struct_member_list[struct_level]);
   18907          14 :             struct_member_list[struct_level] = NULL;
   18908          14 :             struct_level--;
   18909          14 :             $$ = cat_str(4, $1, mm_strdup("{"), $4, mm_strdup("}"));
   18910             :         }
   18911             :         ;
   18912             : 
   18913             : s_struct_union_symbol: SQL_STRUCT symbol
   18914             :         {
   18915          44 :             $$.su = mm_strdup("struct");
   18916          44 :             $$.symbol = $2;
   18917          44 :             ECPGstruct_sizeof = cat_str(3, mm_strdup("sizeof("), cat2_str(mm_strdup($$.su), mm_strdup($$.symbol)), mm_strdup(")"));
   18918             :         }
   18919             :         | UNION symbol
   18920             :         {
   18921           0 :             $$.su = mm_strdup("union");
   18922           0 :             $$.symbol = $2;
   18923             :         }
   18924             :         ;
   18925             : 
   18926             : s_struct_union: SQL_STRUCT
   18927             :         {
   18928          10 :             ECPGstruct_sizeof = mm_strdup(""); /* This must not be NULL to distinguish from simple types. */
   18929          10 :             $$ = mm_strdup("struct");
   18930             :         }
   18931             :         | UNION
   18932             :         {
   18933           4 :             $$ = mm_strdup("union");
   18934             :         }
   18935             :         ;
   18936             : 
   18937           0 : simple_type: unsigned_type                  { $$=$1; }
   18938         452 :         |   opt_signed signed_type          { $$=$2; }
   18939             :         ;
   18940             : 
   18941           0 : unsigned_type: SQL_UNSIGNED SQL_SHORT       { $$ = ECPGt_unsigned_short; }
   18942           0 :         | SQL_UNSIGNED SQL_SHORT INT_P  { $$ = ECPGt_unsigned_short; }
   18943           0 :         | SQL_UNSIGNED                      { $$ = ECPGt_unsigned_int; }
   18944           0 :         | SQL_UNSIGNED INT_P                { $$ = ECPGt_unsigned_int; }
   18945           0 :         | SQL_UNSIGNED SQL_LONG             { $$ = ECPGt_unsigned_long; }
   18946           0 :         | SQL_UNSIGNED SQL_LONG INT_P       { $$ = ECPGt_unsigned_long; }
   18947           0 :         | SQL_UNSIGNED SQL_LONG SQL_LONG    { $$ = ECPGt_unsigned_long_long; }
   18948           0 :         | SQL_UNSIGNED SQL_LONG SQL_LONG INT_P { $$ = ECPGt_unsigned_long_long; }
   18949           0 :         | SQL_UNSIGNED CHAR_P           { $$ = ECPGt_unsigned_char; }
   18950             :         ;
   18951             : 
   18952          26 : signed_type: SQL_SHORT              { $$ = ECPGt_short; }
   18953           0 :         | SQL_SHORT INT_P           { $$ = ECPGt_short; }
   18954         206 :         | INT_P                     { $$ = ECPGt_int; }
   18955          12 :         | SQL_LONG                  { $$ = ECPGt_long; }
   18956           0 :         | SQL_LONG INT_P            { $$ = ECPGt_long; }
   18957           0 :         | SQL_LONG SQL_LONG         { $$ = ECPGt_long_long; }
   18958           0 :         | SQL_LONG SQL_LONG INT_P   { $$ = ECPGt_long_long; }
   18959           8 :         | SQL_BOOL                  { $$ = ECPGt_bool; }
   18960         198 :         | CHAR_P                    { $$ = ECPGt_char; }
   18961           2 :         | DOUBLE_P                  { $$ = ECPGt_double; }
   18962             :         ;
   18963             : 
   18964             : opt_signed: SQL_SIGNED
   18965             :         |   /* EMPTY */
   18966             :         ;
   18967             : 
   18968             : variable_list: variable
   18969         590 :             { $$ = $1; }
   18970             :         | variable_list ',' variable
   18971             :         {
   18972         108 :             if (actual_type[struct_level].type_enum == ECPGt_varchar || actual_type[struct_level].type_enum == ECPGt_bytea)
   18973           4 :                 $$ = cat_str(4, $1, mm_strdup(";"), mm_strdup(actual_type[struct_level].type_storage), $3);
   18974             :             else
   18975         104 :                 $$ = cat_str(3, $1, mm_strdup(","), $3);
   18976             :         }
   18977             :         ;
   18978             : 
   18979             : variable: opt_pointer ECPGColLabel opt_array_bounds opt_bit_field opt_initializer
   18980             :         {
   18981             :             struct ECPGtype * type;
   18982         698 :             char *dimension = $3.index1;    /* dimension of array */
   18983         698 :             char *length = $3.index2;       /* length of string */
   18984             :             char *dim_str;
   18985             :             char *vcn;
   18986             :             int *varlen_type_counter;
   18987             :             char *struct_name;
   18988             : 
   18989         698 :             adjust_array(actual_type[struct_level].type_enum, &dimension, &length, actual_type[struct_level].type_dimension, actual_type[struct_level].type_index, strlen($1), false);
   18990         698 :             switch (actual_type[struct_level].type_enum)
   18991             :             {
   18992          48 :                 case ECPGt_struct:
   18993             :                 case ECPGt_union:
   18994          48 :                     if (atoi(dimension) < 0)
   18995          22 :                         type = ECPGmake_struct_type(struct_member_list[struct_level], actual_type[struct_level].type_enum, actual_type[struct_level].type_str, actual_type[struct_level].type_sizeof);
   18996             :                     else
   18997          26 :                         type = ECPGmake_array_type(ECPGmake_struct_type(struct_member_list[struct_level], actual_type[struct_level].type_enum, actual_type[struct_level].type_str, actual_type[struct_level].type_sizeof), dimension);
   18998             : 
   18999          48 :                     $$ = cat_str(5, $1, mm_strdup($2), $3.str, $4, $5);
   19000          48 :                     break;
   19001             : 
   19002          40 :                 case ECPGt_varchar:
   19003             :                 case ECPGt_bytea:
   19004          40 :                     if (actual_type[struct_level].type_enum == ECPGt_varchar)
   19005             :                     {
   19006          32 :                         varlen_type_counter = &varchar_counter;
   19007          32 :                         struct_name = " struct varchar_";
   19008             :                     }
   19009             :                     else
   19010             :                     {
   19011           8 :                         varlen_type_counter = &bytea_counter;
   19012           8 :                         struct_name = " struct bytea_";
   19013             :                     }
   19014          40 :                     if (atoi(dimension) < 0)
   19015          30 :                         type = ECPGmake_simple_type(actual_type[struct_level].type_enum, length, *varlen_type_counter);
   19016             :                     else
   19017          10 :                         type = ECPGmake_array_type(ECPGmake_simple_type(actual_type[struct_level].type_enum, length, *varlen_type_counter), dimension);
   19018             : 
   19019          40 :                     if (strcmp(dimension, "0") == 0 || abs(atoi(dimension)) == 1)
   19020          32 :                             dim_str=mm_strdup("");
   19021             :                     else
   19022           8 :                             dim_str=cat_str(3, mm_strdup("["), mm_strdup(dimension), mm_strdup("]"));
   19023             :                     /* cannot check for atoi <= 0 because a defined constant will yield 0 here as well */
   19024          40 :                     if (atoi(length) < 0 || strcmp(length, "0") == 0)
   19025           0 :                         mmerror(PARSE_ERROR, ET_ERROR, "pointers to varchar are not implemented");
   19026             : 
   19027             :                     /* make sure varchar struct name is unique by adding a unique counter to its definition */
   19028          40 :                     vcn = (char *) mm_alloc(sizeof(int) * CHAR_BIT * 10 / 3);
   19029          40 :                     sprintf(vcn, "%d", *varlen_type_counter);
   19030          40 :                     if (strcmp(dimension, "0") == 0)
   19031           2 :                         $$ = cat_str(7, make2_str(mm_strdup(struct_name), vcn), mm_strdup(" { int len; char arr["), mm_strdup(length), mm_strdup("]; } *"), mm_strdup($2), $4, $5);
   19032             :                     else
   19033          38 :                         $$ = cat_str(8, make2_str(mm_strdup(struct_name), vcn), mm_strdup(" { int len; char arr["), mm_strdup(length), mm_strdup("]; } "), mm_strdup($2), dim_str, $4, $5);
   19034          40 :                     (*varlen_type_counter)++;
   19035          40 :                     break;
   19036             : 
   19037         226 :                 case ECPGt_char:
   19038             :                 case ECPGt_unsigned_char:
   19039             :                 case ECPGt_string:
   19040         226 :                     if (atoi(dimension) == -1)
   19041             :                     {
   19042         196 :                         int i = strlen($5);
   19043             : 
   19044         196 :                         if (atoi(length) == -1 && i > 0) /* char <var>[] = "string" */
   19045             :                         {
   19046             :                             /* if we have an initializer but no string size set, let's use the initializer's length */
   19047           4 :                             free(length);
   19048           4 :                             length = mm_alloc(i+sizeof("sizeof()"));
   19049           4 :                             sprintf(length, "sizeof(%s)", $5+2);
   19050             :                         }
   19051         196 :                         type = ECPGmake_simple_type(actual_type[struct_level].type_enum, length, 0);
   19052             :                     }
   19053             :                     else
   19054          30 :                         type = ECPGmake_array_type(ECPGmake_simple_type(actual_type[struct_level].type_enum, length, 0), dimension);
   19055             : 
   19056         226 :                     $$ = cat_str(5, $1, mm_strdup($2), $3.str, $4, $5);
   19057         226 :                     break;
   19058             : 
   19059         384 :                 default:
   19060         384 :                     if (atoi(dimension) < 0)
   19061         306 :                         type = ECPGmake_simple_type(actual_type[struct_level].type_enum, mm_strdup("1"), 0);
   19062             :                     else
   19063          78 :                         type = ECPGmake_array_type(ECPGmake_simple_type(actual_type[struct_level].type_enum, mm_strdup("1"), 0), dimension);
   19064             : 
   19065         384 :                     $$ = cat_str(5, $1, mm_strdup($2), $3.str, $4, $5);
   19066         384 :                     break;
   19067             :             }
   19068             : 
   19069         698 :             if (struct_level == 0)
   19070         590 :                 new_variable($2, type, braces_open);
   19071             :             else
   19072         108 :                 ECPGmake_struct_member($2, type, &(struct_member_list[struct_level - 1]));
   19073             : 
   19074         698 :             free($2);
   19075             :         }
   19076             :         ;
   19077             : 
   19078             : opt_initializer: /*EMPTY*/
   19079         478 :             { $$ = EMPTY; }
   19080             :         | '=' c_term
   19081             :         {
   19082         220 :             initializer = 1;
   19083         220 :             $$ = cat2_str(mm_strdup("="), $2);
   19084             :         }
   19085             :         ;
   19086             : 
   19087         576 : opt_pointer: /*EMPTY*/              { $$ = EMPTY; }
   19088         124 :         | '*'                       { $$ = mm_strdup("*"); }
   19089          16 :         | '*' '*'                   { $$ = mm_strdup("**"); }
   19090             :         ;
   19091             : 
   19092             : /*
   19093             :  * We try to simulate the correct DECLARE syntax here so we get dynamic SQL
   19094             :  */
   19095             : ECPGDeclare: DECLARE STATEMENT ecpg_ident
   19096             :         {
   19097             :             /* this is only supported for compatibility */
   19098           0 :             $$ = cat_str(3, mm_strdup("/* declare statement"), $3, mm_strdup("*/"));
   19099             :         }
   19100             :         ;
   19101             : /*
   19102             :  * the exec sql disconnect statement: disconnect from the given database
   19103             :  */
   19104         170 : ECPGDisconnect: SQL_DISCONNECT dis_name { $$ = $2; }
   19105             :         ;
   19106             : 
   19107          50 : dis_name: connection_object         { $$ = $1; }
   19108           6 :         | CURRENT_P         { $$ = mm_strdup("\"CURRENT\""); }
   19109          30 :         | ALL               { $$ = mm_strdup("\"ALL\""); }
   19110          84 :         | /* EMPTY */           { $$ = mm_strdup("\"CURRENT\""); }
   19111             :         ;
   19112             : 
   19113         288 : connection_object: name             { $$ = make3_str(mm_strdup("\""), $1, mm_strdup("\"")); }
   19114           6 :         | DEFAULT           { $$ = mm_strdup("\"DEFAULT\""); }
   19115          32 :         | char_variable         { $$ = $1; }
   19116             :         ;
   19117             : 
   19118             : execstring: char_variable
   19119          96 :             { $$ = $1; }
   19120             :         |   CSTRING
   19121          12 :             { $$ = make3_str(mm_strdup("\""), $1, mm_strdup("\"")); }
   19122             :         ;
   19123             : 
   19124             : /*
   19125             :  * the exec sql free command to deallocate a previously
   19126             :  * prepared statement
   19127             :  */
   19128           2 : ECPGFree:   SQL_FREE cursor_name    { $$ = $2; }
   19129           0 :         | SQL_FREE ALL  { $$ = mm_strdup("all"); }
   19130             :         ;
   19131             : 
   19132             : /*
   19133             :  * open is an open cursor, at the moment this has to be removed
   19134             :  */
   19135             : ECPGOpen: SQL_OPEN cursor_name opt_ecpg_using
   19136             :         {
   19137          76 :             if ($2[0] == ':')
   19138          10 :                 remove_variable_from_list(&argsinsert, find_variable($2 + 1));
   19139          76 :             $$ = $2;
   19140             :         }
   19141             :         ;
   19142             : 
   19143          66 : opt_ecpg_using: /*EMPTY*/   { $$ = EMPTY; }
   19144          10 :         | ecpg_using        { $$ = $1; }
   19145             :         ;
   19146             : 
   19147          28 : ecpg_using: USING using_list    { $$ = EMPTY; }
   19148          22 :         | using_descriptor      { $$ = $1; }
   19149             :         ;
   19150             : 
   19151             : using_descriptor: USING SQL_P SQL_DESCRIPTOR quoted_ident_stringvar
   19152             :         {
   19153          22 :             add_variable_to_head(&argsinsert, descriptor_variable($4,0), &no_indicator);
   19154          22 :             $$ = EMPTY;
   19155             :         }
   19156             :         | USING SQL_DESCRIPTOR name
   19157             :         {
   19158          18 :             add_variable_to_head(&argsinsert, sqlda_variable($3), &no_indicator);
   19159          18 :             $$ = EMPTY;
   19160             :         }
   19161             :         ;
   19162             : 
   19163             : into_descriptor: INTO SQL_P SQL_DESCRIPTOR quoted_ident_stringvar
   19164             :         {
   19165          22 :             add_variable_to_head(&argsresult, descriptor_variable($4,1), &no_indicator);
   19166          22 :             $$ = EMPTY;
   19167             :         }
   19168             :         | INTO SQL_DESCRIPTOR name
   19169             :         {
   19170          24 :             add_variable_to_head(&argsresult, sqlda_variable($3), &no_indicator);
   19171          24 :             $$ = EMPTY;
   19172             :         }
   19173             :         ;
   19174             : 
   19175             : into_sqlda: INTO name
   19176             :         {
   19177           8 :             add_variable_to_head(&argsresult, sqlda_variable($2), &no_indicator);
   19178           8 :             $$ = EMPTY;
   19179             :         }
   19180             :         ;
   19181             : 
   19182             : using_list: UsingValue | UsingValue ',' using_list;
   19183             : 
   19184             : UsingValue: UsingConst
   19185             :         {
   19186           8 :             char *length = mm_alloc(32);
   19187             : 
   19188           8 :             sprintf(length, "%zu", strlen($1));
   19189           8 :             add_variable_to_head(&argsinsert, new_variable($1, ECPGmake_simple_type(ECPGt_const, length, 0), 0), &no_indicator);
   19190             :         }
   19191          34 :         | civar { $$ = EMPTY; }
   19192           0 :         | civarind { $$ = EMPTY; }
   19193             :         ;
   19194             : 
   19195           8 : UsingConst: Iconst          { $$ = $1; }
   19196           0 :         | '+' Iconst        { $$ = cat_str(2, mm_strdup("+"), $2); }
   19197           0 :         | '-' Iconst        { $$ = cat_str(2, mm_strdup("-"), $2); }
   19198           0 :         | ecpg_fconst       { $$ = $1; }
   19199           0 :         | '+' ecpg_fconst   { $$ = cat_str(2, mm_strdup("+"), $2); }
   19200           0 :         | '-' ecpg_fconst   { $$ = cat_str(2, mm_strdup("-"), $2); }
   19201           0 :         | ecpg_sconst       { $$ = $1; }
   19202           0 :         | ecpg_bconst       { $$ = $1; }
   19203           0 :         | ecpg_xconst       { $$ = $1; }
   19204             :         ;
   19205             : 
   19206             : /*
   19207             :  * We accept DESCRIBE [OUTPUT] but do nothing with DESCRIBE INPUT so far.
   19208             :  */
   19209             : ECPGDescribe: SQL_DESCRIBE INPUT_P prepared_name using_descriptor
   19210             :     {
   19211           0 :         $$.input = 1;
   19212           0 :         $$.stmt_name = $3;
   19213             :     }
   19214             :     | SQL_DESCRIBE opt_output prepared_name using_descriptor
   19215             :     {
   19216             :         struct variable *var;
   19217          16 :         var = argsinsert->variable;
   19218          16 :         remove_variable_from_list(&argsinsert, var);
   19219          16 :         add_variable_to_head(&argsresult, var, &no_indicator);
   19220             : 
   19221          16 :         $$.input = 0;
   19222          16 :         $$.stmt_name = $3;
   19223             :     }
   19224             :     | SQL_DESCRIBE opt_output prepared_name into_descriptor
   19225             :     {
   19226          18 :         $$.input = 0;
   19227          18 :         $$.stmt_name = $3;
   19228             :     }
   19229             :     | SQL_DESCRIBE INPUT_P prepared_name into_sqlda
   19230             :     {
   19231           0 :         $$.input = 1;
   19232           0 :         $$.stmt_name = $3;
   19233             :     }
   19234             :     | SQL_DESCRIBE opt_output prepared_name into_sqlda
   19235             :     {
   19236           8 :         $$.input = 0;
   19237           8 :         $$.stmt_name = $3;
   19238             :     }
   19239             :     ;
   19240             : 
   19241           0 : opt_output: SQL_OUTPUT  { $$ = mm_strdup("output"); }
   19242          42 :     |   /* EMPTY */ { $$ = EMPTY; }
   19243             :     ;
   19244             : 
   19245             : /*
   19246             :  * dynamic SQL: descriptor based access
   19247             :  *  originally written by Christof Petig <christof.petig@wtal.de>
   19248             :  *          and Peter Eisentraut <peter.eisentraut@credativ.de>
   19249             :  */
   19250             : 
   19251             : /*
   19252             :  * allocate a descriptor
   19253             :  */
   19254             : ECPGAllocateDescr: SQL_ALLOCATE SQL_DESCRIPTOR quoted_ident_stringvar
   19255             :         {
   19256          36 :             add_descriptor($3,connection);
   19257          36 :             $$ = $3;
   19258             :         }
   19259             :         ;
   19260             : 
   19261             : 
   19262             : /*
   19263             :  * deallocate a descriptor
   19264             :  */
   19265             : ECPGDeallocateDescr:    DEALLOCATE SQL_DESCRIPTOR quoted_ident_stringvar
   19266             :         {
   19267          32 :             drop_descriptor($3,connection);
   19268          32 :             $$ = $3;
   19269             :         }
   19270             :         ;
   19271             : 
   19272             : /*
   19273             :  * manipulate a descriptor header
   19274             :  */
   19275             : 
   19276             : ECPGGetDescriptorHeader: SQL_GET SQL_DESCRIPTOR quoted_ident_stringvar ECPGGetDescHeaderItems
   19277          22 :             {  $$ = $3; }
   19278             :         ;
   19279             : 
   19280             : ECPGGetDescHeaderItems: ECPGGetDescHeaderItem
   19281             :         | ECPGGetDescHeaderItems ',' ECPGGetDescHeaderItem
   19282             :         ;
   19283             : 
   19284             : ECPGGetDescHeaderItem: cvariable '=' desc_header_item
   19285          22 :             { push_assignment($1, $3); }
   19286             :         ;
   19287             : 
   19288             : 
   19289             : ECPGSetDescriptorHeader: SET SQL_DESCRIPTOR quoted_ident_stringvar ECPGSetDescHeaderItems
   19290           2 :             { $$ = $3; }
   19291             :         ;
   19292             : 
   19293             : ECPGSetDescHeaderItems: ECPGSetDescHeaderItem
   19294             :         | ECPGSetDescHeaderItems ',' ECPGSetDescHeaderItem
   19295             :         ;
   19296             : 
   19297             : ECPGSetDescHeaderItem: desc_header_item '=' IntConstVar
   19298             :         {
   19299           2 :             push_assignment($3, $1);
   19300             :         }
   19301             :         ;
   19302             : 
   19303             : IntConstVar: Iconst
   19304             :         {
   19305          60 :             char *length = mm_alloc(sizeof(int) * CHAR_BIT * 10 / 3);
   19306             : 
   19307          60 :             sprintf(length, "%zu", strlen($1));
   19308          60 :             new_variable($1, ECPGmake_simple_type(ECPGt_const, length, 0), 0);
   19309          60 :             $$ = $1;
   19310             :         }
   19311             :         | cvariable
   19312             :         {
   19313          54 :             $$ = $1;
   19314             :         }
   19315             :         ;
   19316             : 
   19317          24 : desc_header_item:   SQL_COUNT           { $$ = ECPGd_count; }
   19318             :         ;
   19319             : 
   19320             : /*
   19321             :  * manipulate a descriptor
   19322             :  */
   19323             : 
   19324             : ECPGGetDescriptor:  SQL_GET SQL_DESCRIPTOR quoted_ident_stringvar VALUE_P IntConstVar ECPGGetDescItems
   19325          62 :             {  $$.str = $5; $$.name = $3; }
   19326             :         ;
   19327             : 
   19328             : ECPGGetDescItems: ECPGGetDescItem
   19329             :         | ECPGGetDescItems ',' ECPGGetDescItem
   19330             :         ;
   19331             : 
   19332         102 : ECPGGetDescItem: cvariable '=' descriptor_item  { push_assignment($1, $3); };
   19333             : 
   19334             : 
   19335             : ECPGSetDescriptor:  SET SQL_DESCRIPTOR quoted_ident_stringvar VALUE_P IntConstVar ECPGSetDescItems
   19336          22 :             {  $$.str = $5; $$.name = $3; }
   19337             :         ;
   19338             : 
   19339             : ECPGSetDescItems: ECPGSetDescItem
   19340             :         | ECPGSetDescItems ',' ECPGSetDescItem
   19341             :         ;
   19342             : 
   19343             : ECPGSetDescItem: descriptor_item '=' AllConstVar
   19344             :         {
   19345          30 :             push_assignment($3, $1);
   19346             :         }
   19347             :         ;
   19348             : 
   19349             : AllConstVar: ecpg_fconst
   19350             :         {
   19351           0 :             char *length = mm_alloc(sizeof(int) * CHAR_BIT * 10 / 3);
   19352             : 
   19353           0 :             sprintf(length, "%zu", strlen($1));
   19354           0 :             new_variable($1, ECPGmake_simple_type(ECPGt_const, length, 0), 0);
   19355           0 :             $$ = $1;
   19356             :         }
   19357             : 
   19358             :         | IntConstVar
   19359             :         {
   19360          28 :             $$ = $1;
   19361             :         }
   19362             : 
   19363             :         | '-' ecpg_fconst
   19364             :         {
   19365           0 :             char *length = mm_alloc(sizeof(int) * CHAR_BIT * 10 / 3);
   19366           0 :             char *var = cat2_str(mm_strdup("-"), $2);
   19367             : 
   19368           0 :             sprintf(length, "%zu", strlen(var));
   19369           0 :             new_variable(var, ECPGmake_simple_type(ECPGt_const, length, 0), 0);
   19370           0 :             $$ = var;
   19371             :         }
   19372             : 
   19373             :         | '-' Iconst
   19374             :         {
   19375           0 :             char *length = mm_alloc(sizeof(int) * CHAR_BIT * 10 / 3);
   19376           0 :             char *var = cat2_str(mm_strdup("-"), $2);
   19377             : 
   19378           0 :             sprintf(length, "%zu", strlen(var));
   19379           0 :             new_variable(var, ECPGmake_simple_type(ECPGt_const, length, 0), 0);
   19380           0 :             $$ = var;
   19381             :         }
   19382             : 
   19383             :         | ecpg_sconst
   19384             :         {
   19385           2 :             char *length = mm_alloc(sizeof(int) * CHAR_BIT * 10 / 3);
   19386           2 :             char *var = $1 + 1;
   19387             : 
   19388           2 :             var[strlen(var) - 1] = '\0';
   19389           2 :             sprintf(length, "%zu", strlen(var));
   19390           2 :             new_variable(var, ECPGmake_simple_type(ECPGt_const, length, 0), 0);
   19391           2 :             $$ = var;
   19392             :         }
   19393             :         ;
   19394             : 
   19395           0 : descriptor_item:    SQL_CARDINALITY         { $$ = ECPGd_cardinality; }
   19396          62 :         | DATA_P                { $$ = ECPGd_data; }
   19397           4 :         | SQL_DATETIME_INTERVAL_CODE        { $$ = ECPGd_di_code; }
   19398           0 :         | SQL_DATETIME_INTERVAL_PRECISION   { $$ = ECPGd_di_precision; }
   19399          34 :         | SQL_INDICATOR             { $$ = ECPGd_indicator; }
   19400           0 :         | SQL_KEY_MEMBER            { $$ = ECPGd_key_member; }
   19401           4 :         | SQL_LENGTH                { $$ = ECPGd_length; }
   19402          18 :         | NAME_P                { $$ = ECPGd_name; }
   19403           0 :         | SQL_NULLABLE              { $$ = ECPGd_nullable; }
   19404           2 :         | SQL_OCTET_LENGTH          { $$ = ECPGd_octet; }
   19405           2 :         | PRECISION             { $$ = ECPGd_precision; }
   19406           0 :         | SQL_RETURNED_LENGTH           { $$ = ECPGd_length; }
   19407           2 :         | SQL_RETURNED_OCTET_LENGTH     { $$ = ECPGd_ret_octet; }
   19408           2 :         | SQL_SCALE             { $$ = ECPGd_scale; }
   19409           2 :         | TYPE_P                { $$ = ECPGd_type; }
   19410             :         ;
   19411             : 
   19412             : /*
   19413             :  * set/reset the automatic transaction mode, this needs a different handling
   19414             :  * as the other set commands
   19415             :  */
   19416           6 : ECPGSetAutocommit:  SET SQL_AUTOCOMMIT '=' on_off   { $$ = $4; }
   19417          18 :         |  SET SQL_AUTOCOMMIT TO on_off   { $$ = $4; }
   19418             :         ;
   19419             : 
   19420          18 : on_off: ON              { $$ = mm_strdup("on"); }
   19421           6 :         | OFF           { $$ = mm_strdup("off"); }
   19422             :         ;
   19423             : 
   19424             : /*
   19425             :  * set the actual connection, this needs a different handling as the other
   19426             :  * set commands
   19427             :  */
   19428           2 : ECPGSetConnection:  SET CONNECTION TO connection_object { $$ = $4; }
   19429           0 :         | SET CONNECTION '=' connection_object { $$ = $4; }
   19430           2 :         | SET CONNECTION  connection_object { $$ = $3; }
   19431             :         ;
   19432             : 
   19433             : /*
   19434             :  * define a new type for embedded SQL
   19435             :  */
   19436             : ECPGTypedef: TYPE_P
   19437             :         {
   19438             :             /* reset this variable so we see if there was */
   19439             :             /* an initializer specified */
   19440          26 :             initializer = 0;
   19441             :         }
   19442             :         ECPGColLabel IS var_type opt_array_bounds opt_reference
   19443             :         {
   19444          26 :             add_typedef($3, $6.index1, $6.index2, $5.type_enum, $5.type_dimension, $5.type_index, initializer, *$7 ? 1 : 0);
   19445             : 
   19446          26 :             if (auto_create_c == false)
   19447          18 :                 $$ = cat_str(7, mm_strdup("/* exec sql type"), mm_strdup($3), mm_strdup("is"), mm_strdup($5.type_str), mm_strdup($6.str), $7, mm_strdup("*/"));
   19448             :             else
   19449           8 :                 $$ = cat_str(6, mm_strdup("typedef "), mm_strdup($5.type_str), *$7?mm_strdup("*"):mm_strdup(""), mm_strdup($3), mm_strdup($6.str), mm_strdup(";"));
   19450             :         }
   19451             :         ;
   19452             : 
   19453           6 : opt_reference: SQL_REFERENCE        { $$ = mm_strdup("reference"); }
   19454          24 :         | /*EMPTY*/                 { $$ = EMPTY; }
   19455             :         ;
   19456             : 
   19457             : /*
   19458             :  * define the type of one variable for embedded SQL
   19459             :  */
   19460             : ECPGVar: SQL_VAR
   19461             :         {
   19462             :             /* reset this variable so we see if there was */
   19463             :             /* an initializer specified */
   19464           4 :             initializer = 0;
   19465             :         }
   19466             :         ColLabel IS var_type opt_array_bounds opt_reference
   19467             :         {
   19468           4 :             struct variable *p = find_variable($3);
   19469           4 :             char *dimension = $6.index1;
   19470           4 :             char *length = $6.index2;
   19471             :             struct ECPGtype * type;
   19472             : 
   19473           4 :             if (($5.type_enum == ECPGt_struct ||
   19474           4 :                  $5.type_enum == ECPGt_union) &&
   19475           0 :                 initializer == 1)
   19476           0 :                 mmerror(PARSE_ERROR, ET_ERROR, "initializer not allowed in EXEC SQL VAR command");
   19477             :             else
   19478             :             {
   19479           4 :                 adjust_array($5.type_enum, &dimension, &length, $5.type_dimension, $5.type_index, *$7?1:0, false);
   19480             : 
   19481           4 :                 switch ($5.type_enum)
   19482             :                 {
   19483           0 :                     case ECPGt_struct:
   19484             :                     case ECPGt_union:
   19485           0 :                         if (atoi(dimension) < 0)
   19486           0 :                             type = ECPGmake_struct_type(struct_member_list[struct_level], $5.type_enum, $5.type_str, $5.type_sizeof);
   19487             :                         else
   19488           0 :                             type = ECPGmake_array_type(ECPGmake_struct_type(struct_member_list[struct_level], $5.type_enum, $5.type_str, $5.type_sizeof), dimension);
   19489           0 :                         break;
   19490             : 
   19491           2 :                     case ECPGt_varchar:
   19492             :                     case ECPGt_bytea:
   19493           2 :                         if (atoi(dimension) == -1)
   19494           2 :                             type = ECPGmake_simple_type($5.type_enum, length, 0);
   19495             :                         else
   19496           0 :                             type = ECPGmake_array_type(ECPGmake_simple_type($5.type_enum, length, 0), dimension);
   19497           2 :                         break;
   19498             : 
   19499           0 :                     case ECPGt_char:
   19500             :                     case ECPGt_unsigned_char:
   19501             :                     case ECPGt_string:
   19502           0 :                         if (atoi(dimension) == -1)
   19503           0 :                             type = ECPGmake_simple_type($5.type_enum, length, 0);
   19504             :                         else
   19505           0 :                             type = ECPGmake_array_type(ECPGmake_simple_type($5.type_enum, length, 0), dimension);
   19506           0 :                         break;
   19507             : 
   19508           2 :                     default:
   19509           2 :                         if (atoi(length) >= 0)
   19510           0 :                             mmerror(PARSE_ERROR, ET_ERROR, "multidimensional arrays for simple data types are not supported");
   19511             : 
   19512           2 :                         if (atoi(dimension) < 0)
   19513           2 :                             type = ECPGmake_simple_type($5.type_enum, mm_strdup("1"), 0);
   19514             :                         else
   19515           0 :                             type = ECPGmake_array_type(ECPGmake_simple_type($5.type_enum, mm_strdup("1"), 0), dimension);
   19516           2 :                         break;
   19517             :                 }
   19518             : 
   19519           4 :                 ECPGfree_type(p->type);
   19520           4 :                 p->type = type;
   19521             :             }
   19522             : 
   19523           4 :             $$ = cat_str(7, mm_strdup("/* exec sql var"), mm_strdup($3), mm_strdup("is"), mm_strdup($5.type_str), mm_strdup($6.str), $7, mm_strdup("*/"));
   19524             :         }
   19525             :         ;
   19526             : 
   19527             : /*
   19528             :  * whenever statement: decide what to do in case of error/no data found
   19529             :  * according to SQL standards we lack: SQLSTATE, CONSTRAINT and SQLEXCEPTION
   19530             :  */
   19531             : ECPGWhenever: SQL_WHENEVER SQL_SQLERROR action
   19532             :         {
   19533         122 :             when_error.code = $<action>3.code;
   19534         122 :             when_error.command = $<action>3.command;
   19535         122 :             $$ = cat_str(3, mm_strdup("/* exec sql whenever sqlerror "), $3.str, mm_strdup("; */"));
   19536             :         }
   19537             :         | SQL_WHENEVER NOT SQL_FOUND action
   19538             :         {
   19539          50 :             when_nf.code = $<action>4.code;
   19540          50 :             when_nf.command = $<action>4.command;
   19541          50 :             $$ = cat_str(3, mm_strdup("/* exec sql whenever not found "), $4.str, mm_strdup("; */"));
   19542             :         }
   19543             :         | SQL_WHENEVER SQL_SQLWARNING action
   19544             :         {
   19545          26 :             when_warn.code = $<action>3.code;
   19546          26 :             when_warn.command = $<action>3.command;
   19547          26 :             $$ = cat_str(3, mm_strdup("/* exec sql whenever sql_warning "), $3.str, mm_strdup("; */"));
   19548             :         }
   19549             :         ;
   19550             : 
   19551             : action : CONTINUE_P
   19552             :         {
   19553          18 :             $<action>$.code = W_NOTHING;
   19554          18 :             $<action>$.command = NULL;
   19555          18 :             $<action>$.str = mm_strdup("continue");
   19556             :         }
   19557             :         | SQL_SQLPRINT
   19558             :         {
   19559          84 :             $<action>$.code = W_SQLPRINT;
   19560          84 :             $<action>$.command = NULL;
   19561          84 :             $<action>$.str = mm_strdup("sqlprint");
   19562             :         }
   19563             :         | SQL_STOP
   19564             :         {
   19565          30 :             $<action>$.code = W_STOP;
   19566          30 :             $<action>$.command = NULL;
   19567          30 :             $<action>$.str = mm_strdup("stop");
   19568             :         }
   19569             :         | SQL_GOTO name
   19570             :         {
   19571           2 :             $<action>$.code = W_GOTO;
   19572           2 :             $<action>$.command = mm_strdup($2);
   19573           2 :             $<action>$.str = cat2_str(mm_strdup("goto "), $2);
   19574             :         }
   19575             :         | SQL_GO TO name
   19576             :         {
   19577           0 :             $<action>$.code = W_GOTO;
   19578           0 :             $<action>$.command = mm_strdup($3);
   19579           0 :             $<action>$.str = cat2_str(mm_strdup("goto "), $3);
   19580             :         }
   19581             :         | DO name '(' c_args ')'
   19582             :         {
   19583          36 :             $<action>$.code = W_DO;
   19584          36 :             $<action>$.command = cat_str(4, $2, mm_strdup("("), $4, mm_strdup(")"));
   19585          36 :             $<action>$.str = cat2_str(mm_strdup("do"), mm_strdup($<action>$.command));
   19586             :         }
   19587             :         | DO SQL_BREAK
   19588             :         {
   19589          24 :             $<action>$.code = W_BREAK;
   19590          24 :             $<action>$.command = NULL;
   19591          24 :             $<action>$.str = mm_strdup("break");
   19592             :         }
   19593             :         | DO CONTINUE_P
   19594             :         {
   19595           2 :             $<action>$.code = W_CONTINUE;
   19596           2 :             $<action>$.command = NULL;
   19597           2 :             $<action>$.str = mm_strdup("continue");
   19598             :         }
   19599             :         | CALL name '(' c_args ')'
   19600             :         {
   19601           2 :             $<action>$.code = W_DO;
   19602           2 :             $<action>$.command = cat_str(4, $2, mm_strdup("("), $4, mm_strdup(")"));
   19603           2 :             $<action>$.str = cat2_str(mm_strdup("call"), mm_strdup($<action>$.command));
   19604             :         }
   19605             :         | CALL name
   19606             :         {
   19607           0 :             $<action>$.code = W_DO;
   19608           0 :             $<action>$.command = cat2_str($2, mm_strdup("()"));
   19609           0 :             $<action>$.str = cat2_str(mm_strdup("call"), mm_strdup($<action>$.command));
   19610             :         }
   19611             :         ;
   19612             : 
   19613             : /* some other stuff for ecpg */
   19614             : 
   19615             : /* additional unreserved keywords */
   19616          20 : ECPGKeywords: ECPGKeywords_vanames  { $$ = $1; }
   19617           0 :         | ECPGKeywords_rest { $$ = $1; }
   19618             :         ;
   19619             : 
   19620           0 : ECPGKeywords_vanames:  SQL_BREAK        { $$ = mm_strdup("break"); }
   19621           0 :         | SQL_CARDINALITY               { $$ = mm_strdup("cardinality"); }
   19622           6 :         | SQL_COUNT                     { $$ = mm_strdup("count"); }
   19623           0 :         | SQL_DATETIME_INTERVAL_CODE    { $$ = mm_strdup("datetime_interval_code"); }
   19624           0 :         | SQL_DATETIME_INTERVAL_PRECISION   { $$ = mm_strdup("datetime_interval_precision"); }
   19625           0 :         | SQL_FOUND                     { $$ = mm_strdup("found"); }
   19626           0 :         | SQL_GO                        { $$ = mm_strdup("go"); }
   19627           0 :         | SQL_GOTO                      { $$ = mm_strdup("goto"); }
   19628           0 :         | SQL_IDENTIFIED                { $$ = mm_strdup("identified"); }
   19629           0 :         | SQL_INDICATOR             { $$ = mm_strdup("indicator"); }
   19630           0 :         | SQL_KEY_MEMBER            { $$ = mm_strdup("key_member"); }
   19631           0 :         | SQL_LENGTH                { $$ = mm_strdup("length"); }
   19632           0 :         | SQL_NULLABLE              { $$ = mm_strdup("nullable"); }
   19633           0 :         | SQL_OCTET_LENGTH          { $$ = mm_strdup("octet_length"); }
   19634           0 :         | SQL_RETURNED_LENGTH       { $$ = mm_strdup("returned_length"); }
   19635           0 :         | SQL_RETURNED_OCTET_LENGTH { $$ = mm_strdup("returned_octet_length"); }
   19636           0 :         | SQL_SCALE                 { $$ = mm_strdup("scale"); }
   19637           0 :         | SQL_SECTION               { $$ = mm_strdup("section"); }
   19638           0 :         | SQL_SQLERROR              { $$ = mm_strdup("sqlerror"); }
   19639          14 :         | SQL_SQLPRINT              { $$ = mm_strdup("sqlprint"); }
   19640           0 :         | SQL_SQLWARNING            { $$ = mm_strdup("sqlwarning"); }
   19641           0 :         | SQL_STOP                  { $$ = mm_strdup("stop"); }
   19642             :         ;
   19643             : 
   19644           0 : ECPGKeywords_rest:  SQL_CONNECT     { $$ = mm_strdup("connect"); }
   19645           0 :         | SQL_DESCRIBE              { $$ = mm_strdup("describe"); }
   19646           0 :         | SQL_DISCONNECT            { $$ = mm_strdup("disconnect"); }
   19647           0 :         | SQL_OPEN                  { $$ = mm_strdup("open"); }
   19648           0 :         | SQL_VAR                   { $$ = mm_strdup("var"); }
   19649           0 :         | SQL_WHENEVER              { $$ = mm_strdup("whenever"); }
   19650             :         ;
   19651             : 
   19652             : /* additional keywords that can be SQL type names (but not ECPGColLabels) */
   19653           2 : ECPGTypeName:  SQL_BOOL             { $$ = mm_strdup("bool"); }
   19654           0 :         | SQL_LONG                  { $$ = mm_strdup("long"); }
   19655           0 :         | SQL_OUTPUT                { $$ = mm_strdup("output"); }
   19656           0 :         | SQL_SHORT                 { $$ = mm_strdup("short"); }
   19657           0 :         | SQL_STRUCT                { $$ = mm_strdup("struct"); }
   19658           0 :         | SQL_SIGNED                { $$ = mm_strdup("signed"); }
   19659           0 :         | SQL_UNSIGNED              { $$ = mm_strdup("unsigned"); }
   19660             :         ;
   19661             : 
   19662          44 : symbol: ColLabel                    { $$ = $1; }
   19663             :         ;
   19664             : 
   19665          52 : ECPGColId: ecpg_ident               { $$ = $1; }
   19666           0 :         | unreserved_keyword        { $$ = $1; }
   19667           0 :         | col_name_keyword          { $$ = $1; }
   19668           0 :         | ECPGunreserved_interval   { $$ = $1; }
   19669           0 :         | ECPGKeywords              { $$ = $1; }
   19670           0 :         | ECPGCKeywords             { $$ = $1; }
   19671           0 :         | CHAR_P                    { $$ = mm_strdup("char"); }
   19672           0 :         | VALUES                    { $$ = mm_strdup("values"); }
   19673             :         ;
   19674             : 
   19675             : /*
   19676             :  * Name classification hierarchy.
   19677             :  *
   19678             :  * These productions should match those in the core grammar, except that
   19679             :  * we use all_unreserved_keyword instead of unreserved_keyword, and
   19680             :  * where possible include ECPG keywords as well as core keywords.
   19681             :  */
   19682             : 
   19683             : /* Column identifier --- names that can be column, table, etc names.
   19684             :  */
   19685        2876 : ColId:  ecpg_ident                  { $$ = $1; }
   19686         108 :         | all_unreserved_keyword    { $$ = $1; }
   19687          22 :         | col_name_keyword          { $$ = $1; }
   19688          14 :         | ECPGKeywords              { $$ = $1; }
   19689           0 :         | ECPGCKeywords             { $$ = $1; }
   19690           0 :         | CHAR_P                    { $$ = mm_strdup("char"); }
   19691           0 :         | VALUES                    { $$ = mm_strdup("values"); }
   19692             :         ;
   19693             : 
   19694             : /* Type/function identifier --- names that can be type or function names.
   19695             :  */
   19696         112 : type_function_name: ecpg_ident      { $$ = $1; }
   19697          48 :         | all_unreserved_keyword    { $$ = $1; }
   19698           0 :         | type_func_name_keyword    { $$ = $1; }
   19699           6 :         | ECPGKeywords              { $$ = $1; }
   19700           0 :         | ECPGCKeywords             { $$ = $1; }
   19701           2 :         | ECPGTypeName              { $$ = $1; }
   19702             :         ;
   19703             : 
   19704             : /* Column label --- allowed labels in "AS" clauses.
   19705             :  * This presently includes *all* Postgres keywords.
   19706             :  */
   19707          54 : ColLabel:  ECPGColLabel             { $$ = $1; }
   19708           0 :         | ECPGTypeName              { $$ = $1; }
   19709           0 :         | CHAR_P                    { $$ = mm_strdup("char"); }
   19710           0 :         | CURRENT_P                 { $$ = mm_strdup("current"); }
   19711           0 :         | INPUT_P                   { $$ = mm_strdup("input"); }
   19712           0 :         | INT_P                     { $$ = mm_strdup("int"); }
   19713           0 :         | TO                        { $$ = mm_strdup("to"); }
   19714           0 :         | UNION                     { $$ = mm_strdup("union"); }
   19715           0 :         | VALUES                    { $$ = mm_strdup("values"); }
   19716           0 :         | ECPGCKeywords             { $$ = $1; }
   19717           0 :         | ECPGunreserved_interval   { $$ = $1; }
   19718             :         ;
   19719             : 
   19720         774 : ECPGColLabel:  ecpg_ident           { $$ = $1; }
   19721          10 :         | unreserved_keyword        { $$ = $1; }
   19722          12 :         | col_name_keyword          { $$ = $1; }
   19723           0 :         | type_func_name_keyword    { $$ = $1; }
   19724           0 :         | reserved_keyword          { $$ = $1; }
   19725           0 :         | ECPGKeywords_vanames      { $$ = $1; }
   19726           0 :         | ECPGKeywords_rest         { $$ = $1; }
   19727           0 :         | CONNECTION                { $$ = mm_strdup("connection"); }
   19728             :         ;
   19729             : 
   19730           0 : ECPGCKeywords: S_AUTO               { $$ = mm_strdup("auto"); }
   19731           0 :         | S_CONST                   { $$ = mm_strdup("const"); }
   19732           0 :         | S_EXTERN                  { $$ = mm_strdup("extern"); }
   19733           0 :         | S_REGISTER                { $$ = mm_strdup("register"); }
   19734           0 :         | S_STATIC                  { $$ = mm_strdup("static"); }
   19735           0 :         | S_TYPEDEF                 { $$ = mm_strdup("typedef"); }
   19736           0 :         | S_VOLATILE                { $$ = mm_strdup("volatile"); }
   19737             :         ;
   19738             : 
   19739             : /* "Unreserved" keywords --- available for use as any kind of name.
   19740             :  */
   19741             : 
   19742             : /*
   19743             :  * The following symbols must be excluded from ECPGColLabel and directly
   19744             :  * included into ColLabel to enable C variables to get names from ECPGColLabel:
   19745             :  * DAY_P, HOUR_P, MINUTE_P, MONTH_P, SECOND_P, YEAR_P.
   19746             :  *
   19747             :  * We also have to exclude CONNECTION, CURRENT, and INPUT for various reasons.
   19748             :  * CONNECTION can be added back in all_unreserved_keyword, but CURRENT and
   19749             :  * INPUT are reserved for ecpg purposes.
   19750             :  *
   19751             :  * The mentioned exclusions are done by $replace_line settings in parse.pl.
   19752             :  */
   19753         144 : all_unreserved_keyword: unreserved_keyword  { $$ = $1; }
   19754          12 :         | ECPGunreserved_interval           { $$ = $1; }
   19755           0 :         | CONNECTION                        { $$ = mm_strdup("connection"); }
   19756             :         ;
   19757             : 
   19758           2 : ECPGunreserved_interval: DAY_P              { $$ = mm_strdup("day"); }
   19759           0 :         | HOUR_P                            { $$ = mm_strdup("hour"); }
   19760           0 :         | MINUTE_P                          { $$ = mm_strdup("minute"); }
   19761           0 :         | MONTH_P                           { $$ = mm_strdup("month"); }
   19762          10 :         | SECOND_P                          { $$ = mm_strdup("second"); }
   19763           0 :         | YEAR_P                            { $$ = mm_strdup("year"); }
   19764             :         ;
   19765             : 
   19766             : 
   19767             : into_list : coutputvariable | into_list ',' coutputvariable
   19768             :         ;
   19769             : 
   19770             : ecpgstart: SQL_START    {
   19771        2660 :                 reset_variables();
   19772        2660 :                 pacounter = 1;
   19773             :             }
   19774             :         ;
   19775             : 
   19776          26 : c_args: /*EMPTY*/       { $$ = EMPTY; }
   19777          12 :         | c_list        { $$ = $1; }
   19778             :         ;
   19779             : 
   19780             : coutputvariable: cvariable indicator
   19781          56 :             { add_variable_to_head(&argsresult, find_variable($1), find_variable($2)); }
   19782             :         | cvariable
   19783         446 :             { add_variable_to_head(&argsresult, find_variable($1), &no_indicator); }
   19784             :         ;
   19785             : 
   19786             : 
   19787             : civarind: cvariable indicator
   19788             :         {
   19789           6 :             if (find_variable($2)->type->type == ECPGt_array)
   19790           0 :                 mmerror(PARSE_ERROR, ET_ERROR, "arrays of indicators are not allowed on input");
   19791             : 
   19792           6 :             add_variable_to_head(&argsinsert, find_variable($1), find_variable($2));
   19793           6 :             $$ = create_questionmarks($1, false);
   19794             :         }
   19795             :         ;
   19796             : 
   19797             : char_civar: char_variable
   19798             :         {
   19799          86 :             char *ptr = strstr($1, ".arr");
   19800             : 
   19801          86 :             if (ptr) /* varchar, we need the struct name here, not the struct element */
   19802          20 :                 *ptr = '\0';
   19803          86 :             add_variable_to_head(&argsinsert, find_variable($1), &no_indicator);
   19804          86 :             $$ = $1;
   19805             :         }
   19806             :         ;
   19807             : 
   19808             : civar: cvariable
   19809             :         {
   19810         240 :             add_variable_to_head(&argsinsert, find_variable($1), &no_indicator);
   19811         240 :             $$ = create_questionmarks($1, false);
   19812             :         }
   19813             :         ;
   19814             : 
   19815          62 : indicator: cvariable                { check_indicator((find_variable($1))->type); $$ = $1; }
   19816           0 :         | SQL_INDICATOR cvariable   { check_indicator((find_variable($2))->type); $$ = $2; }
   19817           0 :         | SQL_INDICATOR name        { check_indicator((find_variable($2))->type); $$ = $2; }
   19818             :         ;
   19819             : 
   19820             : cvariable:  CVARIABLE
   19821             :         {
   19822             :             /* As long as multidimensional arrays are not implemented we have to check for those here */
   19823        1262 :             char *ptr = $1;
   19824        1262 :             int brace_open=0, brace = false;
   19825             : 
   19826        7930 :             for (; *ptr; ptr++)
   19827             :             {
   19828        6668 :                 switch (*ptr)
   19829             :                 {
   19830          84 :                     case '[':
   19831          84 :                             if (brace)
   19832           0 :                                 mmfatal(PARSE_ERROR, "multidimensional arrays for simple data types are not supported");
   19833          84 :                             brace_open++;
   19834          84 :                             break;
   19835          84 :                     case ']':
   19836          84 :                             brace_open--;
   19837          84 :                             if (brace_open == 0)
   19838          84 :                                 brace = true;
   19839          84 :                             break;
   19840           0 :                     case '\t':
   19841             :                     case ' ':
   19842           0 :                             break;
   19843        6500 :                     default:
   19844        6500 :                             if (brace_open == 0)
   19845        6416 :                                 brace = false;
   19846        6500 :                             break;
   19847             :                 }
   19848             :             }
   19849        1262 :             $$ = $1;
   19850             :         }
   19851             :         ;
   19852             : 
   19853          22 : ecpg_param: PARAM       { $$ = make_name(); } ;
   19854             : 
   19855           2 : ecpg_bconst:    BCONST      { $$ = $1; } ;
   19856             : 
   19857          50 : ecpg_fconst:    FCONST      { $$ = make_name(); } ;
   19858             : 
   19859         362 : ecpg_sconst:    SCONST      { $$ = $1; } ;
   19860             : 
   19861           2 : ecpg_xconst:    XCONST      { $$ = $1; } ;
   19862             : 
   19863       17994 : ecpg_ident: IDENT       { $$ = $1; }
   19864        2316 :         | CSTRING   { $$ = make3_str(mm_strdup("\""), $1, mm_strdup("\"")); }
   19865             :         ;
   19866             : 
   19867             : quoted_ident_stringvar: name
   19868         212 :             { $$ = make3_str(mm_strdup("\""), $1, mm_strdup("\"")); }
   19869             :         | char_variable
   19870           8 :             { $$ = make3_str(mm_strdup("("), $1, mm_strdup(")")); }
   19871             :         ;
   19872             : 
   19873             : /*
   19874             :  * C stuff
   19875             :  */
   19876             : 
   19877         460 : c_stuff_item: c_anything            { $$ = $1; }
   19878           0 :         | '(' ')'           { $$ = mm_strdup("()"); }
   19879             :         | '(' c_stuff ')'
   19880          50 :             { $$ = cat_str(3, mm_strdup("("), $2, mm_strdup(")")); }
   19881             :         ;
   19882             : 
   19883         304 : c_stuff: c_stuff_item           { $$ = $1; }
   19884             :         | c_stuff c_stuff_item
   19885         206 :             { $$ = cat2_str($1, $2); }
   19886             :         ;
   19887             : 
   19888          14 : c_list: c_term              { $$ = $1; }
   19889          22 :         | c_list ',' c_term { $$ = cat_str(3, $1, mm_strdup(","), $3); }
   19890             :         ;
   19891             : 
   19892         254 : c_term:  c_stuff            { $$ = $1; }
   19893           2 :         | '{' c_list '}'    { $$ = cat_str(3, mm_strdup("{"), $2, mm_strdup("}")); }
   19894             :         ;
   19895             : 
   19896       25496 : c_thing:    c_anything      { $$ = $1; }
   19897        4094 :         |   '('     { $$ = mm_strdup("("); }
   19898        4094 :         |   ')'     { $$ = mm_strdup(")"); }
   19899        3528 :         |   ','     { $$ = mm_strdup(","); }
   19900        4786 :         |   ';'     { $$ = mm_strdup(";"); }
   19901             :         ;
   19902             : 
   19903       16372 : c_anything:  ecpg_ident             { $$ = $1; }
   19904        1628 :         | Iconst            { $$ = $1; }
   19905           8 :         | ecpg_fconst           { $$ = $1; }
   19906          30 :         | ecpg_sconst           { $$ = $1; }
   19907         620 :         | '*'               { $$ = mm_strdup("*"); }
   19908          26 :         | '+'               { $$ = mm_strdup("+"); }
   19909         178 :         | '-'               { $$ = mm_strdup("-"); }
   19910           0 :         | '/'               { $$ = mm_strdup("/"); }
   19911           0 :         | '%'               { $$ = mm_strdup("%"); }
   19912           4 :         | NULL_P            { $$ = mm_strdup("NULL"); }
   19913           0 :         | S_ADD             { $$ = mm_strdup("+="); }
   19914          28 :         | S_AND             { $$ = mm_strdup("&&"); }
   19915        2228 :         | S_ANYTHING            { $$ = make_name(); }
   19916           0 :         | S_AUTO            { $$ = mm_strdup("auto"); }
   19917          26 :         | S_CONST           { $$ = mm_strdup("const"); }
   19918           2 :         | S_DEC             { $$ = mm_strdup("--"); }
   19919           0 :         | S_DIV             { $$ = mm_strdup("/="); }
   19920           0 :         | S_DOTPOINT            { $$ = mm_strdup(".*"); }
   19921         110 :         | S_EQUAL           { $$ = mm_strdup("=="); }
   19922          34 :         | S_EXTERN          { $$ = mm_strdup("extern"); }
   19923         192 :         | S_INC             { $$ = mm_strdup("++"); }
   19924           0 :         | S_LSHIFT          { $$ = mm_strdup("<<"); }
   19925         202 :         | S_MEMBER          { $$ = mm_strdup("->"); }
   19926           0 :         | S_MEMPOINT            { $$ = mm_strdup("->*"); }
   19927           0 :         | S_MOD             { $$ = mm_strdup("%="); }
   19928           0 :         | S_MUL             { $$ = mm_strdup("*="); }
   19929          50 :         | S_NEQUAL          { $$ = mm_strdup("!="); }
   19930          10 :         | S_OR              { $$ = mm_strdup("||"); }
   19931           0 :         | S_REGISTER            { $$ = mm_strdup("register"); }
   19932           2 :         | S_RSHIFT          { $$ = mm_strdup(">>"); }
   19933         104 :         | S_STATIC          { $$ = mm_strdup("static"); }
   19934           0 :         | S_SUB             { $$ = mm_strdup("-="); }
   19935          66 :         | S_TYPEDEF         { $$ = mm_strdup("typedef"); }
   19936           0 :         | S_VOLATILE            { $$ = mm_strdup("volatile"); }
   19937           2 :         | SQL_BOOL          { $$ = mm_strdup("bool"); }
   19938           8 :         | ENUM_P            { $$ = mm_strdup("enum"); }
   19939           0 :         | HOUR_P            { $$ = mm_strdup("hour"); }
   19940         430 :         | INT_P             { $$ = mm_strdup("int"); }
   19941         116 :         | SQL_LONG          { $$ = mm_strdup("long"); }
   19942           0 :         | MINUTE_P          { $$ = mm_strdup("minute"); }
   19943           2 :         | MONTH_P           { $$ = mm_strdup("month"); }
   19944           0 :         | SECOND_P          { $$ = mm_strdup("second"); }
   19945           8 :         | SQL_SHORT         { $$ = mm_strdup("short"); }
   19946           8 :         | SQL_SIGNED            { $$ = mm_strdup("signed"); }
   19947         150 :         | SQL_STRUCT            { $$ = mm_strdup("struct"); }
   19948          20 :         | SQL_UNSIGNED          { $$ = mm_strdup("unsigned"); }
   19949           0 :         | YEAR_P            { $$ = mm_strdup("year"); }
   19950         378 :         | CHAR_P            { $$ = mm_strdup("char"); }
   19951           4 :         | FLOAT_P           { $$ = mm_strdup("float"); }
   19952           0 :         | TO                { $$ = mm_strdup("to"); }
   19953           4 :         | UNION             { $$ = mm_strdup("union"); }
   19954           0 :         | VARCHAR           { $$ = mm_strdup("varchar"); }
   19955         810 :         | '['               { $$ = mm_strdup("["); }
   19956         810 :         | ']'               { $$ = mm_strdup("]"); }
   19957        1098 :         | '='               { $$ = mm_strdup("="); }
   19958         188 :         | ':'               { $$ = mm_strdup(":"); }
   19959             :         ;
   19960             : 
   19961          36 : DeallocateStmt: DEALLOCATE prepared_name    { check_declared_list($2); $$ = $2; }
   19962          38 :         | DEALLOCATE PREPARE prepared_name  { check_declared_list($3); $$ = $3; }
   19963           2 :         | DEALLOCATE ALL                    { $$ = mm_strdup("all"); }
   19964           0 :         | DEALLOCATE PREPARE ALL            { $$ = mm_strdup("all"); }
   19965             :         ;
   19966             : 
   19967         230 : Iresult: Iconst                     { $$ = $1; }
   19968           0 :         | '(' Iresult ')'           { $$ = cat_str(3, mm_strdup("("), $2, mm_strdup(")")); }
   19969           0 :         | Iresult '+' Iresult       { $$ = cat_str(3, $1, mm_strdup("+"), $3); }
   19970           2 :         | Iresult '-' Iresult       { $$ = cat_str(3, $1, mm_strdup("-"), $3); }
   19971           0 :         | Iresult '*' Iresult       { $$ = cat_str(3, $1, mm_strdup("*"), $3); }
   19972           0 :         | Iresult '/' Iresult       { $$ = cat_str(3, $1, mm_strdup("/"), $3); }
   19973           0 :         | Iresult '%' Iresult       { $$ = cat_str(3, $1, mm_strdup("%"), $3); }
   19974           0 :         | ecpg_sconst               { $$ = $1; }
   19975          18 :         | ColId                     { $$ = $1; }
   19976           0 :         | ColId '(' var_type ')'    { if (pg_strcasecmp($1, "sizeof") != 0)
   19977           0 :                             mmerror(PARSE_ERROR, ET_ERROR, "operator not allowed in variable definition");
   19978             :                           else
   19979           0 :                             $$ = cat_str(4, $1, mm_strdup("("), $3.type_str, mm_strdup(")"));
   19980             :                         }
   19981             :         ;
   19982             : 
   19983          20 : execute_rest: /* EMPTY */   { $$ = EMPTY; }
   19984          40 :     | ecpg_using opt_ecpg_into  { $$ = EMPTY; }
   19985           0 :     | ecpg_into ecpg_using  { $$ = EMPTY; }
   19986           6 :     | ecpg_into             { $$ = EMPTY; }
   19987             :     ;
   19988             : 
   19989         280 : ecpg_into: INTO into_list   { $$ = EMPTY; }
   19990          28 :     | into_descriptor       { $$ = $1; }
   19991             :     ;
   19992             : 
   19993          28 : opt_ecpg_into:  /* EMPTY */ { $$ = EMPTY; }
   19994          16 :     | ecpg_into     { $$ = $1; }
   19995             :     ;
   19996             : 
   19997         100 : ecpg_fetch_into: ecpg_into  { $$ = $1; }
   19998             :     | using_descriptor
   19999             :     {
   20000             :         struct variable *var;
   20001             : 
   20002           2 :         var = argsinsert->variable;
   20003           2 :         remove_variable_from_list(&argsinsert, var);
   20004           2 :         add_variable_to_head(&argsresult, var, &no_indicator);
   20005           2 :         $$ = $1;
   20006             :     }
   20007             :     ;
   20008             : 
   20009           0 : opt_ecpg_fetch_into:    /* EMPTY */ { $$ = EMPTY; }
   20010           6 :     | ecpg_fetch_into       { $$ = $1; }
   20011             :     ;
   20012             : 
   20013             : %%
   20014             : 
   20015           0 : void base_yyerror(const char *error)
   20016             : {
   20017             :     /* translator: %s is typically the translation of "syntax error" */
   20018           0 :     mmerror(PARSE_ERROR, ET_ERROR, "%s at or near \"%s\"",
   20019           0 :             _(error), token_start ? token_start : base_yytext);
   20020           0 : }
   20021             : 
   20022           0 : void parser_init(void)
   20023             : {
   20024             :  /* This function is empty. It only exists for compatibility with the backend parser right now. */
   20025           0 : }

Generated by: LCOV version 1.14