▲ | PeterZaitsev a day ago | |||||||||||||||||||||||||
Should not we look for database to be able to do online, efficient non locking addition of column with any default value, not just NULL rather than application to have a complicated and fragile logic ? | ||||||||||||||||||||||||||
▲ | avg_dev a day ago | parent [-] | |||||||||||||||||||||||||
I believe PostgreSQL does this since v11, which was released in 2018: (current is v17) > Many other useful performance improvements, including the ability to avoid a table rewrite for ALTER TABLE ... ADD COLUMN with a non-null column default https://www.postgresql.org/docs/release/11.0/ I think there is some restriction there, like the default can't be "volatile" - I can't remember the precise definition here but I think current_timestamp would be volatile, but any static value would not. | ||||||||||||||||||||||||||
|