I need to drop a column from my (large) Postgres table. This is simple enough, but there is also an index on the column.
I can see that the index is implicitly dropped when I remove the column with ALTER TABLE, but I understand I should use CONCURRENTLY when dropping an index.
So my question is:
Is it appropriate to perform this operation as two queries. i.e.:
DROP INDEX CONCURRENTLY IF EXISTS myTable_myColumn_idx;
ALTER TABLE myTable DROP COLUMN IF EXISTS myColumn;
Or could that result in a race condition, where the alter table is executed while the index is still being dropped?