Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

supabase db push fails with "must be owner of relation messages" (SQLSTATE 42501)

Closed
#6,116 1 comment 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@7ttp is already working on this.

Since Aug 8, 2026.

Assessment

This issue has not been assessed yet.

Description

🐛 Bug supabase/cli
Affected area

Migrations

Supabase CLI version

2.109.1

Operating system

macOS Sequoia (Apple Silicon)

Installation method

brew

Command
supabase db push
Actual output
Applying migration ...

ERROR: must be owner of relation messages
SQLSTATE: 42501

The migration aborts and no policy is created.

The exact same SQL succeeds when executed manually from the Supabase SQL Editor as the `postgres` role.
Expected behavior

The migration should execute successfully and create the RLS policy on realtime.messages, since the same SQL executes successfully from the Supabase SQL Editor as the postgres role and this workflow is documented for Realtime Authorization.

Steps to reproduce
  1. Create a Supabase Cloud project.
  2. Configure Realtime Authorization following the official documentation.
  3. Add a migration containing:

CREATE POLICY authorize_record_edit_presence
ON realtime.messages
FOR ALL
TO authenticated
USING (
realtime.topic() LIKE 'record_edit:%'
AND split_part(realtime.topic(), ':', 2)::uuid = fn_get_current_user_unit_id()
);

  1. Run:

supabase db push

  1. Observe:

ERROR: must be owner of relation messages
SQLSTATE 42501

  1. Execute the exact same SQL from the Supabase SQL Editor as the postgres role.

  2. The policy is created successfully.

Crash report ID

No response

Docker and service versions
Docker Desktop 29.6.2
Docker Engine 29.6.2
Go version go1.26.5
API version 1.55
Additional context

Additional investigation:

  • The SQL matches the official Realtime Authorization documentation.
  • The same SQL succeeds from the SQL Editor using the postgres role.
  • The failure only occurs when executed through supabase db push.
  • No ALTER OWNER, REASSIGN OWNED or manual ownership changes have been performed.
  • Current owners:
    • realtime.messages -> supabase_realtime_admin
    • realtime schema -> supabase_admin
  • Supabase Discussion:
    https://github.com/supabase/supabase/discussions/48812

A Supabase collaborator suggested opening this issue because the problem appears specific to the CLI migration execution.

Dominant language
TypeScript
Stars
2.4k
Forks
526
Avg merge
1d 2h
Merged PRs (30d)
321

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from supabase/cli

All issues in supabase/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.