From: Michael Fuhr <mike@fuhr.org>
To: Axel Straschil <axel@straschil.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: ORDER BY with LTREE
Date: Mon, 20 Feb 2006 00:41:20 -0700
Message-ID: <20060220074120.GA31596@winnie.fuhr.org> (raw)
In-Reply-To: <slrndvbnbs.l6a.axel@m2.sine>
References: <slrndvbnbs.l6a.axel@m2.sine>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: mike@fuhr.org, axel@straschil.com
Subject: Re: ORDER BY with LTREE
In-Reply-To: <20060220074120.GA31596@winnie.fuhr.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox