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