@@ -1026,7 +1026,7 @@ ProcessCopyOptions(ParseState *pstate,
1026
1026
/* Extract options from the statement node tree */
1027
1027
foreach (option ,options )
1028
1028
{
1029
- DefElem * defel = (DefElem * ) lfirst (option );
1029
+ DefElem * defel = castNode (DefElem , lfirst (option ) );
1030
1030
1031
1031
if (strcmp (defel -> defname ,"format" )== 0 )
1032
1032
{
@@ -1139,7 +1139,7 @@ ProcessCopyOptions(ParseState *pstate,
1139
1139
errmsg ("conflicting or redundant options" ),
1140
1140
parser_errposition (pstate ,defel -> location )));
1141
1141
if (defel -> arg && IsA (defel -> arg ,List ))
1142
- cstate -> force_notnull = (List * ) defel -> arg ;
1142
+ cstate -> force_notnull = castNode (List , defel -> arg ) ;
1143
1143
else
1144
1144
ereport (ERROR ,
1145
1145
(errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
@@ -1154,7 +1154,7 @@ ProcessCopyOptions(ParseState *pstate,
1154
1154
(errcode (ERRCODE_SYNTAX_ERROR ),
1155
1155
errmsg ("conflicting or redundant options" )));
1156
1156
if (defel -> arg && IsA (defel -> arg ,List ))
1157
- cstate -> force_null = (List * ) defel -> arg ;
1157
+ cstate -> force_null = castNode (List , defel -> arg ) ;
1158
1158
else
1159
1159
ereport (ERROR ,
1160
1160
(errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
@@ -1176,7 +1176,7 @@ ProcessCopyOptions(ParseState *pstate,
1176
1176
parser_errposition (pstate ,defel -> location )));
1177
1177
cstate -> convert_selectively = true;
1178
1178
if (defel -> arg == NULL || IsA (defel -> arg ,List ))
1179
- cstate -> convert_select = (List * ) defel -> arg ;
1179
+ cstate -> convert_select = castNode (List , defel -> arg ) ;
1180
1180
else
1181
1181
ereport (ERROR ,
1182
1182
(errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
@@ -1479,7 +1479,7 @@ BeginCopy(ParseState *pstate,
1479
1479
/* examine queries to determine which error message to issue */
1480
1480
foreach (lc ,rewritten )
1481
1481
{
1482
- Query * q = (Query * ) lfirst (lc );
1482
+ Query * q = castNode (Query , lfirst (lc ) );
1483
1483
1484
1484
if (q -> querySource == QSRC_QUAL_INSTEAD_RULE )
1485
1485
ereport (ERROR ,
@@ -1496,7 +1496,7 @@ BeginCopy(ParseState *pstate,
1496
1496
errmsg ("multi-statement DO INSTEAD rules are not supported for COPY" )));
1497
1497
}
1498
1498
1499
- query = (Query * ) linitial (rewritten );
1499
+ query = castNode (Query , linitial (rewritten ) );
1500
1500
1501
1501
/* The grammar allows SELECT INTO, but we don't support that */
1502
1502
if (query -> utilityStmt != NULL &&