Re: [ADMIN] concat_ws - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [ADMIN] concat_ws
Date
Msg-id 1680.1059949492@sss.pgh.pa.us
Whole thread Raw
Responses Re: [ADMIN] concat_ws
List pgsql-hackers
Joe Conway <mail@joeconway.com> writes:
> Tom Lane wrote:
>> It seems to be running out of memory.

> Also worth noting, without STRICT, even a plain EXPLAIN *without*
> ANALYZE causes the problem to show itself.

Yeah.  The problem is that the SQL function inliner generates an
enormous expression tree from this function definition.  7.3 had no
inliner so no problem.

I am not sure what to do about it --- the only idea that comes to mind
is to put an arbitrary limit (of, say, 5 or 10 function calls) on the
depth of inlining expansion.  That seems like a pretty ugly answer
... anyone have a better one?

Your definition of concat_ws bears some passing resemblance to the
infamous Ackermann's function, btw.

            regards, tom lane

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: SQL2003 GENERATED ... AS ... syntax
Next
From: Rod Taylor
Date:
Subject: Re: SQL2003 GENERATED ... AS ... syntax