How to deal with order by, group by, distinct for user-defined types - Mailing list pgsql-hackers

From Ruey-Lung Hsiao
Subject How to deal with order by, group by, distinct for user-defined types
Date
Msg-id I9Wmd.45796$QJ3.27129@newssvr21.news.prodigy.com
Whole thread Raw
Responses Re: How to deal with order by, group by, distinct for user-defined types  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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


pgsql-hackers by date:

Previous
From: "Harry Smith"
Date:
Subject: Usenet Discussion Proposal
Next
From: Tom Lane
Date:
Subject: Re: How to deal with order by, group by, distinct for user-defined types