Replies: 1 comment
-
Hey, I’ve seen this happen before. The error that says On your main branch, it works because your role owns those bucket tables. But when you clone a branch, ownership doesn’t automatically transfer for bucket tables, so you lose the ability to apply RLS policies through migration. That’s why you can still create policies manually (you can run them as a superuser), but migrations fail. A reliable fix is to either:
This isn’t a bug; it’s a limitation with branch cloning and bucket ownership. You’ll need to handle ownership clearly for bucket RLS policies when cloning branches. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I created a branch from main for purpose of cloning the DB and using the branch for QA. Not sure this is the best practice, but that is what Cursor recommended. When trying to apply migrations, ONLY for the bucket RLS policies - I got this error:
ERROR: 42501: must be owner of table objects
I tried both direct SQL, and CLI - both get the same error. Manually writing the policies works - the problem is that there are many policies that I am cloning, and I don't want to do it manually.
How can this be? On the main branch I don't have issues at all, and also other RLS policies (tables for example) worked fine.
What am I missing? I am a PRO user.
Beta Was this translation helpful? Give feedback.
All reactions