Postgres 18 upgrade breaks drizzle-kit push not-null
https://www.postgresql.org/docs/current/release-18.html#RELEASE-18-CONSTRAINTS
tested with pg 17 and it works
I'm not sure what it is but the behavior of
NOT NULL
seems to be changed. drizzle-kit push
tries to drop the non-null constraint on a PK/FK even if explicit .notNull()
Results in this error error: column "foo" is in a primary key
PostgreSQL Documentation
E.1. Release 18
E.1. Release 18 # E.1.1. Overview E.1.2. Migration to Version 18 E.1.3. Changes E.1.4. Acknowledgments Release date: 2025-09-25 E.1.1. Overview # PostgreSQL 18 …
1 Reply
Would you mind creating a GitHub issue? I have observed this too, and there don't seem to be any mentions of PostgreSQL 18 on GitHub
I have a suspicion that this is due to this change in PostgreSQL 18, as drizzle-kit reads from pg_constraint:
Store column NOT NULL specifications in pg_constraint (Álvaro Herrera, Bernd Helmle)