Unix Technical Forum

operator class for user defined type

This is a discussion on operator class for user defined type within the pgsql Novice forums, part of the PostgreSQL category; --> Hi I have created my own user defined type, and an operator class for this type. Then i can ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 09:31 PM
Kjetil Haaland
 
Posts: n/a
Default operator class for user defined type

Hi

I have created my own user defined type, and an operator class for this type.
Then i can use the order by clause with this type, but it is sorting with the
lowest value on top. Is it possible to get it to sort with the highest value
on top?

thanks

-Kjetil

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 09:31 PM
Tom Lane
 
Posts: n/a
Default Re: operator class for user defined type

Kjetil Haaland <kjetil.haaland@student.uib.no> writes:
> I have created my own user defined type, and an operator class for this type.
> Then i can use the order by clause with this type, but it is sorting with the
> lowest value on top. Is it possible to get it to sort with the highest value
> on top?


ORDER BY foo DESC

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 09:31 PM
Larry Rosenman
 
Posts: n/a
Default Re: operator class for user defined type

Kjetil Haaland wrote:
> Hi
>
> I have created my own user defined type, and an operator class for
> this type.
> Then i can use the order by clause with this type, but it is sorting
> with the lowest value on top. Is it possible to get it to sort with
> the highest value on top?
>



Does order by xxx DESC help?



--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:46 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com