* SPI_cursor_open() * * Open a prepared SPI plan as a portal */
| 1470 | * Open a prepared SPI plan as a portal |
| 1471 | */ |
| 1472 | Portal |
| 1473 | SPI_cursor_open(const char *name, SPIPlanPtr plan, |
| 1474 | Datum *Values, const char *Nulls, |
| 1475 | bool read_only) |
| 1476 | { |
| 1477 | Portal portal; |
| 1478 | ParamListInfo paramLI; |
| 1479 | |
| 1480 | /* build transient ParamListInfo in caller's context */ |
| 1481 | paramLI = _SPI_convert_params(plan->nargs, plan->argtypes, |
| 1482 | Values, Nulls); |
| 1483 | |
| 1484 | portal = SPI_cursor_open_internal(name, plan, paramLI, read_only); |
| 1485 | |
| 1486 | /* done with the transient ParamListInfo */ |
| 1487 | if (paramLI) |
| 1488 | pfree(paramLI); |
| 1489 | |
| 1490 | return portal; |
| 1491 | } |
| 1492 | |
| 1493 | |
| 1494 | /* |
no test coverage detected