Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrectly identifies true as volatile #390

Open
tyre opened this issue Nov 1, 2024 · 3 comments
Open

Incorrectly identifies true as volatile #390

tyre opened this issue Nov 1, 2024 · 3 comments
Labels

Comments

@tyre
Copy link

tyre commented Nov 1, 2024

backend/generated_sql/upgrade.sql:2:2: warning: adding-field-with-default

   2 | -- Running upgrade b9faaaa7c3f1 -> eb171722ab54
   3 | 
   4 | ALTER TABLE payer ADD COLUMN allows_concurrent_billing BOOLEAN DEFAULT true NOT NULL;

  note: Adding a field with a VOLATILE DEFAULT requires a table rewrite with an ACCESS EXCLUSIVE lock. In Postgres versions 11+, non-VOLATILE DEFAULTs can be added without a rewrite.
  help: Add the field as nullable, then set a default, backfill, and remove nullabilty.

I believe this is incorrect. The default is the boolean true, which is about as non-volatile as it gets.

Am I missing something?

@sbdchd sbdchd added the bug label Nov 1, 2024
@sbdchd
Copy link
Owner

sbdchd commented Nov 1, 2024

@sbdchd
Copy link
Owner

sbdchd commented Nov 1, 2024

are you passing in your Postgres version when running squawk?

@chdsbd
Copy link
Collaborator

chdsbd commented Nov 1, 2024

Passing in the PG version will fix the issue. In PG11 this is a violation. We should probably update the default Postgres version to be something newer than a 2018 version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants