pglinter
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pglinter | 1.1.1 | ADMIN | PostgreSQL | Rust |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 5090 | pglinter | No | Yes | No | Yes | No | No | - |
| Related | amcheck supautils |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.1.1 | 1817161514 | pglinter | - |
| RPM | PIGSTY | 1.1.1 | 1817161514 | pglinter_$v | - |
| DEB | PIGSTY | 1.1.1 | 1817161514 | postgresql-$v-pglinter | - |
Build
You can build the RPM / DEB packages for pglinter using pig build:
pig build pkg pglinter # build RPM / DEB packages
Install
You can install pglinter 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 pglinter; # Install for current active PG version
pig ext install -y pglinter -v 18 # PG 18
pig ext install -y pglinter -v 17 # PG 17
pig ext install -y pglinter -v 16 # PG 16
pig ext install -y pglinter -v 15 # PG 15
pig ext install -y pglinter -v 14 # PG 14
dnf install -y pglinter_18 # PG 18
dnf install -y pglinter_17 # PG 17
dnf install -y pglinter_16 # PG 16
dnf install -y pglinter_15 # PG 15
dnf install -y pglinter_14 # PG 14
apt install -y postgresql-18-pglinter # PG 18
apt install -y postgresql-17-pglinter # PG 17
apt install -y postgresql-16-pglinter # PG 16
apt install -y postgresql-15-pglinter # PG 15
apt install -y postgresql-14-pglinter # PG 14
Create Extension:
CREATE EXTENSION pglinter;
Usage
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.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.