pglinter

pglinter

pglinter : PostgreSQL Linting and Analysis Extension

Overview

ID Extension Package Version Category License Language
5090
pglinter
pglinter
1.1.2
ADMIN
PostgreSQL
Rust
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-dt-
No
Yes
No
Yes
no
yes
Relationships
See Also
amcheck
supautils

manually upgraded PGRX from 0.16.1 to 0.17.0 by Vonng

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
PIGSTY
1.1.2
18
17
16
15
14
pglinter -
RPM
PIGSTY
1.1.2
18
17
16
15
14
pglinter_$v -
DEB
PIGSTY
1.1.2
18
17
16
15
14
postgresql-$v-pglinter -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
el8.aarch64
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
el9.x86_64
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
el9.aarch64
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
el10.x86_64
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
el10.aarch64
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
d12.x86_64
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
d12.aarch64
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
d13.x86_64
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
d13.aarch64
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
u22.x86_64
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
u22.aarch64
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
u24.x86_64
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
u24.aarch64
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
PIGSTY 1.1.2
Package Version OS ORG SIZE File URL
pglinter_18 1.1.2 el8.x86_64 pigsty 587.9 KiB pglinter_18-1.1.2-1PIGSTY.el8.x86_64.rpm
pglinter_18 1.1.2 el8.aarch64 pigsty 449.1 KiB pglinter_18-1.1.2-1PIGSTY.el8.aarch64.rpm
pglinter_18 1.1.2 el9.x86_64 pigsty 601.7 KiB pglinter_18-1.1.2-1PIGSTY.el9.x86_64.rpm
pglinter_18 1.1.2 el9.aarch64 pigsty 477.2 KiB pglinter_18-1.1.2-1PIGSTY.el9.aarch64.rpm
pglinter_18 1.1.2 el10.x86_64 pigsty 601.5 KiB pglinter_18-1.1.2-1PIGSTY.el10.x86_64.rpm
pglinter_18 1.1.2 el10.aarch64 pigsty 476.6 KiB pglinter_18-1.1.2-1PIGSTY.el10.aarch64.rpm
postgresql-18-pglinter 1.1.2 d12.x86_64 pigsty 496.2 KiB postgresql-18-pglinter_1.1.2-1PIGSTY~bookworm_amd64.deb
postgresql-18-pglinter 1.1.2 d12.aarch64 pigsty 364.7 KiB postgresql-18-pglinter_1.1.2-1PIGSTY~bookworm_arm64.deb
postgresql-18-pglinter 1.1.2 d13.x86_64 pigsty 496.2 KiB postgresql-18-pglinter_1.1.2-1PIGSTY~trixie_amd64.deb
postgresql-18-pglinter 1.1.2 d13.aarch64 pigsty 364.5 KiB postgresql-18-pglinter_1.1.2-1PIGSTY~trixie_arm64.deb
postgresql-18-pglinter 1.1.2 u22.x86_64 pigsty 549.8 KiB postgresql-18-pglinter_1.1.2-1PIGSTY~jammy_amd64.deb
postgresql-18-pglinter 1.1.2 u22.aarch64 pigsty 424.9 KiB postgresql-18-pglinter_1.1.2-1PIGSTY~jammy_arm64.deb
postgresql-18-pglinter 1.1.2 u24.x86_64 pigsty 545.0 KiB postgresql-18-pglinter_1.1.2-1PIGSTY~noble_amd64.deb
postgresql-18-pglinter 1.1.2 u24.aarch64 pigsty 418.6 KiB postgresql-18-pglinter_1.1.2-1PIGSTY~noble_arm64.deb
Package Version OS ORG SIZE File URL
pglinter_17 1.1.2 el8.x86_64 pigsty 587.7 KiB pglinter_17-1.1.2-1PIGSTY.el8.x86_64.rpm
pglinter_17 1.1.2 el8.aarch64 pigsty 447.7 KiB pglinter_17-1.1.2-1PIGSTY.el8.aarch64.rpm
pglinter_17 1.1.2 el9.x86_64 pigsty 601.9 KiB pglinter_17-1.1.2-1PIGSTY.el9.x86_64.rpm
pglinter_17 1.1.2 el9.aarch64 pigsty 475.5 KiB pglinter_17-1.1.2-1PIGSTY.el9.aarch64.rpm
pglinter_17 1.1.2 el10.x86_64 pigsty 602.0 KiB pglinter_17-1.1.2-1PIGSTY.el10.x86_64.rpm
pglinter_17 1.1.2 el10.aarch64 pigsty 475.6 KiB pglinter_17-1.1.2-1PIGSTY.el10.aarch64.rpm
postgresql-17-pglinter 1.1.2 d12.x86_64 pigsty 496.3 KiB postgresql-17-pglinter_1.1.2-1PIGSTY~bookworm_amd64.deb
postgresql-17-pglinter 1.1.2 d12.aarch64 pigsty 363.6 KiB postgresql-17-pglinter_1.1.2-1PIGSTY~bookworm_arm64.deb
postgresql-17-pglinter 1.1.2 d13.x86_64 pigsty 495.7 KiB postgresql-17-pglinter_1.1.2-1PIGSTY~trixie_amd64.deb
postgresql-17-pglinter 1.1.2 d13.aarch64 pigsty 363.7 KiB postgresql-17-pglinter_1.1.2-1PIGSTY~trixie_arm64.deb
postgresql-17-pglinter 1.1.2 u22.x86_64 pigsty 550.0 KiB postgresql-17-pglinter_1.1.2-1PIGSTY~jammy_amd64.deb
postgresql-17-pglinter 1.1.2 u22.aarch64 pigsty 423.3 KiB postgresql-17-pglinter_1.1.2-1PIGSTY~jammy_arm64.deb
postgresql-17-pglinter 1.1.2 u24.x86_64 pigsty 545.1 KiB postgresql-17-pglinter_1.1.2-1PIGSTY~noble_amd64.deb
postgresql-17-pglinter 1.1.2 u24.aarch64 pigsty 417.7 KiB postgresql-17-pglinter_1.1.2-1PIGSTY~noble_arm64.deb
Package Version OS ORG SIZE File URL
pglinter_16 1.1.2 el8.x86_64 pigsty 587.6 KiB pglinter_16-1.1.2-1PIGSTY.el8.x86_64.rpm
pglinter_16 1.1.2 el8.aarch64 pigsty 447.5 KiB pglinter_16-1.1.2-1PIGSTY.el8.aarch64.rpm
pglinter_16 1.1.2 el9.x86_64 pigsty 601.3 KiB pglinter_16-1.1.2-1PIGSTY.el9.x86_64.rpm
pglinter_16 1.1.2 el9.aarch64 pigsty 475.2 KiB pglinter_16-1.1.2-1PIGSTY.el9.aarch64.rpm
pglinter_16 1.1.2 el10.x86_64 pigsty 601.5 KiB pglinter_16-1.1.2-1PIGSTY.el10.x86_64.rpm
pglinter_16 1.1.2 el10.aarch64 pigsty 475.5 KiB pglinter_16-1.1.2-1PIGSTY.el10.aarch64.rpm
postgresql-16-pglinter 1.1.2 d12.x86_64 pigsty 495.6 KiB postgresql-16-pglinter_1.1.2-1PIGSTY~bookworm_amd64.deb
postgresql-16-pglinter 1.1.2 d12.aarch64 pigsty 363.7 KiB postgresql-16-pglinter_1.1.2-1PIGSTY~bookworm_arm64.deb
postgresql-16-pglinter 1.1.2 d13.x86_64 pigsty 495.4 KiB postgresql-16-pglinter_1.1.2-1PIGSTY~trixie_amd64.deb
postgresql-16-pglinter 1.1.2 d13.aarch64 pigsty 363.6 KiB postgresql-16-pglinter_1.1.2-1PIGSTY~trixie_arm64.deb
postgresql-16-pglinter 1.1.2 u22.x86_64 pigsty 549.8 KiB postgresql-16-pglinter_1.1.2-1PIGSTY~jammy_amd64.deb
postgresql-16-pglinter 1.1.2 u22.aarch64 pigsty 423.3 KiB postgresql-16-pglinter_1.1.2-1PIGSTY~jammy_arm64.deb
postgresql-16-pglinter 1.1.2 u24.x86_64 pigsty 545.0 KiB postgresql-16-pglinter_1.1.2-1PIGSTY~noble_amd64.deb
postgresql-16-pglinter 1.1.2 u24.aarch64 pigsty 417.6 KiB postgresql-16-pglinter_1.1.2-1PIGSTY~noble_arm64.deb
Package Version OS ORG SIZE File URL
pglinter_15 1.1.2 el8.x86_64 pigsty 587.4 KiB pglinter_15-1.1.2-1PIGSTY.el8.x86_64.rpm
pglinter_15 1.1.2 el8.aarch64 pigsty 449.1 KiB pglinter_15-1.1.2-1PIGSTY.el8.aarch64.rpm
pglinter_15 1.1.2 el9.x86_64 pigsty 601.3 KiB pglinter_15-1.1.2-1PIGSTY.el9.x86_64.rpm
pglinter_15 1.1.2 el9.aarch64 pigsty 477.1 KiB pglinter_15-1.1.2-1PIGSTY.el9.aarch64.rpm
pglinter_15 1.1.2 el10.x86_64 pigsty 601.5 KiB pglinter_15-1.1.2-1PIGSTY.el10.x86_64.rpm
pglinter_15 1.1.2 el10.aarch64 pigsty 476.5 KiB pglinter_15-1.1.2-1PIGSTY.el10.aarch64.rpm
postgresql-15-pglinter 1.1.2 d12.x86_64 pigsty 495.9 KiB postgresql-15-pglinter_1.1.2-1PIGSTY~bookworm_amd64.deb
postgresql-15-pglinter 1.1.2 d12.aarch64 pigsty 364.7 KiB postgresql-15-pglinter_1.1.2-1PIGSTY~bookworm_arm64.deb
postgresql-15-pglinter 1.1.2 d13.x86_64 pigsty 495.6 KiB postgresql-15-pglinter_1.1.2-1PIGSTY~trixie_amd64.deb
postgresql-15-pglinter 1.1.2 d13.aarch64 pigsty 365.0 KiB postgresql-15-pglinter_1.1.2-1PIGSTY~trixie_arm64.deb
postgresql-15-pglinter 1.1.2 u22.x86_64 pigsty 549.7 KiB postgresql-15-pglinter_1.1.2-1PIGSTY~jammy_amd64.deb
postgresql-15-pglinter 1.1.2 u22.aarch64 pigsty 424.4 KiB postgresql-15-pglinter_1.1.2-1PIGSTY~jammy_arm64.deb
postgresql-15-pglinter 1.1.2 u24.x86_64 pigsty 544.8 KiB postgresql-15-pglinter_1.1.2-1PIGSTY~noble_amd64.deb
postgresql-15-pglinter 1.1.2 u24.aarch64 pigsty 418.2 KiB postgresql-15-pglinter_1.1.2-1PIGSTY~noble_arm64.deb
Package Version OS ORG SIZE File URL
pglinter_14 1.1.2 el8.x86_64 pigsty 589.3 KiB pglinter_14-1.1.2-1PIGSTY.el8.x86_64.rpm
pglinter_14 1.1.2 el8.aarch64 pigsty 447.8 KiB pglinter_14-1.1.2-1PIGSTY.el8.aarch64.rpm
pglinter_14 1.1.2 el9.x86_64 pigsty 603.2 KiB pglinter_14-1.1.2-1PIGSTY.el9.x86_64.rpm
pglinter_14 1.1.2 el9.aarch64 pigsty 475.6 KiB pglinter_14-1.1.2-1PIGSTY.el9.aarch64.rpm
pglinter_14 1.1.2 el10.x86_64 pigsty 603.3 KiB pglinter_14-1.1.2-1PIGSTY.el10.x86_64.rpm
pglinter_14 1.1.2 el10.aarch64 pigsty 475.3 KiB pglinter_14-1.1.2-1PIGSTY.el10.aarch64.rpm
postgresql-14-pglinter 1.1.2 d12.x86_64 pigsty 497.8 KiB postgresql-14-pglinter_1.1.2-1PIGSTY~bookworm_amd64.deb
postgresql-14-pglinter 1.1.2 d12.aarch64 pigsty 363.8 KiB postgresql-14-pglinter_1.1.2-1PIGSTY~bookworm_arm64.deb
postgresql-14-pglinter 1.1.2 d13.x86_64 pigsty 497.5 KiB postgresql-14-pglinter_1.1.2-1PIGSTY~trixie_amd64.deb
postgresql-14-pglinter 1.1.2 d13.aarch64 pigsty 364.5 KiB postgresql-14-pglinter_1.1.2-1PIGSTY~trixie_arm64.deb
postgresql-14-pglinter 1.1.2 u22.x86_64 pigsty 550.9 KiB postgresql-14-pglinter_1.1.2-1PIGSTY~jammy_amd64.deb
postgresql-14-pglinter 1.1.2 u22.aarch64 pigsty 423.7 KiB postgresql-14-pglinter_1.1.2-1PIGSTY~jammy_arm64.deb
postgresql-14-pglinter 1.1.2 u24.x86_64 pigsty 546.1 KiB postgresql-14-pglinter_1.1.2-1PIGSTY~noble_amd64.deb
postgresql-14-pglinter 1.1.2 u24.aarch64 pigsty 417.7 KiB postgresql-14-pglinter_1.1.2-1PIGSTY~noble_arm64.deb

Source

pig build pkg pglinter;		# 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 pglinter;		# install via package name, for the active PG version

pig install pglinter -v 18;   # install for PG 18
pig install pglinter -v 17;   # install for PG 17
pig install pglinter -v 16;   # install for PG 16
pig install pglinter -v 15;   # install for PG 15
pig install pglinter -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION pglinter;

Usage

pglinter: PostgreSQL Linting and Analysis Extension

pglinter analyzes your database for potential issues, performance problems, and best practice violations. It outputs results in SARIF 2.1.0 format.

Run Checks

SELECT pglinter.check();                                -- Run all enabled rules
SELECT pglinter.check_rule('B001');                     -- Run a specific rule
SELECT pglinter.check('/path/to/results.sarif');        -- Save SARIF report to file
SELECT pglinter.check_rule('B001', '/path/to/b001.sarif');

Rule Management

SELECT pglinter.show_rules();                -- Show all rules and their status
SELECT pglinter.explain_rule('B001');        -- Get rule details and suggested fixes
SELECT pglinter.enable_rule('B001');         -- Enable a specific rule
SELECT pglinter.disable_rule('B001');        -- Disable a specific rule
SELECT pglinter.is_rule_enabled('B001');     -- Check if a rule is enabled
SELECT pglinter.enable_all_rules();
SELECT pglinter.disable_all_rules();

Rule Configuration

SELECT pglinter.update_rule_levels('B001', 30, 70);   -- Set warning/error thresholds
SELECT pglinter.get_rule_levels('B001');               -- Get current thresholds
SELECT pglinter.export_rules_to_yaml();                -- Export rules to YAML
SELECT pglinter.import_rules_from_yaml('yaml...');     -- Import rules from YAML

Available Rules

Base (B-series): B001 tables without PK, B002 redundant indexes, B003 missing FK indexes, B004 unused indexes, B005 uppercase names, B006 unused tables, B007 cross-schema FKs, B008 FK type mismatches, B009 shared trigger functions, B010 reserved keywords, B011 multiple owners per schema.

Cluster (C-series): C002 insecure pg_hba.conf entries, C003 MD5 password encryption.

Schema (S-series): S001 no default role grants, S002 env prefixes/suffixes, S003 unsecured public schema, S004 system role ownership, S005 multiple owners per schema.

Last updated on