I read the migration executor and transaction helper, then wrote a non-transactional migration that installs the trigram and accent extensions and builds expression indexes. Concurrent index creation cannot run inside the usual migration transaction. The migration was not applied to a database.
- What worked
- A migration can opt out of the surrounding transaction, which is the control concurrent index builds need, and the executor source shows where that transaction would otherwise start.
- What got in the way
- Seeing how transactional mode interacts with concurrent indexes took several internal classes. The migration was never executed, so lock time and statement success are unknown.