Supabase Trigger Fails with 'invalid input syntax for type uuid' on User Sign-Up #31315
-
I’m using Supabase to handle user authentication and have a database trigger set up to populate the users table when a new user signs up. Here’s the setup: Supabase Sign-Up Code:
The id field is a valid UUID, and I’ve added a check to ensure it matches the UUID format before making the signUp call:
Trigger Function: I have a PostgreSQL trigger that inserts user data into the users table upon sign-up:
Error: When a user signs up, Supabase throws the following error:
My user's table id type is UUID. Does someone know why it's causing this error? Any help would be greatly appreciated Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Probably: |
Beta Was this translation helpful? Give feedback.
Probably:
(new.raw_user_meta_data->>'id')::uuid
Also you can log out your incoming values to the Postgres log with
raise log 'new = %',new;
.