Re: Union with array types - Mailing list pgsql-general

From Tom Lane
Subject Re: Union with array types
Date
Msg-id 25327.984585289@sss.pgh.pa.us
Whole thread Raw
In response to Union with array types  (Juhan-Peep Ernits <juhan@cc.ioc.ee>)
List pgsql-general
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

pgsql-general by date:

Previous
From: "Brent R. Matzelle"
Date:
Subject: Re: Maximum size of one table
Next
From: jdassen@cistron.nl (J.H.M. Dassen (Ray))
Date:
Subject: Re: Binary Large Data on Postgres