Re: DELETE with LIMIT (or my first hack)

From: Jaime Casanova <jaime(at)2ndquadrant(dot)com>
To: Daniel Loureiro <loureirorg(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: DELETE with LIMIT (or my first hack)
Date: 2010-11-30 02:33:56
Message-ID: AANLkTimx08PcEP4gK7YxPpqNQurDMzPqa0ga5MhrskWX@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 29, 2010 at 9:08 PM, Daniel Loureiro <loureirorg(at)gmail(dot)com> wrote:
>
> 3) change the executor to stop after “n” successful iterations. Is
> this correct ?
>

no. it means you will delete the n first tuples that happen to be
found, if you don't have a WHERE clause that means is very possible
you delete something you don't want to... the correct solution is to
use always try DELETE's inside transactions and only if you see the
right thing happening issue a COMMIT

besides i think this has been proposed and rejected before

--
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte y capacitación de PostgreSQL

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Kupershmidt 2010-11-30 02:37:10 Re: [GENERAL] column-level update privs + lock table
Previous Message Itagaki Takahiro 2010-11-30 02:16:51 Re: dblink versus long connection strings