X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id DED559FB389 for ; Tue, 5 Sep 2006 16:19:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 94270-03-6 for ; Tue, 5 Sep 2006 19:19:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from hs5.cfa.cmu.edu (HS5.CFA.cmu.edu [128.2.103.215]) by postgresql.org (Postfix) with ESMTP id C79069FB397 for ; Tue, 5 Sep 2006 16:18:55 -0300 (ADT) Received: from [192.168.100.102] (host82.155.212.198.conversent.net [155.212.198.82]) (authenticated bits=0) by hs5.cfa.cmu.edu (8.12.11.20060308/8.12.11) with ESMTP id k85JIrHs018875 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO) for ; Tue, 5 Sep 2006 15:18:54 -0400 Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: <20060905184450.GA41016@winnie.fuhr.org> References: <3240464A2687334E92AAB86DAB6504530132D21B@USILMS13.ca.com> <20060905184450.GA41016@winnie.fuhr.org> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <8F44EB66-D8CE-4228-8AE7-C5500F6B5766@themactionfaction.com> Content-Transfer-Encoding: 7bit From: AgentM Subject: Re: "stack depth limit exceeded" executing DELETE FROM Date: Tue, 5 Sep 2006 15:18:46 -0400 To: pgsql-jdbc@postgresql.org X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200609/10 X-Sequence-Number: 15728 On Sep 5, 2006, at 14:44 , Michael Fuhr wrote: > On Tue, Sep 05, 2006 at 02:18:05PM -0400, Cox, Brian wrote: >> The following fails with a "stack depth limit exceeded": >> >> DELETE FROM some-table WHERE pk IN (pk1, pk2, ..., pkN) >> >> where pk = primary key and N is large, may be > 50000. >> >> Is there some limit as to the number of rows that can >> be deleted in a single DELETE? > > The error isn't due to the number of rows being deleted but rather > from parsing the large number of items in the IN list. See the > following thread: > > http://archives.postgresql.org/pgsql-general/2006-01/msg00959.php You have been receiving great advice from the other guys, but another thing to try is to use some middleware to determine which ranges your delete set covers and use WHERE pk BETWEEN x AND y, potentially improving index usage performance. -M