Daniel Loureiro <dan...@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.  If you
wanted protection from that you'd want more of an "assert limit"
that would fail if the affected row count was above what you
specified.
 
For me the best solution is to develop good habits.  I first type my
statement as "SELECT * FROM ..." and after reviewing the results
arrow up and replace "SELECT *" with "DELETE".  If there's enough
volatility or complexity to make that insufficient insurance, I
begin a transaction.  That way I can not only review row counts but
run queries against the modified data to confirm correct
modification before issuing a COMMIT (or ROLLBACK).
 
The batching of updates so that vacuums can make space available for
re-use is more compelling to me, but still pretty iffy, since the
work-arounds aren't that hard to find.
 
-Kevin

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to