Require SQL Where Clause
safeupdate is a simple extension to PostgreSQL that raises an error if
DELETE are executed without specifying conditions. This
extension was initially designed to protect data from accidental obliteration of
data that is writable by PostgREST.
Build from source using
gmake gmake install
Or from PGXN
pgxn install safeupate
Activate per-session by running
Make this mandatory for all databases and connections by adding the following to
Try to update records without
UPDATE FROM rack SET fan_spee=70; -- ERROR: UPDATE requires a WHERE clause
Set a column value for a range of records
UPDATE rack SET fan_speed=90 WHERE fan_speed=70;
Set a column value for all the records in a table
UPDATE rack SET fan_speed=90 WHERE 1=1;
- PostgreSQL 8.4+
A release history as well as features in the upcoming release are covered in the NEWS file.
Source is under and ISC-style license. See the LICENSE file for more detailed information on the license used for compatibility libraries.