Replies: 3 comments 3 replies
-
|
Summary of the Issue: Solutions: Recommended Alternative: Use Supabase Edge Functions or Client-side Logic Instead of a database trigger, use a Supabase Edge Function or your backend/frontend app to create a profile after user signup. Automate with Supabase Auth Hooks (if available) Supabase now supports “Auth Hooks” (beta/paid plans) for post-signup actions. On free tier, this may not be available, so fallback to client/server logic. Why Triggers Fail The error is expected: you don’t have ownership of and cannot disable RLS or grant roles. You cannot create triggers on [auth.users] in Supabase free tier due to platform restrictions. |
Beta Was this translation helpful? Give feedback.
-
|
You can indeed add triggers to auth.users using the SQL editor. |
Beta Was this translation helpful? Give feedback.
-
|
I was able to solve my problem thanks to the comments above and the links below. Thanks to everyone |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Hello Supabase Community,
I'm trying to automatically create a user profile in a public.profiles table whenever a new user signs up. The recommended way to do this is by using a database trigger on the auth.users table.
The Problem
However, when I try to create the trigger, I get the following error:
ERROR: 42501: must be owner of table usersThis indicates that the postgres role does not have ownership of the auth.users table.
What I've Already Tried
I've followed the standard workarounds for this issue, but they also fail with permission errors:
Attempting to disable RLS first:
SQL
ALTER TABLE auth.users DISABLE ROW LEVEL SECURITY;This fails with the same error: ERROR: 42501: must be owner of table users.
Attempting to grant admin privileges:
SQL
GRANT supabase_auth_admin TO postgres;This fails with a different error: ERROR: 42501: "supabase_auth_admin" role memberships are reserved, only superusers can grant them.
This suggests that the postgres role in my project is not a superuser and has non-standard, restricted permissions. As I am on the free plan, I cannot open a support ticket.
My Question
Is it possible that the permissions for the postgres role in my project (Ref: cxfweuxedwyxmouvjxis) are misconfigured?
Is there a way to reset the postgres role's permissions to the default state for a free-tier project?
Is there an alternative method to reliably create a user profile upon signup that does not require creating a trigger on auth.users?
Relevant Code
Here is the function and trigger I am trying to create:
SQL
-- The function to create a profile
-- The trigger that fails to be created
Any help or insight on how to resolve this permission issue would be greatly appreciated. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions