* resolveTargetListUnknowns() * Convert any unknown-type targetlist entries to type TEXT. * * We do this after we've exhausted all other ways of identifying the output * column types of a query. */
| 287 | * column types of a query. |
| 288 | */ |
| 289 | void |
| 290 | resolveTargetListUnknowns(ParseState *pstate, List *targetlist) |
| 291 | { |
| 292 | ListCell *l; |
| 293 | |
| 294 | foreach(l, targetlist) |
| 295 | { |
| 296 | TargetEntry *tle = (TargetEntry *) lfirst(l); |
| 297 | Oid restype = exprType((Node *) tle->expr); |
| 298 | |
| 299 | if (restype == UNKNOWNOID) |
| 300 | { |
| 301 | tle->expr = (Expr *) coerce_type(pstate, (Node *) tle->expr, |
| 302 | restype, TEXTOID, -1, |
| 303 | COERCION_IMPLICIT, |
| 304 | COERCE_IMPLICIT_CAST, |
| 305 | -1); |
| 306 | } |
| 307 | } |
| 308 | } |
| 309 | |
| 310 | |
| 311 | /* |
no test coverage detected