Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wc4Aa-0005IN-Gn for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Apr 2014 02:41:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wc4AZ-0002wq-Ul for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Apr 2014 02:41:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wc4AY-0002wh-13 for pgsql-bugs@postgresql.org; Mon, 21 Apr 2014 02:41:18 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wc4AV-00050s-6z for pgsql-bugs@postgresql.org; Mon, 21 Apr 2014 02:41:17 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s3L2fDrP016152; Sun, 20 Apr 2014 22:41:13 -0400 From: Tom Lane To: Jon Nelson cc: pgsql-bugs@postgresql.org Subject: Re: crash with latest git HEAD In-reply-to: References: Comments: In-reply-to Jon Nelson message dated "Sun, 20 Apr 2014 21:09:12 -0500" Date: Sun, 20 Apr 2014 22:41:13 -0400 Message-ID: <16151.1398048073@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Jon Nelson writes: > The following query results in a crash, ultimately due to the process > running out of memory: > create table blah as select md5(generate_series(1,50000000)::text) as a; The behavior looks the same to me in either 9.3 or HEAD: it does consume a lotta memory (about 7GB) but eventually finishes. If it's crashing for you, you probably need to look at your system-level configuration, particularly the per-process memory ulimit level vs. available RAM/swap and whether the dreaded OOM killer is enabled. The reason it's eating so much memory is you've got a profligate SRF in the SELECT's targetlist. Try it as, eg, create table blah as select md5(g::text) as a from generate_series(1,50000000) g; While it's be nice to not have SRFs in the targetlist be a memory problem, it's not an easy thing to do, and I doubt anyone is going to look very hard for a fix for what is basically a deprecated feature. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs