Thanks for the quick response !

        * int_array_aggregate crashes

I don't remember this function :)

        You mean it's not part of intarray contrib ?
        I thought so !
        Sorry !
        Then who's responsible for maintenance of it ?

        int4 nlevel(ltree) - returns level of the node.

        I had missed this one.
        The summer heat has burnt by brain it seems ;)

        - access it like an array (ie. get element N).

        subltree, subpath

        I know, but I was hoping for something like :
        myltree[pos]

        instead of the usable, but a bit huge, and probably slower :
        ltree2text(subltree(myltree, pos-1,pos ));

Also a function returning the comon prefix between two ltrees would be really useful.

     ltree lca(ltree,ltree,...) (up to 8 arguments)
     ltree lca(ltree[])
     Returns Lowest Common Ancestor (lca)

        I know, too, but :

test=> SELECT lca( '1.2.3'::ltree, '1.2.4'::ltree );
 lca
-----
 1.2
(1 ligne)

test=> SELECT lca( '1.2.3'::ltree, '1.2'::ltree );
 lca
-----
 1
(1 ligne)

In the case of the 'longest common prefix' I'd need the second SELECT to return the same as the first. This is to determine a 'parent' path that includes a bunch of other paths, in that case, if the parent is part of the original set, I get the parent's parent instead of what I want.

Have you read README.ltree ?

        Yes ! But I had missed nlevel() to my shame.

        thanks !


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

Reply via email to