X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id E3FCDD1C9DE for ; Sun, 3 Aug 2003 23:14:28 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 62574-04 for ; Sun, 3 Aug 2003 20:13:17 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id F3CFBD1C9DB for ; Sun, 3 Aug 2003 20:14:17 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h73ND2Sa002271; Sun, 3 Aug 2003 19:13:03 -0400 (EDT) To: Joe Conway Cc: Hans Spaans , pgsql-admin@postgresql.org Subject: Re: concat_ws In-reply-to: <3F2D4B3B.3050405@joeconway.com> References: <20030803131931.GD4326@sch01r01.nexit.nl> <26941.1059926135@sss.pgh.pa.us> <3F2D4B3B.3050405@joeconway.com> Comments: In-reply-to Joe Conway message dated "Sun, 03 Aug 2003 10:49:47 -0700" Date: Sun, 03 Aug 2003 19:13:02 -0400 Message-ID: <2270.1059952382@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/47 X-Sequence-Number: 9770 Joe Conway 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