Re: concat_ws - Mailing list pgsql-admin

From Tom Lane
Subject Re: concat_ws
Date
Msg-id 2270.1059952382@sss.pgh.pa.us
Whole thread Raw
In response to Re: concat_ws  (Joe Conway <mail@joeconway.com>)
Responses Re: concat_ws
List pgsql-admin
Joe Conway <mail@joeconway.com> writes:
> regression=# select
>
concat_ws('~','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24');
> ERROR:  ERRORDATA_STACK_SIZE exceeded

With the removal of some overoptimistic code in elog.c, I get

test=#  select
concat_ws('~','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24');
ERROR:  out of memory
DETAIL:  Failed on request of size 12.
CONTEXT:  SQL function "concat_ws" during inlining
SQL function "concat_ws" during inlining
SQL function "concat_ws" during inlining
SQL function "concat_ws" during inlining
SQL function "concat_ws" during inlining
SQL function "concat_ws" during inlining
SQL function "concat_ws" during inlining
SQL function "concat_ws" during inlining
SQL function "concat_ws" during startup
test=#

which at least gives some clue what's going wrong.

There is some code in the function inliner to abandon inlining if an
input expression is "too expensive", but its notion of "too expensive"
is currently just "contains subselects".  I'm going to see if it helps
to reject inlining when the input grows "too large", for some value of
"too large".

            regards, tom lane

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: concat_ws
Next
From: Joe Conway
Date:
Subject: Re: [HACKERS] concat_ws