I would like to have some way of inspecting what locks a DDL operation will need to acquire.
Preferably something generic enough that I don't need to personally know/encode knowledge of all of the Postgres locking rules.
Something like EXPLAIN
but specific to DDL operations.
I don't want to run the command and then look at any locks that are blocking... I want to know in advance what locks the DDL operation will need to acquire (e.g. ACCESS EXCLUSIVE on tables x, y, z
), taking into account existing foreign key constraints etc.