Re: [[BUG] pg_stat_statements crashes with var and non-var expressions in IN clause
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Sami Imseih <samimseih@gmail.com>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-01-19T08:14:46Z
Lists: pgsql-hackers
On Thu, Jan 15, 2026 at 02:53:20PM -0600, Sami Imseih wrote: >> As far as I recall it was an >> intentional design decision, and to adjust newa->list_end in such >> scenarios we need to solve the original problem of finding an end >> location of any arbitrary expression, > > I'm not sure I follow. How would we adjust newa->list_end? I may be missing something, of course, but Dmitry's message reads as follows to me: "It was a design choice to track the start and end locations because we needed that for arrays, and resetting the locations if we have Vars in the list like you are suggesting is OK by me." I am going to re-read a bit more the area and think about a couple of patterns to test, but I think that your suggested solution should be OK to disable the list squashing as you are suggesting in this case: there is nothing we can really do, and IMO that would still be OK for most users because squashing has been designed for non-Var lists as far as I know. This is a rare pattern for long lists in IN arrays, as well. I'll sleep on it for now. -- Michael
Commits
-
pg_stat_statements: Fix crash in list squashing with Vars
- 3304e97b1b73 18.2 landed
- 5d95219faa1a 19 (unreleased) landed