contrib/tree issues

From: achill(at)matrix(dot)gatewaynet(dot)com
To: pgsql-sql(at)postgresql(dot)org
Subject: contrib/tree issues
Date: 2002-05-29 16:35:06
Message-ID: Pine.LNX.4.44.0205291921060.15675-100000@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


I have been playing with the tree package, and so far
it seems fast.

But i have some questions:

How can we find "maximum" direct child of a node?

e.g.
The table has as:

dynatree=# SELECT node from achtree ;
node
-------
1
2
1.1
1.1.1
1.2
(5 rows)

dynatree=#

Now we find the children of '1' of level 2:

dynatree=# SELECT node from achtree where node <* '1.*.0';
node
------
1.1
1.2
(2 rows)

dynatree=#

Now if we want to insert another level 2 child of '1',
how can we get the current maximum value of level 2 children of node '1'??
(in this case 2), so that we can insert '1.3' to the table???

Also, i want to ask if somebody has extended postgresql's jdbc
implemantation to include support for bitrees,entrees.

One maybe slow solution for both of the above would be to
be able to cast e.g. entree to text, so that

a) taking the lexicographically maximum bitree value would give the
maximum current child, and
b) java intergration would be trivial through java.lang.String.

Thanx

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2002-05-29 16:37:06 Re: Can you help with this JOIN?
Previous Message Wei Weng 2002-05-29 16:21:22 Re: Can you help with this JOIN?