I'm using PostgreSQL with ltree extension.
Consider I have the following structure in my database:
Given C node (path: A.C
) as a start node and I node (path: A.C.F.G.I
) as an end node I want to select all nodes between them including the boundaries. So, the result should include: C, F, G, I, but not the other nodes.
Is there a combination of built-in ltree
functions I could use to write up a query?