[ltree] Should `SELECT LCA('1.2', '1.2.3');` return '1.2' instead of '1'? - Mailing list pgsql-bugs

From Julien Grillot
Subject [ltree] Should `SELECT LCA('1.2', '1.2.3');` return '1.2' instead of '1'?
Date
Msg-id CAKnjZ0KTVw63SM5wkWqAkNRv5+-GPXF8r60vtssvhOWJ3N5otA@mail.gmail.com
Whole thread Raw
Responses Re: [ltree] Should `SELECT LCA('1.2', '1.2.3');` return '1.2' insteadof '1'?  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: Сергей А. Фролов
Date:
Subject: Re: BUG #14940: Duplicated records inspite of primary key and uniqueconstraint
Next
From: lyes.amd@gmail.com
Date:
Subject: BUG #14941: Vacuum crashes