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