Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-jdbc by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group