pg_upless

pg_upless

pg_upless : Detect Useless UPDATE

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
5180
pg_upless
pg_upless
0.0.3
ADMIN
PostgreSQL
SQL
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
----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

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXT
PIGSTY
0.0.3
18
17
16
15
14
pg_uplessplpgsql
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 / PGPG18PG17PG16PG15PG14
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/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install 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 14

Create this extension with:

CREATE EXTENSION pg_upless CASCADE; -- requires plpgsql

Usage

pg_upless: Detect Useless UPDATE

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 table
  • pg_upless_start_time – records when monitoring started (for rate calculations)
Last updated on