Postgres version: 13.8
A week or so ago we ran a migration to safely drop a column on one of our tables. This column is not referenced by any other table and there was no index on the column. As far as I'm aware of, dropping a column acquires an exclusive lock on the table but only for a brief moment while it removes the column from the catalog. However this migration took around a minute to run and locked the table during the entire time. This table is heavily used and has around 17 million rows.
I've been trying to figure out why the drop column migration took a lot of time. This table also has a very commonly used SELECT FOR UPDATE
query ran against it. Would a row-level lock like this affect a drop column statement or am I looking down the wrong path?