Thanks Joe, But this function is not giving a path from one element to other, it is just truncating the tree beginning from the start element, but it is not rotating the whole tree making starting element a tree's root.
JC> See contrib/tablefunc for a function called connectby(). Regards, Anton ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match