[#64977858] change query, for postgresql compatibility