"Vilson farias" <vilson.farias@digitro.com.br> writes:
> from 7.0.2 to 7.0.3, the following script works fine, but in 7.1.2 I
> must remove the rr. from ORDER BY clause.
Yup. That's an intentional change. The ORDER BY applies to the output
columns of the UNION, not to whatever tables might have been referenced
in the arms of the UNION.
regards, tom lane