Restoring into Supabase: "must be owner of table"
ERROR: must be owner of table usersERROR: must be owner of table objectsYou restored a full pg_dump of a Supabase database into another Supabase project. The dump contains statements for the auth and storage schemas: ALTER TABLE, CREATE POLICY, ownership changes. In the target, those tables belong to roles Supabase manages, such as supabase_auth_admin and supabase_storage_admin, and the postgres role you connect as cannot change them.
With psql and its default settings the restore continues past these errors. With ON_ERROR_STOP or --single-transaction it stops at the first one. pg_restore keeps going and reports the count at the end.
Restore only your own schemas
The Supabase CLI dumps the parts that belong to you: roles, the schema of your own tables and the data. Supabase's backup and restore guide restores those three files into a new project with psql. The managed schemas stay as the new project created them.
With a pg_dump in custom format, restrict pg_restore to your schemas with --schema, or make a list with pg_restore --list, remove the entries for auth and storage, and restore with --use-list. The CLI guide shows both dumps.
Policies on the storage tables
Your own policies on storage.objects and storage.buckets live in the storage schema, so restricting to public skips them. A new project starts without them, and without a SELECT policy on storage.objects nobody can read their files, even though the rows and the files are there. Recreate those policies after the restore.
Event triggers and publications belong to no schema and are skipped by --schema as well. If your project uses them, add those entries to the restore list.
Auth users
The rows in auth.users are data, and the data dump from the CLI includes them. Copying them with a data-only restore works when the source and target run the same Auth version. The table structure itself stays as Supabase made it.
ReviveDB restores the database and Auth, Storage files and Edge Functions in one action, including your policies on the storage tables, and leaves the managed schemas alone. See how a restore works.