Re: ORDER BY with LTREE - Mailing list pgsql-sql

From Michael Fuhr
Subject Re: ORDER BY with LTREE
Date
Msg-id 20060220074120.GA31596@winnie.fuhr.org
Whole thread Raw
In response to ORDER BY with LTREE  (Axel Straschil <axel@straschil.com>)
List pgsql-sql
On Fri, Feb 17, 2006 at 02:28:13PM +0000, Axel Straschil wrote:
> Im working with the ltree [1] datatype and have labels that can not used
> directly in ltree and a want to get a tree like strukture ordered by the 
> labels.

Are you saying that you can't convert labels into ltree values like
'c.a' and order by that?  What data type are the real labels?

One possibility would be to create a custom operator and add a USING
clause to the ORDER BY clause.  The operator could compare records
by whatever algorithm you like, even if that means looking up other
records (e.g., to determine an ancestor's label).  That could be
expensive for a large table but it might be worth considering.

-- 
Michael Fuhr


pgsql-sql by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Given 02-01-2006 to 02-28-2006, output all days.
Next
From: Milorad Poluga
Date:
Subject: Re: Interval subtracting