News for hackers. Stuff that matters.
Re:Pgroll: zero-downtime, undoable, schema migrations for Po... by menthe on Tuesday October 03, 2023 @01:38PM (#37755090)
Been reading the code.. very tidy. However the Complete step (e.g. in op_set_notnull.go) renames the temporary column name to the proper column name on the underlying table.. but while the docs describe the view on the new schema getting updated to refer to the now renamed underlying column, I do not seem to find the step where it happens? Also, shouldn't those two steps be in a transaction to ensure no failed queries? `createView` is only called once, on `Start`

Unless obviously the view has magic to use either column name based on what's available on the underlying, but I did not see that either.

Re:Pgroll: zero-downtime, undoable, schema migrations for Po... by surjection on Tuesday October 03, 2023 @02:00PM (#37755359)
There is no code to do this because it's actually a nice feature of postgres - if the underlying column is renamed, the pgroll views that depend on that column are updated automatically as part of the same transaction.
Re:Pgroll: zero-downtime, undoable, schema migrations for Po... by menthe on Tuesday October 03, 2023 @02:01PM (#37755373)
Very cool, thank you!