Re: Union with array types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Juhan-Peep Ernits <juhan(at)cc(dot)ioc(dot)ee>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Union with array types
Date: 2001-03-14 15:54:49
Message-ID: 25327.984585289@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Juhan-Peep Ernits <juhan(at)cc(dot)ioc(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-03-14 16:01:44 Re: Re: Maximum size of one table
Previous Message J.H.M. Dassen Ray 2001-03-14 15:54:33 Re: Binary Large Data on Postgres