Hmmm ... it actually looks right in 4.6 but I see another error in a query that's PG-only buried in the generic XQL file.
I'll look at this later today.