Re: DELETE with LIMIT (or my first hack) - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: DELETE with LIMIT (or my first hack)
Date
Msg-id 4CF55FE2.70007@dunslane.net
Whole thread Raw
In response to Re: DELETE with LIMIT (or my first hack)  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers

On 11/30/2010 03:16 PM, Andres Freund wrote:
> On Tuesday 30 November 2010 20:24:52 Marko Tiikkaja wrote:
>>> On 11/30/2010 02:12 PM, Kevin Grittner wrote:
>>>> Daniel Loureiro<daniel@termasa.com.br>    wrote:
>>>>> to me the key its security - its a anti-DBA-with-lack-of-attention
>>>>> feature.
>>>> Well, it seems pretty weak to me for that purpose.  You still trash
>>>> data, and you don't have any immediate clue as to what.
>>> I agree, that argument is completely misconceived. If the DBA is paying
>>> enough attention to use LIMIT, s/he should be paying enough attention
>>> not to do damage in the first place. If that were the only argument in
>>> its favor I'd be completely against the feature.
>> I don't buy the argument either; why would you put a LIMIT there and
>> delete one row by accident when you could put a BEGIN; in front and not
>> do any damage at all?
> Because the delete of the whole table may take awfully long?
>
>

I don't see that that has anything to do with restricting damage. LIMIT 
might be useful for the reason you give, but not as any sort of 
protection against DBA carelessness. That's what the discussion above is 
about.

cheers

andrew


pgsql-hackers by date:

Previous
From: Alastair Turner
Date:
Subject: Re: DELETE with LIMIT (or my first hack)
Next
From: Tom Lane
Date:
Subject: Re: profiling connection overhead