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 17880D1C9DD; Sun, 3 Aug 2003 22:26:26 +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 60164-05; Sun, 3 Aug 2003 19:25:14 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id A58B4D1C9DB; Sun, 3 Aug 2003 19:26:14 -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 h73MOrSa001681; Sun, 3 Aug 2003 18:24:53 -0400 (EDT) To: Joe Conway Cc: Hans Spaans , pgsql-admin@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: concat_ws In-reply-to: <3F2D84FF.3070304@joeconway.com> References: <20030803131931.GD4326@sch01r01.nexit.nl> <26941.1059926135@sss.pgh.pa.us> <3F2D4B3B.3050405@joeconway.com> <6571.1059934474@sss.pgh.pa.us> <3F2D84FF.3070304@joeconway.com> Comments: In-reply-to Joe Conway message dated "Sun, 03 Aug 2003 14:56:15 -0700" Date: Sun, 03 Aug 2003 18:24:52 -0400 Message-ID: <1680.1059949492@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/46 X-Sequence-Number: 9769 Joe Conway 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