© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•8mo ago•
20 replies
Dahaar

Realtime Postgres changes trigger multiple times

The docs show an example for how to set up different callbacks for different tables when setting up realtime postgres events with the Python client.
changes = supabase.channel('db-changes').on_postgres_changes(  
  "*",
  schema="public",
  table="messages"
  callback=lambda payload: print(payload)
).on_postgres_changes(
  "INSERT",
  schema="public",
  table="users",
  callback=lambda payload: print(payload)
).subscribe()
changes = supabase.channel('db-changes').on_postgres_changes(  
  "*",
  schema="public",
  table="messages"
  callback=lambda payload: print(payload)
).on_postgres_changes(
  "INSERT",
  schema="public",
  table="users",
  callback=lambda payload: print(payload)
).subscribe()


But when changes come in, it actually triggers the callback for the right table multiple times, one time for each other handler that was registered on the channel. So in this example with two handlers, any update on the
messages
messages
table would print the event two times.

Any ideas on how to prevent this or why that could be the case?
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

Realtime Postgres Changes vs Broadcast
SupabaseSSupabase / help-and-questions
11mo ago
Supabase Realtime Postgres Changes doesn't trigger on "lost" data
SupabaseSSupabase / help-and-questions
8mo ago
timescalesdb realtime
SupabaseSSupabase / help-and-questions
3y ago
Realtime postgres_changes not working in production
SupabaseSSupabase / help-and-questions
8mo ago