© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
13 replies
Header

Supabase postgres function is not found on supabase js

Hi.

I have this function that when i use the rpc function of supabase returns me the following.

CREATE OR REPLACE FUNCTION close_advertisements (lat float, lng float)
    RETURNS SETOF public.advertisements
    LANGUAGE plpgsql
    AS $$
BEGIN
    RETURN query (
        SELECT
            *
        FROM
            advertisements
        WHERE
            ST_DWithin (geom, ST_SetSRID (ST_MakePoint (lng, lat), 4326), 10000));
END;
$$
SECURITY DEFINER SET search_path = extensions, public, pg_temp;

CREATE OR REPLACE FUNCTION close_advertisements (lat float, lng float)
    RETURNS SETOF public.advertisements
    LANGUAGE plpgsql
    AS $$
BEGIN
    RETURN query (
        SELECT
            *
        FROM
            advertisements
        WHERE
            ST_DWithin (geom, ST_SetSRID (ST_MakePoint (lng, lat), 4326), 10000));
END;
$$
SECURITY DEFINER SET search_path = extensions, public, pg_temp;


Error message:

"Could not find the public.close_advertisements() function or the public.close_advertisements function with a single unnamed json or jsonb parameter in the schema cache"

I added the security definer to try an make it visible but without success
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

postgres vs supabase-js
SupabaseSSupabase / help-and-questions
13mo ago
Cannot start local supabase, postgres image not found
SupabaseSSupabase / help-and-questions
8mo ago
function not found
SupabaseSSupabase / help-and-questions
3y ago
Supabase CLI not found on v2 RC
SupabaseSSupabase / help-and-questions
4y ago