* free_parsestate * Release a ParseState and any subsidiary resources. */
| 74 | * Release a ParseState and any subsidiary resources. |
| 75 | */ |
| 76 | void |
| 77 | free_parsestate(ParseState *pstate) |
| 78 | { |
| 79 | /* |
| 80 | * Check that we did not produce too many resnos; at the very least we |
| 81 | * cannot allow more than 2^16, since that would exceed the range of a |
| 82 | * AttrNumber. It seems safest to use MaxTupleAttributeNumber. |
| 83 | */ |
| 84 | if (pstate->p_next_resno - 1 > MaxTupleAttributeNumber) |
| 85 | ereport(ERROR, |
| 86 | (errcode(ERRCODE_TOO_MANY_COLUMNS), |
| 87 | errmsg("target lists can have at most %d entries", |
| 88 | MaxTupleAttributeNumber))); |
| 89 | |
| 90 | if (pstate->p_target_relation != NULL) |
| 91 | table_close(pstate->p_target_relation, NoLock); |
| 92 | |
| 93 | pfree(pstate); |
| 94 | } |
| 95 | |
| 96 | |
| 97 | /* |
no test coverage detected