In article <1f96e061-713c-4929-a7d9-278e5b608...@solfertje.student.utwente.nl>,
Alban Hertroys writes:
> On 20 Apr 2010, at 18:05, Harald Fuchs wrote:
>> Here's a working version:
>>
>> WITH RECURSIVE tree (path, category, sort_order, parent) AS (
>> SELECT category, category, sort_order::text,
On Tue, Apr 20, 2010 at 1:58 PM, Alban Hertroys
wrote:
> On 20 Apr 2010, at 11:59, cojack wrote:
>
>
>> I am not interested about recursive queries, i think this kill ltree idea.
>
>
> And IMHO it should. ltree is from a time when we didn't have any other means
> to describe data organised as a t
On 20 Apr 2010, at 11:59, cojack wrote:
>> 1). The way you're doing this in your new examples should work, although
>> I'd probably make the ordering numbers part of the category names and
>> split those off when I read them. For example:
>> 27 | 1|Top
>> 28 | 1|Top.1|Science
>>
On 20 Apr 2010, at 18:05, Harald Fuchs wrote:
> Here's a working version:
>
> WITH RECURSIVE tree (path, category, sort_order, parent) AS (
>SELECT category, category, sort_order::text, parent
>FROM node
>WHERE parent IS NULL
> UNION ALL
>SELECT t.path || '.' || n.category,
>
In article <59670b22-30cb-4e6e-83c8-c1d1036c9...@solfertje.student.utwente.nl>,
Alban Hertroys writes:
> 2). Drop the ltree column and go with a truly recursive approach, something
> like this:
> CREATE TABLE node (
> categorytextNOT NULL PRIMARY KEY,
> sort_order i
> Alban Hertroys wrote:
>
>
> Aha, looks like you want to sort each tree level by some user-specified
> order.
>
> You should realise that ltree was contributed before Postgres supported
> (recursive) CTE's. If you're using ltree in combination with recursive
> CTE's you're doing twice the work
On 19 Apr 2010, at 20:26, cojack wrote:
>> Alban Hertroys wrote:
>>
>> It would help if you'd show us what result you expect from ordering the
>> above.
>>
>> Most people would order this by path I think. However that doesn't match
>> your sort column and I can't think of any method that would g
> Alban Hertroys wrote:
>
> It would help if you'd show us what result you expect from ordering the
> above.
>
> Most people would order this by path I think. However that doesn't match
> your sort column and I can't think of any method that would give results
> in such an arbitrary order as you s
On 19 Apr 2010, at 9:23, cojack wrote:
> Hello,
> id | path | sort
>
> +---+--
>