© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago
keaton

Lock issues / deadlock during postgres migration

The
CREATE TABLE IF NOT EXISTS drizzle.__drizzle_migrations
CREATE TABLE IF NOT EXISTS drizzle.__drizzle_migrations
command that runs at the start of every drizzle migration creates a lock, and then my ALTER TABLE command inside the migration is unable to obtain the AccessExclusiveLock it requires.

Is there a way to run these in separate transactions? Or is there another approach to get around this?

Attached a pic of the db logs showing the lock, and my migration code. Using postgres-js
Logs-lock-beingheld.png
image.png
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Postgres: install plugin during migration
Drizzle TeamDTDrizzle Team / help
3y ago
Migration issues
Drizzle TeamDTDrizzle Team / help
2y ago
postgres-js migration configuration
Drizzle TeamDTDrizzle Team / help
3y ago
Migration and existing policy issues
Drizzle TeamDTDrizzle Team / help
2y ago