@@ -1026,7 +1026,7 @@ ProcessCopyOptions(ParseState *pstate,
10261026 /* Extract options from the statement node tree */
10271027 foreach (option , options )
10281028 {
1029- DefElem * defel = (DefElem * ) lfirst (option );
1029+ DefElem * defel = castNode (DefElem , lfirst (option ) );
10301030
10311031 if (strcmp (defel -> defname , "format" ) == 0 )
10321032 {
@@ -1139,7 +1139,7 @@ ProcessCopyOptions(ParseState *pstate,
11391139 errmsg ("conflicting or redundant options" ),
11401140 parser_errposition (pstate , defel -> location )));
11411141 if (defel -> arg && IsA (defel -> arg , List ))
1142- cstate -> force_notnull = (List * ) defel -> arg ;
1142+ cstate -> force_notnull = castNode (List , defel -> arg ) ;
11431143 else
11441144 ereport (ERROR ,
11451145 (errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
@@ -1154,7 +1154,7 @@ ProcessCopyOptions(ParseState *pstate,
11541154 (errcode (ERRCODE_SYNTAX_ERROR ),
11551155 errmsg ("conflicting or redundant options" )));
11561156 if (defel -> arg && IsA (defel -> arg , List ))
1157- cstate -> force_null = (List * ) defel -> arg ;
1157+ cstate -> force_null = castNode (List , defel -> arg ) ;
11581158 else
11591159 ereport (ERROR ,
11601160 (errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
@@ -1176,7 +1176,7 @@ ProcessCopyOptions(ParseState *pstate,
11761176 parser_errposition (pstate , defel -> location )));
11771177 cstate -> convert_selectively = true;
11781178 if (defel -> arg == NULL || IsA (defel -> arg , List ))
1179- cstate -> convert_select = (List * ) defel -> arg ;
1179+ cstate -> convert_select = castNode (List , defel -> arg ) ;
11801180 else
11811181 ereport (ERROR ,
11821182 (errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
@@ -1479,7 +1479,7 @@ BeginCopy(ParseState *pstate,
14791479 /* examine queries to determine which error message to issue */
14801480 foreach (lc , rewritten )
14811481 {
1482- Query * q = (Query * ) lfirst (lc );
1482+ Query * q = castNode (Query , lfirst (lc ) );
14831483
14841484 if (q -> querySource == QSRC_QUAL_INSTEAD_RULE )
14851485 ereport (ERROR ,
@@ -1496,7 +1496,7 @@ BeginCopy(ParseState *pstate,
14961496 errmsg ("multi-statement DO INSTEAD rules are not supported for COPY" )));
14971497 }
14981498
1499- query = (Query * ) linitial (rewritten );
1499+ query = castNode (Query , linitial (rewritten ) );
15001500
15011501 /* The grammar allows SELECT INTO, but we don't support that */
15021502 if (query -> utilityStmt != NULL &&
0 commit comments