PGRST202 error with queues: public.pgmq_public.send not found in schema cache

I'm trying to use queues, but I keep getting this error:
{
  code: "PGRST202",
  details: "Searched for the function public.pgmq_public.send with parameters message, queue_name, sleep_seconds or with a single unnamed json/jsonb parameter, but no matches were found in the schema cache.",
  hint: null,
  message: "Could not find the function public.pgmq_public.send(message, queue_name, sleep_seconds) in the schema cache"
}


This is some example code:
const { error } = await supabase
    .rpc('pgmq_public.send', {
        queue_name: 'scrape_skool_groups',
        message: { test: 'test' },
        sleep_seconds: 0
    });

if (error) {
    console.error(`Failed to enqueue group processing for ${groupName}:`, error);
}

When running this SQL I get a hit back.
SELECT n.nspname, proname 
FROM pg_proc p 
JOIN pg_namespace n 
ON p.pronamespace = n.oid 
WHERE n.nspname = 'pgmq_public' AND proname = 'send';


I have exposed the queue via postgress, have allowed all permissions to postgress adn service_role and I implemented the following RLS
alter policy "service_role_insert_queue"
on "pgmq"."q_scrape_skool_groups"
to public
with check (true);


Any idea as to how I could resolve this issue?
Was this page helpful?