On 2024-Jul-11, Ron Johnson wrote:

> Anyway, DROP is the easy part; it's ADD COLUMN that can take a lot of time
> (depending on whether or not you populate the column with a default value).

Actually, ADD COLUMN with a default does not rewrite the entire table
either, starting from pg11.

"Major enhancements in PostgreSQL 11 include:
[...]
* 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/11/release-11.html

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/


Reply via email to