How to deal with order by, group by, distinct for user-defined types

From: Ruey-Lung Hsiao <rlhsiao(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: How to deal with order by, group by, distinct for user-defined types
Date: 2004-11-18 05:11:05
Message-ID: I9Wmd.45796$QJ3.27129@newssvr21.news.prodigy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I implemented a user-defined type, say X, and when I want to do the
following queries, Postgresql will complain

CREATE TABLE Table1 ( id integer, object X );

SELECT X, count(*) from Table1
GROUP BY X;

> ERROR: could not identify an ordering operator for type X
> HINT: Use an explicit ordering operator or modify the query.

My question is: how do I find or define ordering operators for my
user-defined type?

Thanks.

Ruey-Lung Hsiao

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gaetano Mendola 2004-11-18 06:40:54 Re: 7.4.5 / 7.4.6 crash (pg_hba.conf issue)
Previous Message Greg Stark 2004-11-18 04:57:48 Re: ambiguous column names in subqueries