Re: "stack depth limit exceeded" executing DELETE FROM

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Cox, Brian" <Brian(dot)Cox(at)ca(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: "stack depth limit exceeded" executing DELETE FROM
Date: 2006-09-05 18:59:05
Message-ID: 18451.1157482745@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

"Cox, Brian" <Brian(dot)Cox(at)ca(dot)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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Mark Lewis 2006-09-05 19:00:33 Re: "stack depth limit exceeded" executing DELETE FROM
Previous Message Michael Fuhr 2006-09-05 18:44:50 Re: "stack depth limit exceeded" executing DELETE FROM