Re: ORDER BY with LTREE

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: ORDER BY with LTREE
Дата
Msg-id 20060220074120.GA31596@winnie.fuhr.org
обсуждение исходный текст
Ответ на ORDER BY with LTREE  (Axel Straschil <axel@straschil.com>)
Список 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 по дате отправления:

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: Given 02-01-2006 to 02-28-2006, output all days.
Следующее
От: Milorad Poluga
Дата:
Сообщение: Re: Interval subtracting