Re: concat_ws

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Hans Spaans <pgsql-admin(at)lists(dot)hansspaans(dot)nl>, pgsql-admin(at)postgresql(dot)org
Subject: Re: concat_ws
Date: 2003-08-03 23:13:02
Message-ID: 2270.1059952382@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

Joe Conway <mail(at)joeconway(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Joe Conway 2003-08-03 23:16:11 Re: [HACKERS] concat_ws
Previous Message Tom Lane 2003-08-03 22:24:52 Re: concat_ws

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2003-08-03 23:16:11 Re: [HACKERS] concat_ws
Previous Message Rod Taylor 2003-08-03 22:37:38 Re: SQL2003 GENERATED ... AS ... syntax