| 472 | } |
| 473 | |
| 474 | static PyObject * |
| 475 | PLy_cursor_close(PyObject *self, PyObject *unused) |
| 476 | { |
| 477 | PLyCursorObject *cursor = (PLyCursorObject *) self; |
| 478 | |
| 479 | if (!cursor->closed) |
| 480 | { |
| 481 | Portal portal = GetPortalByName(cursor->portalname); |
| 482 | |
| 483 | if (!PortalIsValid(portal)) |
| 484 | { |
| 485 | PLy_exception_set(PyExc_ValueError, |
| 486 | "closing a cursor in an aborted subtransaction"); |
| 487 | return NULL; |
| 488 | } |
| 489 | |
| 490 | UnpinPortal(portal); |
| 491 | SPI_cursor_close(portal); |
| 492 | cursor->closed = true; |
| 493 | } |
| 494 | |
| 495 | Py_RETURN_NONE; |
| 496 | } |
nothing calls this directly
no test coverage detected