© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4mo ago•
1 reply
Gaslit By Tech

Is there a need to put my migration within an transaction between `BEGIN;` / `COMMIT;` statements.

I ask as I do and that works fine when I just put 1 transaction though when I had a fairly large migration recently when testing locally I had 3 transactions and I did neglect to change it back to just 1. It was fine locally when starting supabase after an
supabase stop --no-backup
supabase stop --no-backup
though when we merged it in and deployed the 2nd and 3rd transactions were not applied.

It is not ideal that it behaves differently locally using supabase cli and when finally deploying! Or should I just not use any
BEGIN;
BEGIN;
/
COMMIT;
COMMIT;
statements in future at all so I don't make this mistake again.

Edit: added detail.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Transaction (Rollback & Commit)
SupabaseSSupabase / help-and-questions
4y ago
Is there an alternative to beforeSignIn?
SupabaseSSupabase / help-and-questions
4y ago
Migration missmatch between local and remote
SupabaseSSupabase / help-and-questions
4w ago
Is there an API to get a list of database backups?
SupabaseSSupabase / help-and-questions
14mo ago