© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3mo ago•
11 replies
ngiam

ERROR: 42501: must be owner of table objects

Tried to run the following in SQL Editor and i get the following error: Error: Failed to run sql query: ERROR: 42501: must be owner of table objects

I'm the only owner of the organization & project. What can I do to make this work?

Thank you!

-------------------------

-- Add _org_id computed column to storage.objects for org scoping
-- Date: 2025-11-11 (isolated migration)

-- Add the computed column if it doesn't exist
ALTER TABLE storage.objects
ADD COLUMN IF NOT EXISTS _org_id text GENERATED ALWAYS AS (split_part(name, '/', 2)) STORED;

-- Add index for faster queries on _org_id
CREATE INDEX IF NOT EXISTS idx_objects_org_id ON storage.objects (_org_id);

-- Ensure RLS is enabled on storage.objects
ALTER TABLE storage.objects ENABLE ROW LEVEL SECURITY;

-- Optional: Verify the change (this will log in the query output)
DO $$ BEGIN
RAISE NOTICE 'Added _org_id column and index to storage.objects';
END $$;
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

ERROR: must be owner of table objects
SupabaseSSupabase / help-and-questions
8mo ago
ERROR: 42501: must be owner of relation auth.users
SupabaseSSupabase / help-and-questions
4mo ago
must be owner of table
SupabaseSSupabase / help-and-questions
4mo ago
ERROR: must be owner of table "name"
SupabaseSSupabase / help-and-questions
3y ago