* Utility routine to close a cursor. */
| 3939 | * Utility routine to close a cursor. |
| 3940 | */ |
| 3941 | static void |
| 3942 | close_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 |
no test coverage detected