pg_isok

Query-based data integrity management and soft alerting for PostgreSQL

Overview

PackageVersionCategoryLicenseLanguage
pg_isok1.4.1UTILAGPL-3.0SQL
IDExtensionBinLibLoadCreateTrustRelocSchema
4340pg_isokNoNoNoYesNoNo-

superuser=false, but this is not a trusted extension.

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY1.4.11817161514pg_isok-
RPMPIGSTY1.4.11817161514pg_isok_$v-
DEBPIGSTY1.4.11817161514postgresql-$v-pg-isok-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
d12.aarch64
d13.x86_64
d13.aarch64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
u22.x86_64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
u22.aarch64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
u24.x86_64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
u24.aarch64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1

Build

You can build the RPM / DEB packages for pg_isok using pig build:

pig build pkg pg_isok         # build RPM / DEB packages

Install

You can install pg_isok directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:

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

Install the extension using pig or apt/yum/dnf:

pig install pg_isok;          # Install for current active PG version
pig ext install -y pg_isok -v 18  # PG 18
pig ext install -y pg_isok -v 17  # PG 17
pig ext install -y pg_isok -v 16  # PG 16
pig ext install -y pg_isok -v 15  # PG 15
pig ext install -y pg_isok -v 14  # PG 14
dnf install -y pg_isok_18       # PG 18
dnf install -y pg_isok_17       # PG 17
dnf install -y pg_isok_16       # PG 16
dnf install -y pg_isok_15       # PG 15
dnf install -y pg_isok_14       # PG 14
apt install -y postgresql-18-pg-isok   # PG 18
apt install -y postgresql-17-pg-isok   # PG 17
apt install -y postgresql-16-pg-isok   # PG 16
apt install -y postgresql-15-pg-isok   # PG 15
apt install -y postgresql-14-pg-isok   # PG 14

Create Extension:

CREATE EXTENSION pg_isok;

Usage

Sources: official repo, official docs home, official reference source

pg_isok is a query-based data integrity and monitoring extension. Instead of only reporting rows that currently look questionable, it stores prior results and focuses later runs on unresolved or undeferred changes.

CREATE SCHEMA isok;
CREATE EXTENSION pg_isok SCHEMA isok;

SELECT *
FROM isok.run_isok_queries()
AS problems;

Core Objects

  • ISOK_QUERIES stores the monitoring queries and their execution settings.
  • ISOK_RESULTS stores the reported rows, including whether they were resolved or deferred.
  • run_isok_queries() runs every active check.
  • run_isok_queries($$VALUES ('check_name')$$) runs only selected checks.

Typical Workflow

Run one named check:

SELECT *
FROM isok.run_isok_queries($$VALUES ('new_countries')$$)
AS problems;

Accept or postpone a known warning by updating ISOK_RESULTS:

UPDATE isok.isok_results
SET deferred_to = 'infinity'
WHERE iqname = 'new_countries';

Use resolved when the condition is no longer a concern, or deferred_to when it should stay hidden until a later date.

Where It Fits

  • data cleanup after imports
  • monitoring unusual but sometimes acceptable patterns
  • “soft trigger” style review workflows where hard constraints are too strict

Caveats

  • Upstream recommends installing it in a dedicated schema and qualifying calls accordingly.
  • The docs describe it as pure SQL, which is useful on managed PostgreSQL services where C extensions may be restricted.
  • The package metadata in this repo says superuser=false, but this is not documented upstream as a trusted extension; treat installation privileges conservatively.

Last Modified 2026-04-19: update extension stub docs (9f178c3)