Re: BUG #19370: PG18 returns incorrect array slice results when slice bounds depend on another array expression

David Rowley <dgrowleyml@gmail.com>

From: David Rowley <dgrowleyml@gmail.com>
To: redraiment@gmail.com, pgsql-bugs@lists.postgresql.org, Andres Freund <andres@anarazel.de>
Date: 2026-01-06T09:26:19Z
Lists: pgsql-bugs
On Tue, 6 Jan 2026 at 21:22, PG Bug reporting form
<noreply@postgresql.org> wrote:
> I have encountered a behavioral regression in PostgreSQL 18 related to array
> slicing when the slice start index is computed from another array expression
> in the same SELECT list.
>
> The attached SQL query (included below in full for reproducibility)

Many thanks for the report and reproducer. I've not looked as to why,
but this seems to be caused by a7f107df2. I've included Andres.

David



Commits

  1. Fix buggy interaction between array subscripts and subplan params