summaryrefslogtreecommitdiff
path: root/doc/src/sgml
diff options
context:
space:
mode:
authorTom Lane2018-07-13 22:45:30 +0000
committerTom Lane2018-07-13 22:45:30 +0000
commitcbbe75fe67195d9ee3efb2ea7af216c37a521cbf (patch)
treedf81f8d19cea9c216ad5dd29bfa418a191904127 /doc/src/sgml
parent0cf3363c01104cd7a0388a3e01a533f21872d011 (diff)
Fix crash in contrib/ltree's lca() function for empty input array.
lca_inner() wasn't prepared for the possibility of getting no inputs. Fix that, and make some cosmetic improvements to the code while at it. Also, I thought the documentation of this function as returning the "longest common prefix" of the paths was entirely misleading; it really returns a path one shorter than the longest common prefix, for the typical definition of "prefix". Don't use that term in the docs, and adjust the examples to clarify what really happens. This has been broken since its beginning, so back-patch to all supported branches. Per report from Hailong Li. Thanks to Pierre Ducroquet for diagnosing and for the initial patch, though I whacked it around some and added test cases. Discussion: https://postgr.es/m/5b0d8e4f-f2a3-1305-d612-e00e35a7be66@qunar.com
Diffstat (limited to 'doc/src/sgml')
-rw-r--r--doc/src/sgml/ltree.sgml8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/src/sgml/ltree.sgml b/doc/src/sgml/ltree.sgml
index 9855d2c9c89..6f284257f51 100644
--- a/doc/src/sgml/ltree.sgml
+++ b/doc/src/sgml/ltree.sgml
@@ -457,17 +457,17 @@ Europe & Russia*@ & !Transportation
<row>
<entry><function>lca(ltree, ltree, ...)</function><indexterm><primary>lca</primary></indexterm></entry>
<entry><type>ltree</type></entry>
- <entry>lowest common ancestor, i.e., longest common prefix of paths
+ <entry>longest common ancestor of paths
(up to 8 arguments supported)</entry>
- <entry><literal>lca('1.2.2.3','1.2.3.4.5.6')</literal></entry>
+ <entry><literal>lca('1.2.3','1.2.3.4.5.6')</literal></entry>
<entry><literal>1.2</literal></entry>
</row>
<row>
<entry><function>lca(ltree[])</function></entry>
<entry><type>ltree</type></entry>
- <entry>lowest common ancestor, i.e., longest common prefix of paths</entry>
- <entry><literal>lca(array['1.2.2.3'::ltree,'1.2.3'])</literal></entry>
+ <entry>longest common ancestor of paths in array</entry>
+ <entry><literal>lca(array['1.2.3'::ltree,'1.2.3.4'])</literal></entry>
<entry><literal>1.2</literal></entry>
</row>