X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 1BBA29FB393 for ; Tue, 5 Sep 2006 15:59:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 44789-05-2 for ; Tue, 5 Sep 2006 15:59:12 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id A4E279FB38B for ; Tue, 5 Sep 2006 15:59:10 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k85Ix6hb018452; Tue, 5 Sep 2006 14:59:06 -0400 (EDT) To: "Cox, Brian" cc: pgsql-jdbc@postgresql.org Subject: Re: "stack depth limit exceeded" executing DELETE FROM In-reply-to: <3240464A2687334E92AAB86DAB6504530132D21B@USILMS13.ca.com> References: <3240464A2687334E92AAB86DAB6504530132D21B@USILMS13.ca.com> Comments: In-reply-to "Cox, Brian" message dated "Tue, 05 Sep 2006 14:18:05 -0400" Date: Tue, 05 Sep 2006 14:59:05 -0400 Message-ID: <18451.1157482745@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.116 tagged_above=0 required=5 tests=AWL, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/7 X-Sequence-Number: 15725 "Cox, Brian" writes: > 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? Not as such, but there's a limit on the complexity of WHERE clauses. Raising max_stack_depth might help you, but you'll run out of RAM eventually. (FWIW, 8.2 will cope a lot better with this particular construct.) regards, tom lane