PgDesigner

PostgreSQL Schema Linter

75 rules catch structural errors, best-practice violations, and PostgreSQL antipatterns — before they reach production.

PgDesigner Check Diagram showing 34 lint issues — 0 errors, 23 warnings, 11 info with fix buttons on Northwind database in light theme

Why lint your schema?

A missing index on a foreign key slows every JOIN. A char(n) column wastes space. A serial instead of identity creates hidden sequences. These aren't bugs — they're design debt that compounds over time. PgDesigner checks for all of them automatically.

75 rules across three severity levels

32 Errors

Structural integrity — FK to missing table, duplicate names, PK column not found, unknown types, empty enums, multiple identity columns.

21 Warnings

Best practices — FK type mismatch, missing FK index, circular FK, no primary key, overlapping indexes, reserved words, PG version compatibility.

13 Info

Antipatterns — char(n) → text, serial → identity, money → numeric, json → jsonb, timestamp → timestamptz, text PKs, too many indexes.

15 rules with one-click autofix

Don't just find problems — fix them. PgDesigner can automatically resolve 15 common issues:

  • Missing FK index — creates a btree index on FK columns
  • No primary key — adds an identity integer PK column
  • Duplicate / overlapping indexes — drops the redundant one
  • char(n) → text, money → numeric, serial → identity, json → jsonb, timestamp → timestamptz, timetz → time
  • FK NO ACTION → RESTRICT, identity with default, generated with default, nullable PK column, duplicate FK

In the UI, click the fix button next to any fixable issue. In the CLI, run pgdesigner lint -fix schema.pgd to apply all fixes at once.

10x more rules than alternatives

ToolRulesScope
PgDesigner75Schema model validation
Squawk~20Migration SQL linting
pglinter6Live DB
schemalint4Live DB
Atlas3Schema-as-code

Squawk focuses on runtime migration hazards (locks, rewrites). PgDesigner validates the schema model — catching structural and design issues before any SQL is generated.

CLI — lint in your pipeline

pgdesigner lint schema.pgd
pgdesigner lint -f json schema.pgd
pgdesigner lint -s error schema.pgd
pgdesigner lint -fix schema.pgd

Exit code 1 if any errors are found — plug it into CI and block merges with broken schemas. Use -f json for machine-readable output, -s error to filter by severity.

UI — navigate and fix

Press Ctrl+L to open Check Diagram. Results are grouped by severity — click any issue to navigate to the problematic object. Autofix button appears next to fixable rules. You can ignore rules per table or globally in project settings.