* ExpandIndirectionStar() * Transforms foo.* into a list of expressions or targetlist entries. * * This handles the case where '*' appears as the last item in A_Indirection. * The code is shared between the case of foo.* at the top level in a SELECT * target list (where we want TargetEntry nodes in the result) and foo.* in * a ROW() or VALUES() construct (where we want just bare expressions
| 1341 | * this rather than relying on exprKind. |
| 1342 | */ |
| 1343 | static List * |
| 1344 | ExpandIndirectionStar(ParseState *pstate, A_Indirection *ind, |
| 1345 | bool make_target_entry, ParseExprKind exprKind) |
| 1346 | { |
| 1347 | Node *expr; |
| 1348 | |
| 1349 | /* Strip off the '*' to create a reference to the rowtype object */ |
| 1350 | ind = copyObject(ind); |
| 1351 | ind->indirection = list_truncate(ind->indirection, |
| 1352 | list_length(ind->indirection) - 1); |
| 1353 | |
| 1354 | /* And transform that */ |
| 1355 | expr = transformExpr(pstate, (Node *) ind, exprKind); |
| 1356 | |
| 1357 | /* Expand the rowtype expression into individual fields */ |
| 1358 | return ExpandRowReference(pstate, expr, make_target_entry); |
| 1359 | } |
| 1360 | |
| 1361 | /* |
| 1362 | * ExpandSingleTable() |
no test coverage detected