pg_upless
pg_upless
pg_upless : Detect Useless UPDATE
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 5180 | pg_upless | pg_upless | 0.0.3 | ADMIN | PostgreSQL | SQL |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
----dt- | No | No | No | Yes | no | yes |
| Relationships | |
|---|---|
| Requires | plpgsql |
| See Also | pg_readonly pg_savior safeupdate pg_permissions pgaudit set_user pg_drop_events table_log |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.0.3 | 18 17 16 15 14 | pg_upless | plpgsql |
| RPM | PIGSTY | 0.0.3 | 18 17 16 15 14 | pg_upless_$v | - |
| DEB | PIGSTY | 0.0.3 | 18 17 16 15 14 | postgresql-$v-pg-upless | - |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
el8.x86_64 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 |
el8.aarch64 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 |
el9.x86_64 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 |
el9.aarch64 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 |
el10.x86_64 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 |
el10.aarch64 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 |
d12.x86_64 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 |
d12.aarch64 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 |
d13.x86_64 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 |
d13.aarch64 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 |
u22.x86_64 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 |
u22.aarch64 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 |
u24.x86_64 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 |
u24.aarch64 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 | PIGSTY 0.0.3 |
Source
pig build pkg pg_upless; # build rpm/debInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgsql -u # add both repo and update cacheInstall this extension with pig:
pig install pg_upless; # install via package name, for the active PG version
pig install pg_upless -v 18; # install for PG 18
pig install pg_upless -v 17; # install for PG 17
pig install pg_upless -v 16; # install for PG 16
pig install pg_upless -v 15; # install for PG 15
pig install pg_upless -v 14; # install for PG 14Create this extension with:
CREATE EXTENSION pg_upless CASCADE; -- requires plpgsqlUsage
pg_upless detects UPDATE statements that change no actual values (common with ORMs). It works by installing triggers on monitored tables and collecting statistics. It is intended as a diagnostic tool, not for permanent use.
Start Monitoring
-- Monitor a specific table
SELECT pg_upless_start('public', 'boats');
-- Monitor all tables in a schema
SELECT pg_upless_start('public');Stop Monitoring
-- Stop monitoring a specific table
SELECT pg_upless_stop('public', 'boats');
-- Stop monitoring all tables in a schema
SELECT pg_upless_stop('public');View Statistics
The extension creates two tables in the pg_upless schema:
pg_upless_stats– stores counts of total vs useless updates per tablepg_upless_start_time– records when monitoring started (for rate calculations)
Last updated on