Re: [ltree] Should `SELECT LCA('1.2', '1.2.3');` return '1.2' instead of '1'?

From: Julien Grillot <julien(dot)grillot(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: [ltree] Should `SELECT LCA('1.2', '1.2.3');` return '1.2' instead of '1'?
Date: 2017-12-04 13:06:07
Message-ID: CAKnjZ0+5kqS=2oB2=omZN93wYYY2BfQ0M8rnmpSg4o_OUVpGMg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

2017-12-01 17:17 GMT+01:00 David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>:

> ​[…] Adding a leading (due to varargs) boolean argument that specifies
> "end node is ancestor of itself" behavior might be a workable solution.
>

> Regardless, the docs should be clarified on this point, though, and maybe
> add a code comment somewhere.
>

I understand the importance not to break existing usages. It would be
perfect to have a boolean to specify that – and to clarify the docs, since
the example given does not reveal this behavior
https://www.postgresql.org/docs/9.1/static/ltree.html#LTREE-FUNC-TABLE

I digged inside the source code and ended at
`contrib/ltree/ltree_op.c:406` but I don't feel able to do the patch.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Lyes Ameddah 2017-12-04 13:59:33 Re: BUG #14941: Vacuum crashes
Previous Message Adrian Vondendriesch 2017-12-04 12:35:23 Re: Postgres installation issue