Re: [PATCH] Fix LTREE subpath with negative offset

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marcus Gartner <m(dot)a(dot)gartner(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Fix LTREE subpath with negative offset
Date: 2025-11-01 17:04:36
Message-ID: 4030704.1762016676@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Marcus Gartner <m(dot)a(dot)gartner(at)gmail(dot)com> writes:
> 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.

Nice catch ... as far as I can see from the git history, that mistake
has been there since day one.

I'm inclined to put this in master only, without a back-patch.
It's not fixing any case that should work, and it seems possible
that somebody out there is depending on the bogus behavior.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Alger 2025-11-01 17:44:47 Re: [PATCH] Add pg_get_type_ddl() to retrieve the CREATE TYPE statement
Previous Message Hannu Krosing 2025-11-01 16:10:08 Re: pg_plan_advice