MCPcopy Create free account
hub / github.com/apache/cloudberry / close_cursor

Function close_cursor

contrib/postgres_fdw/postgres_fdw.c:3941–3958  ·  view source on GitHub ↗

* Utility routine to close a cursor. */

Source from the content-addressed store, hash-verified

3939 * Utility routine to close a cursor.
3940 */
3941static void
3942close_cursor(PGconn *conn, unsigned int cursor_number,
3943 PgFdwConnState *conn_state)
3944{
3945 char sql[64];
3946 PGresult *res;
3947
3948 snprintf(sql, sizeof(sql), "CLOSE c%u", cursor_number);
3949
3950 /*
3951 * We don't use a PG_TRY block here, so be careful not to throw error
3952 * without releasing the PGresult.
3953 */
3954 res = pgfdw_exec_query(conn, sql, conn_state);
3955 if (PQresultStatus(res) != PGRES_COMMAND_OK)
3956 pgfdw_report_error(ERROR, res, conn, true, sql);
3957 PQclear(res);
3958}
3959
3960/*
3961 * create_foreign_modify

Callers 2

postgresEndForeignScanFunction · 0.70

Calls 4

pgfdw_exec_queryFunction · 0.85
PQresultStatusFunction · 0.85
pgfdw_report_errorFunction · 0.85
PQclearFunction · 0.85

Tested by

no test coverage detected