Skip to content

fix: ignore dropped columns when processing postgres changes - #2606

Open
mandar1045 wants to merge 7 commits into
supabase:mainfrom
mandar1045:fix/dropped-column-wal
Open

mandar1045 wants to merge 7 commits into
supabase:mainfrom
mandar1045:fix/dropped-column-wal

Conversation

@mandar1045

@mandar1045 mandar1045 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR

Fixes #2605.

One DROP COLUMN while changes are queued makes apply_rls check permissions on a column that no longer exists. The whole list_changes call fails, and because the slot is temporary it gets dropped on the error, so queued events from unrelated tables are lost too.

apply_rls now skips dropped columns in the new and old WAL records before processing them. Existing authorization checks stay the same. PostgreSQL 15 and 17 dumps regenerated.

Tests

  • 3 regression tests for INSERT, UPDATE and DELETE in replications_test.exs: fail before the fix, pass after.
  • Walrus test for the original repro: unrelated table still delivered, column privileges and RLS still applied, filter on the dropped column ignored.
  • All 48 walrus tests pass on PostgreSQL 15 and 17, from the dumps and from the migrations.
  • Dumps match mise run tenant-dumps output.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dropping a column can lose queued changes from unrelated tables

1 participant