Supabase Table Editor
public.changelog
Role: postgres
Product Changelog
Latest updates and improvements
CHANNEL_INITIALIZED
system
{"status": "SUBSCRIBED", "topic": "realtime:public:changelog", "filter": "event=INSERT"}
PostgreSQL Logical Replication & Realtime DDL
Run this migration in your Supabase SQL Editor to enable zero-redeployment real-time broadcasts on the changelog table.
-- 1. Create the changelog table
CREATE TABLE IF NOT EXISTS public.changelog (
id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
title TEXT NOT NULL,
description TEXT NOT NULL,
type TEXT NOT NULL CHECK (type IN ('feature', 'improvement', 'bugfix', 'announcement')),
created_at TIMESTAMPTZ NOT NULL DEFAULT timezone('utc'::text, now()),
tags TEXT[] NOT NULL DEFAULT '{}'
);
-- 2. Performance indexes
CREATE INDEX IF NOT EXISTS idx_changelog_created_at ON public.changelog (created_at DESC);
CREATE INDEX IF NOT EXISTS idx_changelog_type ON public.changelog (type);
-- 3. Enable Logical Replication for Supabase Realtime
ALTER TABLE public.changelog REPLICA IDENTITY FULL;
ALTER PUBLICATION supabase_realtime ADD TABLE public.changelog;
-- 4. Enable Row Level Security (RLS)
ALTER TABLE public.changelog ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Public Read Access"
ON public.changelog FOR SELECT USING (true);
CREATE POLICY "Authorized Insert Access"
ON public.changelog FOR INSERT WITH CHECK (true);
๐ก Key Concept: Why ALTER PUBLICATION supabase_realtime is Essential
By default, PostgreSQL does not publish WAL stream events to external replication slots for all tables. Adding a table to supabase_realtime instructs the Postgres publication to emit row mutations to the Supabase Realtime daemon. The client then listens via supabase.channel('...').on('postgres_changes', { event: 'INSERT', table: 'changelog' }, callback).subscribe().