Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres changes with jsonb filters #1090

Open
2 tasks done
fvaldes33 opened this issue Jul 10, 2024 · 0 comments
Open
2 tasks done

Postgres changes with jsonb filters #1090

fvaldes33 opened this issue Jul 10, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@fvaldes33
Copy link

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • 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:

  1. Create a table with a jsonb column (and enable realtime/rls/etc on that table)
  2. Create realtime subscription for postgres_changes and target that table and filter on a jsonb field value you know is present.
  3. Make a change to the table
  4. 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
@fvaldes33 fvaldes33 added the bug Something isn't working label Jul 10, 2024
@w3b6x9 w3b6x9 added enhancement New feature or request and removed bug Something isn't working labels Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants