pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Cox, Brian <Brian.Cox@ca.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: "stack depth limit exceeded" executing DELETE FROM
Date: Tue, 05 Sep 2006 14:59:05 -0400
Message-ID: <18451.1157482745@sss.pgh.pa.us> (raw)
In-Reply-To: <3240464A2687334E92AAB86DAB6504530132D21B@USILMS13.ca.com>
References: <3240464A2687334E92AAB86DAB6504530132D21B@USILMS13.ca.com>

"Cox, Brian" <Brian.Cox@ca.com> 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



view thread (5+ messages)  latest in thread

Message-ID: <18451.1157482745@sss.pgh.pa.us>
Permalink:  ../18451.1157482745@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18451.1157482745@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Brian.Cox@ca.com
  Subject: Re: "stack depth limit exceeded" executing DELETE FROM
  In-Reply-To: <18451.1157482745@sss.pgh.pa.us>
  References: <3240464A2687334E92AAB86DAB6504530132D21B@USILMS13.ca.com> <18451.1157482745@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox