safeupdate
Require criteria for UPDATE and DELETE
safeupdate : Require criteria for UPDATE and DELETE
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 5820 | safeupdate | safeupdate | 1.7 |
ADMIN | ISC | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --sL--- | No | Yes | Yes | No | no | no |
| Relationships | |
|---|---|
| See Also | pg_strict pg_savior pg_drop_events table_log block_copy_command pg_kpart plan_filter |
Packages
| Linux / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PGDG 1.7 | PGDG 1.7 | PGDG 1.7 | PGDG 1.7 |
| el8.aarch64 | N/A | PGDG 1.7 | PGDG 1.7 | PGDG 1.7 | PGDG 1.7 |
| el9.x86_64 | PGDG 1.7 | PGDG 1.7 | PGDG 1.7 | PGDG 1.7 | PGDG 1.7 |
| el9.aarch64 | PGDG 1.7 | PGDG 1.7 | PGDG 1.7 | PGDG 1.7 | PGDG 1.7 |
| el10.x86_64 | PGDG 1.7 | PGDG 1.7 | PGDG 1.7 | PGDG 1.7 | PGDG 1.7 |
| el10.aarch64 | PGDG 1.7 | PGDG 1.7 | PGDG 1.7 | PGDG 1.7 | PGDG 1.7 |
| d12.x86_64 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 |
| d12.aarch64 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 |
| d13.x86_64 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 |
| d13.aarch64 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 |
| u22.x86_64 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 |
| u22.aarch64 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 |
| u24.x86_64 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 |
| u24.aarch64 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 |
| u26.x86_64 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 |
| u26.aarch64 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 |
Source
github.com/eradman/pg-safeupdate
pg-safeupdate-1.7.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Config this extension to shared_preload_libraries:
This extension does not need CREATE EXTENSION DDL command
Usage
The safeupdate extension prevents accidental mass data changes by raising an error whenever UPDATE or DELETE statements are executed without a WHERE clause.
Activation
Behavior
Administrative Override
CTE-based modifications without WHERE conditions are also blocked. The extension is particularly useful with PostgREST or other systems that provide direct write access to the database.