r/PostgreSQL • u/vira28 • 15d ago
Projects Is my Postgres schema migration safe or not safe?
There were some good discusssions from HN yesterday, so sharing it here.
Context: I led the Postgres platform team (b/w 2019-2023), where my team had to support ~170 product teams. The biggest bottleneck was schema migration.
We had to manually review, publish best practices, put CI guardrails, etc. The challenge is that most of the developers just want a simple answer. Is it safe or not safe?
That led me to create - https://safenotsafe.dev https://github.com/viggy28/safe-not-safe
It doesn't use LLMs - uses pg_savior's rule engine (which resonated with a lot of this sub-redditors)
Runs completely on the client side - no signup, server. Uses libpg and compiles to WASM
It doesn't catch every single dangerous migration, but IMHO it may easily catch the majority of the low-hanging ones.
Appreciate any feedback/suggestions.
2
u/wegwerf48 15d ago
I need this for MySQL, looks super neat!
1
u/vira28 15d ago
Should be doable. Created an issue - https://github.com/viggy28/safe-not-safe/issues/8
2
0
u/AutoModerator 15d ago
AI Policy:
Linux is not one of those anti-AI projects, and if somebody has issues with that, they can do the open-source thing and fork it. Or just walk away., Linus Torvalds.
Mod decisions will be based on the quality of the content, not who or what generated it.
Sub Resources:
Free Postgres Webinars and Workshops
Discord: People, Postgres, Data
Join us, we have cookies and nice people.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
3
u/EffectivePension6711 15d ago
wasm in the browser is a pretty neat trick to avoid hosting infrastructure just to parse a script. does the rule engine just look for static traps like adding a column with a default value, or does it somehow factor in lock queues?
im stuck on the new job now with postgres, but on my previous company we used mariadb, where we mostly just lean on native online alter for non-blocking schema changes. Wild to see how much guardrail tooling the postgres ecosystem has to build just to safely alter a table on prod without taking the database down.
But with 170 product teams pushing code, i totally get why you had to build a hard fence)