Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id D8B1E475A74 for ; Wed, 29 May 2002 13:12:19 -0400 (EDT) Received: from matrix.gatewaynet.com (unknown [217.19.69.50]) by postgresql.org (Postfix) with ESMTP id 6F6DF4758E6 for ; Wed, 29 May 2002 13:12:13 -0400 (EDT) Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.11.6/8.11.6) with ESMTP id g4TGZ6B15746 for ; Wed, 29 May 2002 19:35:06 +0300 Date: Wed, 29 May 2002 19:35:06 +0300 (EEST) From: achill@matrix.gatewaynet.com To: pgsql-sql@postgresql.org Subject: contrib/tree issues In-Reply-To: <3CEE818B.9020702@wildbrain.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200205/306 X-Sequence-Number: 7941 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