Operating system: Ubuntu 17.04
PostgreSQL version: 9.6.6
At the moment, both SELECT LCA('1.2', '1.2'); and SELECT LCA('1.2',
'1.2.3'); return ‘1’.
According to the Wikipedia1 definition of LCA:
“[…] the lowest common ancestor (LCA) of two nodes v and w […] is the
lowest (i.e. deepest) node that has both v and w as descendants, where we
define each node to be a descendant of itself (so if v has a direct
connection from w, w is the lowest common ancestor).”
So, in my understanding, both SELECT LCA('1.2', '1.2'); and SELECT
LCA('1.2', '1.2.3'); should return ‘1.2’. What do you think about it?
By the way, the ltree structure is really great, thank you!
Julien Grillot