[PATCH] Fix LTREE subpath with negative offset

Marcus Gartner <m.a.gartner@gmail.com>

From: Marcus Gartner <m.a.gartner@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2025-10-31T16:04:35Z
Lists: pgsql-hackers

Attachments

subpath(ltree,offset,len) now correctly errors when given an offset less
than -n where n is the number of labels in the given ltree. A duplicate
block of code has been removed which allowed an offset as low as -2n.

Commits

  1. Fix contrib/ltree's subpath() with negative offset.