Skip to content

Commit 0e861a2

Browse files
fix: correct the trigger function to make sense for the given example (supabase#41079)
--------- Co-authored-by: Chris Chinchilla <[email protected]>
1 parent b6b9b78 commit 0e861a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/docs/content/guides/realtime/subscribing-to-database-changes.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ language plpgsql
4141
as $$
4242
begin
4343
perform realtime.broadcast_changes(
44-
'topic:' || coalesce(NEW.topic, OLD.topic) ::text, -- topic - the topic to which we're broadcasting
44+
'topic:' || coalesce(NEW.id, OLD.id) ::text, -- topic - the topic to which you're broadcasting where you can use the topic id to build the topic name
4545
TG_OP, -- event - the event that triggered the function
4646
TG_OP, -- operation - the operation that triggered the function
4747
TG_TABLE_NAME, -- table - the table that caused the trigger

0 commit comments

Comments
 (0)