© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
10 replies
stevharve

path_tokens null on storage object insert trigger

BEGIN
  IF new.bucket_id != 'team-gallery' THEN
    RETURN null;
  END IF;
  INSERT INTO public.gallery
  (object_id, user_id, team_id)
  VALUES
  (new.id, new.owner, new.path_tokens[0]::uuid);

  RETURN new;
END;
BEGIN
  IF new.bucket_id != 'team-gallery' THEN
    RETURN null;
  END IF;
  INSERT INTO public.gallery
  (object_id, user_id, team_id)
  VALUES
  (new.id, new.owner, new.path_tokens[0]::uuid);

  RETURN new;
END;

While inserting the team_id into the gallery table from the new.path_tokens[0] team_id is null. The object that I am listening for an insert from is in a folder with the uuid of the team.
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

Trigger on Queue insert
SupabaseSSupabase / help-and-questions
5mo ago
Trigger edge function on insert
SupabaseSSupabase / help-and-questions
4y ago
`column path_tokens of relation objects already exists` on Storage
SupabaseSSupabase / help-and-questions
4y ago
Trigger storage delete on row delete
SupabaseSSupabase / help-and-questions
3y ago