Skip to content

postgres/squawk

Checks every migration for changes that lock or rewrite a table, or break the running application.

Part of the postgres configuration, at the recommended level. It runs at the commit stage, per file. It runs squawk.

A migration that takes an exclusive lock on a large table stops the application for as long as it runs.

Follow the advice squawk prints for the rule. Turn one rule off with gspot ignore postgres/squawk --rule <name> --reason "<why>".

A migration that adds a constraint with a full table scan reports a finding. Create the constraint first, and validate it in a separate migration.

Turn it off for some files, or one of its lint rules, with a reason:

gspot ignore postgres/squawk --paths "<glob>" --reason "<why>"
gspot ignore postgres/squawk --rule <rule> --reason "<why>"