Migrations fail to run: "CREATE INDEX CONCURRENTLY cannot be executed within a pipeline"

did:plc:a45enc3w2mwyupw4ctpqgoh6 opened this Mar 22, 2026 0 comments
did:plc:a45enc3w2mwyupw4ctpqgoh6 opened Mar 22, 2026

Issue

I tried cloning the project locally and setting up the project using the install instructions on the README, and running supabase start leads to the following error:

Applying migration 20260305100000_fix_profile_posts_performance.sql...
Stopping containers...
ERROR: CREATE INDEX CONCURRENTLY cannot be executed within a pipeline (SQLSTATE 25001)
At statement: 1
CREATE INDEX CONCURRENTLY IF NOT EXISTS document_mentions_in_bsky_document_idx
  ON public.document_mentions_in_bsky (document)

According to this issue from supabase/cli, it appears to have been an issue introduced in some version in v15, and in my testing, the issue persists when upgrading beyond that (I tested v17, I'm sure the same happens in v16)

Workarounds

  • As someone tested in the issue linked above, downgrading supabase-cli to v1.219.2 appeared to run the migrations just fine.
  • Removing the word CONCURRENTLY from all of the CREATE INDEX commands in 20260305100000_fix_profile_posts_performance.sql without downgrading supabase-cli also appeared to run the migrations successfully.

Expected Behavior

The expected behavior is that I can run supabase start, and npx supabase db reset without migrations failing.

From my brief bit of research, it seems you can just drop the word CONCURRENTLY from the migrations in the main branch without any issues, as CREATE INDEX has protections against deadlocks, so even if you are migrating your database while the program is running, CREATE INDEX will fail if it needs to, but won't break anything.

No activity yet.

cospan · schematic version control on atproto built on AT Protocol