Re: order by for user defined types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kjetil Haaland <kjetil(dot)haaland(at)student(dot)uib(dot)no>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: order by for user defined types
Date: 2004-12-03 16:15:07
Message-ID: 21942.1102090507@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Kjetil Haaland <kjetil(dot)haaland(at)student(dot)uib(dot)no> writes:
> I have a defined my own type that i use in postgres. I have made some
> operators like >, => etc. so i can use it in a where clause in a query. I am
> now wondering if it is possible to do the same for order by?

You need to define a default btree index opclass for your datatype. See
the chapter "Interfacing Extensions to Indexes" in the documentation.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message clayton 2004-12-03 16:17:49 Postgre 8 beta 5
Previous Message Sean Davis 2004-12-03 13:18:27 using a correlated subquery in update