Skip to content

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

Remove references to non-empty search path as they are now lint warnings (#25853)

Oliver Rice13d8514c3473
diff --git a/apps/docs/content/guides/auth/custom-claims-and-role-based-access-control-rbac.mdx b/apps/docs/content/guides/auth/custom-claims-and-role-based-access-control-rbac.mdx
index 96320316ae8..3ced8e24bb1 100644
--- a/apps/docs/content/guides/auth/custom-claims-and-role-based-access-control-rbac.mdx
+++ b/apps/docs/content/guides/auth/custom-claims-and-role-based-access-control-rbac.mdx
@@ -230,7 +230,7 @@ begin
return bind_permissions > 0;
end;
-$$ language plpgsql security definer set search_path = public;
+$$ language plpgsql security definer set search_path = '';
```
<Admonition type="note">
diff --git a/apps/docs/content/guides/auth/managing-user-data.mdx b/apps/docs/content/guides/auth/managing-user-data.mdx
index d161d2ccf54..bdd2b2c15ec 100644
--- a/apps/docs/content/guides/auth/managing-user-data.mdx
+++ b/apps/docs/content/guides/auth/managing-user-data.mdx
@@ -267,7 +267,7 @@ Example:
create function public.handle_new_user()
returns trigger
language plpgsql
-security definer set search_path = public
+security definer set search_path = ''
as $$
begin
insert into public.profiles (id, first_name, age)
diff --git a/apps/docs/content/guides/auth/row-level-security.mdx b/apps/docs/content/guides/auth/row-level-security.mdx
index 278c20dba7e..0501bcd6a47 100644
--- a/apps/docs/content/guides/auth/row-level-security.mdx
+++ b/apps/docs/content/guides/auth/row-level-security.mdx
@@ -257,11 +257,11 @@ create function private.get_teams_for_authenticated_user()
returns setof bigint
language sql
security definer
-set search_path = public
+set search_path = ''
stable
as $$
select team_id
- from members
+ from public.members
where user_id = auth.uid()
$$;
diff --git a/apps/docs/content/guides/database/functions.mdx b/apps/docs/content/guides/database/functions.mdx
index 6e7664054af..04ac0479626 100644
--- a/apps/docs/content/guides/database/functions.mdx
+++ b/apps/docs/content/guides/database/functions.mdx
@@ -356,7 +356,7 @@ Postgres allows you to specify whether you want the function to be executed as t
create function hello_world()
returns text
language plpgsql
-security definer set search_path = public
+security definer set search_path = ''
as $$
begin
select 'hello world';
diff --git a/apps/www/_blog/2022-08-24-building-a-realtime-trello-board-with-supabase-and-angular.mdx b/apps/www/_blog/2022-08-24-building-a-realtime-trello-board-with-supabase-and-angular.mdx
index fd3ada15d18..b7c1828f0f4 100644
--- a/apps/www/_blog/2022-08-24-building-a-realtime-trello-board-with-supabase-and-angular.mdx
+++ b/apps/www/_blog/2022-08-24-building-a-realtime-trello-board-with-supabase-and-angular.mdx
@@ -135,11 +135,11 @@ create or replace function get_boards_for_authenticated_user()
returns setof bigint
language sql
security definer
-set search_path = public
+set search_path = ''
stable
as $$
select board_id
- from user_boards
+ from public.user_boards
where user_id = auth.uid()
$$;
```
diff --git a/apps/www/_blog/2024-04-25-exploring-support-tooling.mdx b/apps/www/_blog/2024-04-25-exploring-support-tooling.mdx
index 100abe27084..7d9a90b12f6 100644
--- a/apps/www/_blog/2024-04-25-exploring-support-tooling.mdx
+++ b/apps/www/_blog/2024-04-25-exploring-support-tooling.mdx
@@ -212,7 +212,7 @@ CREATE OR REPLACE FUNCTION "public"."get_embedded_event_names"
("date_param" timestamp with time zone DEFAULT "now"())
RETURNS "jsonb"
LANGUAGE "plpgsql" SECURITY DEFINER
- SET "search_path" TO 'public', 'extensions', 'vault'
+ SET "search_path" TO ''
AS $$
DECLARE
target_date timestamp with time zone := COALESCE(date_param, now());
@@ -233,7 +233,7 @@ BEGIN
api_url := base_url || '&timeMin=' || time_min || '&timeMax=' || time_max;
- select "content"::jsonb into response from http_get(api_url);
+ select "content"::jsonb into response from extensions.http_get(api_url);
events := response->'items'; -- Remove the typecast to ::jsonb
SELECT ARRAY_AGG(event->>'summary')