public function close_cursor($cursorname) {
        // If the transaction got cancelled, then ignore this request.
        $sql = 'CLOSE ' . $cursorname;
        $this->query_start($sql, [], SQL_QUERY_AUX);
        $result = pg_query($this->pgsql, $sql);
        $this->query_end($result);
        if ($result) {
            pg_free_result($result);
        }
        return true;
    }