---
title: "Realtime Postgres RLS now available on Supabase"
description: "Supabase Realtime now enforces PostgreSQL Row Level Security on change broadcasts."
url: "https://swe.quest/articles/realtime-postgres-rls-now-available-on-supabase-037d74a22092b0d5"
canonical: "https://supabase.com/blog/realtime-row-level-security-in-postgresql"
source: "Supabase"
published: "2021-12-01"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 5
tags: ["postgres","realtime","identity-auth","replication","performance"]
---

# Realtime Postgres RLS now available on Supabase

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2021-12-01, 5 min read, Deep dive. Original: [https://supabase.com/blog/realtime-row-level-security-in-postgresql](https://supabase.com/blog/realtime-row-level-security-in-postgresql)

## Summary

Supabase Realtime now enforces PostgreSQL Row Level Security on change broadcasts. Previously every database change went to every client. A new in-database function, WALRUS, takes each logical replication record, finds active subscribers from a subscription table, assumes each subscriber's identity and checks visibility with a primary-key lookup. Prepared statements remove query planning cost, which is often 2-3x execution time for simple queries, and colocating the check in Postgres avoids network round trips. Per-record processing grows from about 11 ms with 1 subscriber to about 304 ms with 10,000. Recommendations: skip RLS on public tables, keep policies index-backed and join-free, and use small fixed-size primary keys.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Real-time systems](https://swe.quest/tags/realtime.md) (Backend & APIs)
- [Identity & auth](https://swe.quest/tags/identity-auth.md) (Security)
- [Replication](https://swe.quest/tags/replication.md) (Distributed systems)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- PostgreSQL Row Level Security ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- Postgres logical replication ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- WebSockets ([easy posts on Real-time systems](https://swe.quest/tags/realtime.md?difficulty=easy))

## Keywords

Supabase Realtime, WALRUS, Row Level Security, PostgreSQL logical replication, write-ahead log

## Related posts

- [Realtime: Broadcast from Database](https://swe.quest/articles/realtime-broadcast-from-database-42fdc3186500936d.md): Supabase · 2025-04-02 · Medium · 3 min read · Real-time systems, PostgreSQL, Replication
  Supabase Realtime's Broadcast from Database sends database change events to clients through Postgres triggers that write to a \`realtime.messages\` table.
- [Realtime or Pipelines? How to choose the right tool](https://swe.quest/articles/realtime-or-pipelines-how-to-choose-the-right-tool-61e0b980ce77be1d.md): Supabase · 2026-05-05 · Medium · 8 min read · PostgreSQL, Event-driven architecture, Real-time systems, Replication, Data pipelines
  Supabase Realtime and Supabase Pipelines both read Postgres changes via logical replication but serve different jobs.
- [Supabase Realtime: Broadcast and Presence Authorization](https://swe.quest/articles/supabase-realtime-broadcast-and-presence-authorization-db4d8e985aa735a7.md): Supabase · 2024-08-13 · Medium · 6 min read · Real-time systems, Identity & auth, PostgreSQL
  Supabase Realtime now supports authorization for Broadcast and Presence channels using Postgres Row Level Security policies on a managed \`realtime.messages\` table, where SELECT policies govern receiving and INSERT policies govern sending.
- [Supabase Security Retro: 2025](https://swe.quest/articles/supabase-security-retro-2025-91f5c4e25d9fa3d9.md): Supabase · 2026-01-07 · Easy · 7 min read · PostgreSQL, Security, Identity & auth
  Supabase's 2025 security work centered on safer defaults around Postgres Row Level Security and API exposure.
- [Postgres Changes gets AND filters, new operators, and column selection](https://swe.quest/articles/postgres-changes-gets-and-filters-new-operators-and-column-selection-74cc67b661b6c154.md): Supabase · 2026-08-05 · Medium · 3 min read · Real-time systems, PostgreSQL, API design
  Supabase Realtime's Postgres Changes subscriptions now support AND-composed filters across multiple columns, new operators (like, ilike, is, match/imatch for POSIX regex, isdistinct, and not. negation), a typed filter builder, and a select option that returns only chosen columns plus the primary key.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
