pglinter
概览
| 扩展包名 | 版本 | 分类 | 许可证 | 语言 |
|---|---|---|---|---|
pglinter | 1.1.2 | ADMIN | PostgreSQL | Rust |
| ID | 扩展名 | Bin | Lib | Load | Create | Trust | Reloc | 模式 |
|---|---|---|---|---|---|---|---|---|
| 5090 | pglinter | 否 | 是 | 否 | 是 | 是 | 否 | - |
| 相关扩展 | amcheck supautils |
|---|
manually upgraded PGRX from 0.16.1 to 0.17.0 by Vonng
版本
| 类型 | 仓库 | 版本 | PG 大版本 | 包名 | 依赖 |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.1.2 | 1817161514 | pglinter | - |
| RPM | PIGSTY | 1.1.2 | 1817161514 | pglinter_$v | - |
| DEB | PIGSTY | 1.1.2 | 1817161514 | postgresql-$v-pglinter | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.1.2 el8.x86_64.pg18 : pglinter_18 pglinter_18-1.1.2-1PIGSTY.el8.x86_64.rpm
| PIGSTY 1.1.2 el8.x86_64.pg17 : pglinter_17 pglinter_17-1.1.2-1PIGSTY.el8.x86_64.rpm
| PIGSTY 1.1.2 el8.x86_64.pg16 : pglinter_16 pglinter_16-1.1.2-1PIGSTY.el8.x86_64.rpm
| PIGSTY 1.1.2 el8.x86_64.pg15 : pglinter_15 pglinter_15-1.1.2-1PIGSTY.el8.x86_64.rpm
| PIGSTY 1.1.2 el8.x86_64.pg14 : pglinter_14 pglinter_14-1.1.2-1PIGSTY.el8.x86_64.rpm
|
| el8.aarch64 | PIGSTY 1.1.2 el8.aarch64.pg18 : pglinter_18 pglinter_18-1.1.2-1PIGSTY.el8.aarch64.rpm
| PIGSTY 1.1.2 el8.aarch64.pg17 : pglinter_17 pglinter_17-1.1.2-1PIGSTY.el8.aarch64.rpm
| PIGSTY 1.1.2 el8.aarch64.pg16 : pglinter_16 pglinter_16-1.1.2-1PIGSTY.el8.aarch64.rpm
| PIGSTY 1.1.2 el8.aarch64.pg15 : pglinter_15 pglinter_15-1.1.2-1PIGSTY.el8.aarch64.rpm
| PIGSTY 1.1.2 el8.aarch64.pg14 : pglinter_14 pglinter_14-1.1.2-1PIGSTY.el8.aarch64.rpm
|
| el9.x86_64 | PIGSTY 1.1.2 el9.x86_64.pg18 : pglinter_18 pglinter_18-1.1.2-1PIGSTY.el9.x86_64.rpm
| PIGSTY 1.1.2 el9.x86_64.pg17 : pglinter_17 pglinter_17-1.1.2-1PIGSTY.el9.x86_64.rpm
| PIGSTY 1.1.2 el9.x86_64.pg16 : pglinter_16 pglinter_16-1.1.2-1PIGSTY.el9.x86_64.rpm
| PIGSTY 1.1.2 el9.x86_64.pg15 : pglinter_15 pglinter_15-1.1.2-1PIGSTY.el9.x86_64.rpm
| PIGSTY 1.1.2 el9.x86_64.pg14 : pglinter_14 pglinter_14-1.1.2-1PIGSTY.el9.x86_64.rpm
|
| el9.aarch64 | PIGSTY 1.1.2 el9.aarch64.pg18 : pglinter_18 pglinter_18-1.1.2-1PIGSTY.el9.aarch64.rpm
| PIGSTY 1.1.2 el9.aarch64.pg17 : pglinter_17 pglinter_17-1.1.2-1PIGSTY.el9.aarch64.rpm
| PIGSTY 1.1.2 el9.aarch64.pg16 : pglinter_16 pglinter_16-1.1.2-1PIGSTY.el9.aarch64.rpm
| PIGSTY 1.1.2 el9.aarch64.pg15 : pglinter_15 pglinter_15-1.1.2-1PIGSTY.el9.aarch64.rpm
| PIGSTY 1.1.2 el9.aarch64.pg14 : pglinter_14 pglinter_14-1.1.2-1PIGSTY.el9.aarch64.rpm
|
| el10.x86_64 | PIGSTY 1.1.2 el10.x86_64.pg18 : pglinter_18 pglinter_18-1.1.2-1PIGSTY.el10.x86_64.rpm
| PIGSTY 1.1.2 el10.x86_64.pg17 : pglinter_17 pglinter_17-1.1.2-1PIGSTY.el10.x86_64.rpm
| PIGSTY 1.1.2 el10.x86_64.pg16 : pglinter_16 pglinter_16-1.1.2-1PIGSTY.el10.x86_64.rpm
| PIGSTY 1.1.2 el10.x86_64.pg15 : pglinter_15 pglinter_15-1.1.2-1PIGSTY.el10.x86_64.rpm
| PIGSTY 1.1.2 el10.x86_64.pg14 : pglinter_14 pglinter_14-1.1.2-1PIGSTY.el10.x86_64.rpm
|
| el10.aarch64 | PIGSTY 1.1.2 el10.aarch64.pg18 : pglinter_18 pglinter_18-1.1.2-1PIGSTY.el10.aarch64.rpm
| PIGSTY 1.1.2 el10.aarch64.pg17 : pglinter_17 pglinter_17-1.1.2-1PIGSTY.el10.aarch64.rpm
| PIGSTY 1.1.2 el10.aarch64.pg16 : pglinter_16 pglinter_16-1.1.2-1PIGSTY.el10.aarch64.rpm
| PIGSTY 1.1.2 el10.aarch64.pg15 : pglinter_15 pglinter_15-1.1.2-1PIGSTY.el10.aarch64.rpm
| PIGSTY 1.1.2 el10.aarch64.pg14 : pglinter_14 pglinter_14-1.1.2-1PIGSTY.el10.aarch64.rpm
|
| d12.x86_64 | PIGSTY 1.1.2 d12.x86_64.pg18 : postgresql-18-pglinter postgresql-18-pglinter_1.1.2-1PIGSTY~bookworm_amd64.deb
| PIGSTY 1.1.2 d12.x86_64.pg17 : postgresql-17-pglinter postgresql-17-pglinter_1.1.2-1PIGSTY~bookworm_amd64.deb
| PIGSTY 1.1.2 d12.x86_64.pg16 : postgresql-16-pglinter postgresql-16-pglinter_1.1.2-1PIGSTY~bookworm_amd64.deb
| PIGSTY 1.1.2 d12.x86_64.pg15 : postgresql-15-pglinter postgresql-15-pglinter_1.1.2-1PIGSTY~bookworm_amd64.deb
| PIGSTY 1.1.2 d12.x86_64.pg14 : postgresql-14-pglinter postgresql-14-pglinter_1.1.2-1PIGSTY~bookworm_amd64.deb
|
| d12.aarch64 | PIGSTY 1.1.2 d12.aarch64.pg18 : postgresql-18-pglinter postgresql-18-pglinter_1.1.2-1PIGSTY~bookworm_arm64.deb
| PIGSTY 1.1.2 d12.aarch64.pg17 : postgresql-17-pglinter postgresql-17-pglinter_1.1.2-1PIGSTY~bookworm_arm64.deb
| PIGSTY 1.1.2 d12.aarch64.pg16 : postgresql-16-pglinter postgresql-16-pglinter_1.1.2-1PIGSTY~bookworm_arm64.deb
| PIGSTY 1.1.2 d12.aarch64.pg15 : postgresql-15-pglinter postgresql-15-pglinter_1.1.2-1PIGSTY~bookworm_arm64.deb
| PIGSTY 1.1.2 d12.aarch64.pg14 : postgresql-14-pglinter postgresql-14-pglinter_1.1.2-1PIGSTY~bookworm_arm64.deb
|
| d13.x86_64 | PIGSTY 1.1.2 d13.x86_64.pg18 : postgresql-18-pglinter postgresql-18-pglinter_1.1.2-1PIGSTY~trixie_amd64.deb
| PIGSTY 1.1.2 d13.x86_64.pg17 : postgresql-17-pglinter postgresql-17-pglinter_1.1.2-1PIGSTY~trixie_amd64.deb
| PIGSTY 1.1.2 d13.x86_64.pg16 : postgresql-16-pglinter postgresql-16-pglinter_1.1.2-1PIGSTY~trixie_amd64.deb
| PIGSTY 1.1.2 d13.x86_64.pg15 : postgresql-15-pglinter postgresql-15-pglinter_1.1.2-1PIGSTY~trixie_amd64.deb
| PIGSTY 1.1.2 d13.x86_64.pg14 : postgresql-14-pglinter postgresql-14-pglinter_1.1.2-1PIGSTY~trixie_amd64.deb
|
| d13.aarch64 | PIGSTY 1.1.2 d13.aarch64.pg18 : postgresql-18-pglinter postgresql-18-pglinter_1.1.2-1PIGSTY~trixie_arm64.deb
| PIGSTY 1.1.2 d13.aarch64.pg17 : postgresql-17-pglinter postgresql-17-pglinter_1.1.2-1PIGSTY~trixie_arm64.deb
| PIGSTY 1.1.2 d13.aarch64.pg16 : postgresql-16-pglinter postgresql-16-pglinter_1.1.2-1PIGSTY~trixie_arm64.deb
| PIGSTY 1.1.2 d13.aarch64.pg15 : postgresql-15-pglinter postgresql-15-pglinter_1.1.2-1PIGSTY~trixie_arm64.deb
| PIGSTY 1.1.2 d13.aarch64.pg14 : postgresql-14-pglinter postgresql-14-pglinter_1.1.2-1PIGSTY~trixie_arm64.deb
|
| u22.x86_64 | PIGSTY 1.1.2 u22.x86_64.pg18 : postgresql-18-pglinter postgresql-18-pglinter_1.1.2-1PIGSTY~jammy_amd64.deb
| PIGSTY 1.1.2 u22.x86_64.pg17 : postgresql-17-pglinter postgresql-17-pglinter_1.1.2-1PIGSTY~jammy_amd64.deb
| PIGSTY 1.1.2 u22.x86_64.pg16 : postgresql-16-pglinter postgresql-16-pglinter_1.1.2-1PIGSTY~jammy_amd64.deb
| PIGSTY 1.1.2 u22.x86_64.pg15 : postgresql-15-pglinter postgresql-15-pglinter_1.1.2-1PIGSTY~jammy_amd64.deb
| PIGSTY 1.1.2 u22.x86_64.pg14 : postgresql-14-pglinter postgresql-14-pglinter_1.1.2-1PIGSTY~jammy_amd64.deb
|
| u22.aarch64 | PIGSTY 1.1.2 u22.aarch64.pg18 : postgresql-18-pglinter postgresql-18-pglinter_1.1.2-1PIGSTY~jammy_arm64.deb
| PIGSTY 1.1.2 u22.aarch64.pg17 : postgresql-17-pglinter postgresql-17-pglinter_1.1.2-1PIGSTY~jammy_arm64.deb
| PIGSTY 1.1.2 u22.aarch64.pg16 : postgresql-16-pglinter postgresql-16-pglinter_1.1.2-1PIGSTY~jammy_arm64.deb
| PIGSTY 1.1.2 u22.aarch64.pg15 : postgresql-15-pglinter postgresql-15-pglinter_1.1.2-1PIGSTY~jammy_arm64.deb
| PIGSTY 1.1.2 u22.aarch64.pg14 : postgresql-14-pglinter postgresql-14-pglinter_1.1.2-1PIGSTY~jammy_arm64.deb
|
| u24.x86_64 | PIGSTY 1.1.2 u24.x86_64.pg18 : postgresql-18-pglinter postgresql-18-pglinter_1.1.2-1PIGSTY~noble_amd64.deb
| PIGSTY 1.1.2 u24.x86_64.pg17 : postgresql-17-pglinter postgresql-17-pglinter_1.1.2-1PIGSTY~noble_amd64.deb
| PIGSTY 1.1.2 u24.x86_64.pg16 : postgresql-16-pglinter postgresql-16-pglinter_1.1.2-1PIGSTY~noble_amd64.deb
| PIGSTY 1.1.2 u24.x86_64.pg15 : postgresql-15-pglinter postgresql-15-pglinter_1.1.2-1PIGSTY~noble_amd64.deb
| PIGSTY 1.1.2 u24.x86_64.pg14 : postgresql-14-pglinter postgresql-14-pglinter_1.1.2-1PIGSTY~noble_amd64.deb
|
| u24.aarch64 | PIGSTY 1.1.2 u24.aarch64.pg18 : postgresql-18-pglinter postgresql-18-pglinter_1.1.2-1PIGSTY~noble_arm64.deb
| PIGSTY 1.1.2 u24.aarch64.pg17 : postgresql-17-pglinter postgresql-17-pglinter_1.1.2-1PIGSTY~noble_arm64.deb
| PIGSTY 1.1.2 u24.aarch64.pg16 : postgresql-16-pglinter postgresql-16-pglinter_1.1.2-1PIGSTY~noble_arm64.deb
| PIGSTY 1.1.2 u24.aarch64.pg15 : postgresql-15-pglinter postgresql-15-pglinter_1.1.2-1PIGSTY~noble_arm64.deb
| PIGSTY 1.1.2 u24.aarch64.pg14 : postgresql-14-pglinter postgresql-14-pglinter_1.1.2-1PIGSTY~noble_arm64.deb
|
| u26.x86_64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| u26.aarch64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
构建
您可以使用 pig build 命令构建 pglinter 扩展的 RPM / DEB 包:
pig build pkg pglinter # 构建 RPM / DEB 包
安装
您可以直接安装 pglinter 扩展包的预置二进制包,首先确保 PGDG 和 PIGSTY 仓库已经添加并启用:
pig repo add pgsql -u # 添加仓库并更新缓存
使用 pig 或者是 apt/yum/dnf 安装扩展:
pig install pglinter; # 当前活跃 PG 版本安装
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 pglinter;
用法
来源:README, 1.1.2 release
pglinter 会分析数据库中的潜在问题、性能隐患和最佳实践违规项,并以 SARIF 2.1.0 格式输出结果。
运行检查
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');
规则管理
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();
规则配置
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
规则家族
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.
版本增量
1.1.2 release 新增了规则 B013,用于检测缺少 WHERE 子句的逐行处理触发器。README 还没有更新到这条规则,因此这里应以 release note 作为相对 1.1.1 的权威增量说明。