Question about writing database functions in plpgsql. - Supabase