Skip to content

realtime: on_postgres_changes without schema sends a binding the server rejects #1883

Closed

Description

@hsusul

Describe the bug

AsyncRealtimeChannel.on_postgres_changes() documents that schema defaults to "public", but when schema is omitted the join payload has no schema key at all. The Realtime server cannot parse such a binding, so the subscription fails.

PostgresChangesCallback.binding_filter (src/realtime/src/realtime/types.py) only adds schema when it is truthy:

binding: dict[str, Any] = {"event": self.event}
if self.schema:
    binding["schema"] = self.schema

On the server, Extensions.PostgresCdcRls.Subscriptions.parse_subscription_params/1 accepts schema + table + filter, schema + table, schema alone, or table alone. {"event": "*"} and {"event": "INSERT", "table": "todos", "filter": "id=eq.1"} match none of these and return No subscription params provided. Please provide at least a schema or table to subscribe to. The channel then gets an error instead of SUBSCRIBED, and none of its Postgres Changes bindings receive events.

Reproduction

channel = client.channel("todos")
channel.on_postgres_changes("*", callback=print)
# or: channel.on_postgres_changes("INSERT", callback=print, table="todos", filter="id=eq.1")
await channel.subscribe(lambda state, err: print(state, err))

The phx_join payload sent today:

"postgres_changes": [{"event": "*"}]

Expected, per the docstring:

"postgres_changes": [{"event": "*", "schema": "public"}]

Steps to reproduce

  1. Create a channel and call on_postgres_changes without schema, as above.
  2. Subscribe.
  3. The server rejects the Postgres Changes params and the subscription fails.

Library affected

realtime

Library version

realtime 2.33.0 (main at 954e486)

Python version

3.12

Activity

  1. added
    bug
    python
    realtime
    on Oct 29, 2026
  2. self-assigned this
    on Nov 2, 2026
  3. added a commit that references this issue on Nov 3, 2026
    a6e562d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugpythonrealtime

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions