docs: Fix SQL queries in realtime documentation (#41519)

I'm relatively new to supabase, but in my current understanding the SQL
selects are inconsistent with the given example schema as the column is
named `room_topic` there.

## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

Yes.

## What kind of change does this PR introduce?

Updates documentation.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **Documentation**
* Corrected authorization policy examples in realtime guides to use
accurate column references for topic-based access control in Broadcast
and Presence features.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
This commit is contained in:
Thomas Hammerl
2026-03-05 17:05:45 +01:00
committed by GitHub
parent e3eb51f428
commit dfdfe279df

View File

@@ -133,7 +133,7 @@ exists (
rooms_users
where
user_id = (select auth.uid())
and topic = (select realtime.topic())
and room_topic = (select realtime.topic())
and realtime.messages.extension in ('broadcast')
)
);
@@ -266,7 +266,7 @@ with check (
rooms_users
where
user_id = (select auth.uid())
and topic = (select realtime.topic())
and room_topic = (select realtime.topic())
and realtime.messages.extension in ('broadcast')
)
);
@@ -293,7 +293,7 @@ using (
rooms_users
where
user_id = (select auth.uid())
and topic = (select realtime.topic())
and room_topic = (select realtime.topic())
and realtime.messages.extension in ('presence')
)
);
@@ -316,7 +316,7 @@ with check (
rooms_users
where
user_id = (select auth.uid())
and name = (select realtime.topic())
and room_topic = (select realtime.topic())
and realtime.messages.extension in ('presence')
)
);
@@ -343,7 +343,7 @@ using (
rooms_users
where
user_id = (select auth.uid())
and topic = (select realtime.topic())
and room_topic = (select realtime.topic())
and realtime.messages.extension in ('broadcast', 'presence')
)
);
@@ -366,7 +366,7 @@ with check (
rooms_users
where
user_id = (select auth.uid())
and name = (select realtime.topic())
and room_topic = (select realtime.topic())
and realtime.messages.extension in ('broadcast', 'presence')
)
);