© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•14mo ago•
2 replies
brysonbarney

Supabase RPC in Custom Schema

I’m trying to call an RPC function (get_new_customers_this_month) in a custom schema using the Supabase Python client. I’ve added the Content-Profile header for the schema, but I keep getting this error:

{
"code": "PGRST202",
"message": "Could not find the function public.get_new_customers_this_month without parameters in the schema cache."
}

The same function works fine in the public schema. Here’s the route code I’m using:

@router.get("/new_customers_this_month")
async def get_new_customers_this_month(user=Depends(get_current_user)):
try:
supabase = get_custom_schema_client(user["token"])
response = supabase.rpc("get_new_customers_this_month").execute()
return {"new_customers_this_month": response.data}
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))

And the client setup:

def get_custom_schema_client(user_jwt: str):
options = ClientOptions(
headers={
"Authorization": f"Bearer {user_jwt}",
"Content-Profile": "rinse"
}
)
return create_client(SUPABASE_URL, SUPABASE_ANON_KEY, options=options)

What am I missing to get this working with a custom schema?
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

.rpc() with python supabase-client
SupabaseSSupabase / help-and-questions
4y ago
Custom info in supabase sessions
SupabaseSSupabase / help-and-questions
14mo ago
Supabase Managing 'etl' schema
SupabaseSSupabase / help-and-questions
3mo ago
Prisma and Supabase Schema
SupabaseSSupabase / help-and-questions
3y ago