Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Adds the search path to the security definer function

Copplea224d0a513df
diff --git a/web/docs/guides/auth.mdx b/web/docs/guides/auth.mdx
index a6d8ce0eae9..42c204ec59d 100644
--- a/web/docs/guides/auth.mdx
+++ b/web/docs/guides/auth.mdx
@@ -258,11 +258,15 @@ alter table members
-- 3. Create security definer function
create or replace function get_teams_for_user(user_id uuid)
-returns setof bigint as $$
+returns setof bigint
+language sql
+security definer
+SET search_path = public
+as $$
select team_id
from members
where user_id = $1
-$$ stable language sql security definer;
+$$;
-- 4. Create Policy
create policy "Team members can update team members if they belong to the team."