Permission issues when working on QA DB Branch - ERROR: 42501: must be owner of table objects.

Hello #help-and-questions - hope you can assist! 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 storage 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.
2 Replies
garyaustin
garyaustin4w ago
You can't enable RLS on the table with something like ALTER. You can add policies.
SagieGr
SagieGrOP4w ago
Thank you so much! It worked, removing the "ALTER TABLE storage.objects ENABLE ROW LEVEL SECURITY;" solved the issues... I can't believe it was so simple.

Did you find this page helpful?