> How long did you wait? hours in the past. For recent happenings, I aborted after 10 mins.
Since it's a new table's creation, 'bbb' is empty. The 'alter table' never finished, so the lock was not released. aaa.id, bbb.topic_id are integers (id is auto-increament key)
That surely is a _long_ time for an empty table's ALTER.
"Note that using ALTER TABLE to add a constraint as well as using DROP TABLE or TRUNCATE to remove/recycle partitions are DDL commands that require exclusive locks. This will block both readers and writers to the table(s) and can also cause readers and writers to now interfere with each other. "
In your case ALTER TABLE would lock bbb, but not aaa; other sessions should still be able to read aaa.