Revolutionizing PostgreSQL Schema Changes with pg-osc
mydbops.com
mydbops.com
Disclaimer: I work at Xata, we maintain pgroll.
328 points by ksec 4 months ago | hide | past | favorite | 149 comments
On the smaller side, I can see this being useful to avoid migration bugs, but being its own migration tool isn't a great choice since ecosystem specific migration tools have a lot of useful options and can be used programmatically. I'd make a pgroll plugin for alembic and other common ecosystem specific feature-rich migration tools that hooks into the ddl emission to transform a "dumb" migration into your juiced up migrations. That'd make it an instant use for me.
Revolutionizing DB footguns is more like it
Same with adding a NOT NULL constraint without a default value. If there is a (constant) default value, then postgres can do that without blocking, which is pretty cool. That works because it only needs to modify metadata.
Same with changing column types, they need to go over the existing data.