Re: Deleting 100 rows which meets certain criteria

From: Anthony <osm(at)inbox(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Deleting 100 rows which meets certain criteria
Date: 2009-12-30 23:56:33
Message-ID: 71cd4dd90912301556x61a9470dp937df069ca0ed52e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Dec 30, 2009 at 1:43 PM, APseudoUtopia <apseudoutopia(at)gmail(dot)com>wrote:

> You're correct to infer that DELETE does not support LIMIT clauses.
> The reason for this is there is no way to tell exactly which rows will
> be deleted (unless ORDER BY is used - but there are still other issues
> with that as well).
>
> You could, however, do something like such:
> DELETE FROM "table" WHERE "column" IN (SELECT "column" FROM "table"
> LIMIT 100 OFFSET 0);
>
> (But again, you would need explicit ORDER BY clauses to determine
> exactly which rows are actually deleted.

Are there any plans to disable that method as well, since it suffers from
the same problem?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Amiel 2009-12-31 00:10:08 PANIC: right sibling 2019 of block 2018 is not next child of 1937 in index "sl_log_2_idx1"
Previous Message Reece Hart 2009-12-30 21:47:26 Re: Deleting 100 rows which meets certain criteria