def METHOD_NAME(pgconn, libpq):
    res = pgconn.exec_(b"select 1")
    assert isinstance(res.pgresult_ptr, int)
    f = libpq.PQcmdStatus
    f.argtypes = [ctypes.c_void_p]
    f.restype = ctypes.c_char_p
    assert f(res.pgresult_ptr) == b"SELECT 1"
    res.clear()
    assert res.pgresult_ptr is None