Hackers,
This extremely odd case [2] came in via a report using a lot of PostGIS functions, but it can be reconfigured into a
pure-PostgreSQLcrasher [1].
CREATE TABLE n (i integer);
CREATE OR REPLACE FUNCTION add(integer)
RETURNS integer
AS 'SELECT 2 * $1 + 4 * $1'
LANGUAGE 'sql' IMMUTABLE STRICT PARALLEL SAFE;
SELECT add(array_length(array_agg(i)::numeric[],1)::integer) FROM n;
The stack trace shows it doesn’t get past planning, and in fact it doesn’t care if the table has data in it or not.
ATB,
P
[1] https://trac.osgeo.org/postgis/ticket/5793#comment:8
[2] https://lists.osgeo.org/pipermail/postgis-devel/2024-October/030428.html