Juhan-Peep Ernits <juhan@cc.ioc.ee> writes:
> (select id, mystuff from arraytest where id=1) union (select id, mystuf
> f from arraytest where id=2);
> ERROR: Unable to identify an ordering operator '<' for type '_varchar'
> Use an explicit ordering operator or modify the query
> Is it necessary to require the explicit ordering operator in this
> case?
Yes, because UNION implies duplicate removal, which requires sorting.
If you don't actually need duplicate removal, use UNION ALL.
regards, tom lane