The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
docs: add Realtime instruction for private schema
Wen Bo Xie84c8cb45d330
diff --git a/apps/reference/docs/guides/realtime/postgres-cdc.mdx b/apps/reference/docs/guides/realtime/postgres-cdc.mdxindex f8ca7c4728b..a4de56fb3e5 100644--- a/apps/reference/docs/guides/realtime/postgres-cdc.mdx+++ b/apps/reference/docs/guides/realtime/postgres-cdc.mdx@@ -10,8 +10,14 @@ Anyone with access to a valid JWT signed with the project's JWT secret is able tClients can choose to receive `INSERT`, `UPDATE`, `DELETE`, or `*` (all) changes for all changes in a schema, a table in a schema, or a column's value in a table. Your clients should only listen to tables in the `public` schema and you must first enable the tables you want your clients to listen to.+Postgres CDC works out of the box for tables in the `public` schema. You can listen to tables in your private schemas by granting table SELECT permissions to the database role found in your access token. You can run a query similar to the following:++```sql+GRANT SELECT ON "private_schema"."table" TO authenticated;+```+:::caution-Postgres CDC works out of the box for tables in the `public` schema. We do not yet recommend attempting to listen to tables in private schemas due to security concerns and additional permission requirements.+We strongly encourage you to enable RLS and create policies for tables in private schemas. Otherwise, any role you grant access to will have unfettered read access to the table.:::You can do this in the [Replication](https://app.supabase.com/project/_/database/replication) section in the Dashboard or with the [SQL editor](https://app.supabase.com/project/_/sql):