realtime
realtime copied to clipboard
Postgres changes with jsonb filters
Bug report
- [x] I confirm this is a bug with Supabase, not with my own application.
- [x] I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
When using realtime postgres_changes, I noticed that filtering on jsonb columns doesn't work. I maybe have a bug somewhere but without the filter or with a filter on a regular text column works.
const channel = supabase
.channel(`queue:${organization.id}`)
.on(
"postgres_changes",
{
event: "*",
schema: "pgboss",
table: "job",
filter: `data->>organization_id=eq.${organization.id}`,
},
(payload) => {
console.log("queue/pgboss/job", payload);
}
)
.subscribe();
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Create a table with a jsonb column (and enable realtime/rls/etc on that table)
- Create realtime subscription for postgres_changes and target that table and filter on a jsonb field value you know is present.
- Make a change to the table
- See no changes are published
Expected behavior
I would expect the jsonb->>field=eq.value to work as it does with supabase-js or regular postgrest requests.
System information
- OS: macOS
- Version of supabase-js: 2.39.7
- Version of Node.js: 20