-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recent release breaks migrations that use 'create index concurrently' #2898
Comments
This might be due to a version bump to postgres from 15.1 to 15.6. Could you check the contents of |
I've only observed this in a github action so far + haven't attempted to reproduce elsewhere - any thoughts as to how I could validate that there? |
Ic, could you share the postgres version of your hosted project then? https://supabase.green/dashboard/project/_/settings/infrastructure This error is reported by the server afaik, so it's a bit strange that downgrading cli had any impact at all. Have you also tried to reproduce this locally with |
I'm not sure it has anything to do with a linked project, because it is a CI action that spins up a fresh supabase on the runner, runs the migrations, lints, tests, etc. I haven't experienced this issue against an actual project - it happened when supabase start applied an old migration to the fresh db. But for clarity, our staging and production dbs are on 15.1.1.44 Here is the github action:
|
I can confirm this started happening recently in our repos where we use the CLI and run the same kind of migration: ERROR: CREATE INDEX CONCURRENTLY cannot be executed within a pipeline (SQLSTATE 25001)
At statement 1: CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS Pinning CLI version to an older one ( |
This started happening to us today too. Only in CI is impacted. We are on Postgres |
I managed to reproduce this locally. The problem is with adding Since we are running each migration in its own transaction, I'd suggest moving create index statement to a separate file. For eg. supabase/supabase-action-example@397c630. You can see that db start passed with this change. After moving the create index statement, you can use the supabase migration repair --status applied 20241120053534 |
Hey @sweatybridge - do you have any more context on the underlying issue? In fixing our migrations, we've found an example where this breaks but the migration in question doesn't have any other statements related to the referenced table. Update: To keep it simple, we moved all instances of create index concurrently to a single new migration file (with nothing else in it), but this file now causes the error to occur. Update 2: Seems you cannot create multiple concurrent indexes in the same transaction now. Our solution was to remove Would love to get a clear view on the correct way to use |
Describe the bug
This occurred in a github action that uses the latest version of the CLI by default. Reverting to an older version (I picked 1.220.0 for no good reason) resolves the issue.
To Reproduce
Steps to reproduce the behavior:
CREATE INDEX CONCURRENTLY
Applying migration [redacted].sql... Stopping containers... ERROR: CREATE INDEX CONCURRENTLY cannot be executed within a pipeline (SQLSTATE 25001)
Expected behavior
Migration should run without fail.
System information
The text was updated successfully, but these errors were encountered: