What RLS policies to set for Supabase Queue Tables?
Hi! I’m setting up a Supabase and I’m referring to this docs: https://supabase.com/docs/guides/queues/quickstart#enable-rls-on-your-tables-in-pgmq-schemaSupabase . The docs mentions that I need to enable RLS on all queue tables (i.e., tables in the pgmq schema that begin with q_) if the Data API is enabled.
However, it doesn’t specify what RLS policies should be applied to these queue tables.
My situation:
• I’m using Clerk for authentication.
• For other tables in my database, I use the user_id column combined with the Supabase requesting_user_id() function to allow only rows where user_id matches the authenticated user’s ID.
• However, the queue tables created automatically by Supabase don’t have a user_id column, so I’m not sure how to set up RLS policies in this case.
I want to ensure that only authenticated users can interact with the queue. What RLS policies and SQL expressions should I use to achieve this?
Thank you!
However, it doesn’t specify what RLS policies should be applied to these queue tables.
My situation:
• I’m using Clerk for authentication.
• For other tables in my database, I use the user_id column combined with the Supabase requesting_user_id() function to allow only rows where user_id matches the authenticated user’s ID.
• However, the queue tables created automatically by Supabase don’t have a user_id column, so I’m not sure how to set up RLS policies in this case.
I want to ensure that only authenticated users can interact with the queue. What RLS policies and SQL expressions should I use to achieve this?
Thank you!
