Re: Pg17 Crash in Planning (Arrays + Casting + UDF)

Fredrik Widlert <fredrik.widlert@digpro.se>

From: Fredrik Widlert <fredrik.widlert@digpro.se>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Nathan Bossart <nathandbossart@gmail.com>, Paul Ramsey <pramsey@cleverelephant.ca>, Pgsql Hackers <pgsql-hackers@postgresql.org>, Regina Obe <lr@pcorp.us>
Date: 2024-10-10T08:24:29Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Avoid crash in estimate_array_length with null root pointer.

  2. Teach estimate_array_length() to use statistics where available.

As the original reporter on the PostGIS mailing list, I want to thank
everyone both
on that list and on the Postgres list for the very quick response.

Having the problem confirmed and a ticket opened in 2 minutes is really
impressive.

My report contained a very simplified version of our crashing query, but
I've now also
verified that the fix

> -    else if (arrayexpr)
> +    else if (arrayexpr && root != NULL)

also stops our original big query from crashing.

Thanks!
/Fredrik