From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ferruccio Zamuner <nonsolosoft@diff.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: Unable to identify an ordering operator
Date: Sun, 31 Dec 2000 12:17:19 -0500
Message-ID: <8413.978283039@sss.pgh.pa.us> (raw)
In-Reply-To: <200012311455.eBVEtCt11654@tnt.diff.org>
References: <200012311455.eBVEtCt11654@tnt.diff.org>
Ferruccio Zamuner <nonsolosoft@diff.org> writes:
> select persons.name,firm.name,persons.tel
> from persons,work,firm
> where (persons.table_owner=0) and
> (work.id_firm=firm.id and work.id_person=persons.id)
> union
> select persons.name,firm.name,persons.tel
> from persons,work,firm
> where (persons.table_owner=1) and
> (work.id_firm=firm.id and work.id_person=persons.id);
> ERROR: Unable to identify an ordering operator '<' for type '_text'
UNION is defined to eliminate duplicate rows, so it has to be able to
sort and compare rows, which means it needs < and = operators for each
selected column's datatype. Evidently one of the name or tel columns
is declared as array of text ('_text' means text[]), for which there
is no '<' operator. You could probably make one if you were intent
on it (see contrib/array for some inspiration). A lazier way out is
to use UNION ALL, which doesn't try to eliminate duplicates.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, nonsolosoft@diff.org
Subject: Re: Unable to identify an ordering operator
In-Reply-To: <8413.978283039@sss.pgh.pa.us>
References: <200012311455.eBVEtCt11654@tnt.diff.org> <8413.978283039@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox