3
Cannot add a "user" column with RLS
Source: supabase/supabase#32910 · opened by @code3z
I have a table where each row is connected to a user, and I thought the obvious name to name the user id column was "user"
Then I put in an RLS policy allowing users to edit their own data. At first it rejected the policy with some error that I couldn't understand, so I casted the user type to uuid and it worked. Then I got confusing errors like invalid input syntax for type uuid: "authenticated"
It took a while to figure out that the column could not be named user and had to be named user_id. I get that there's some postgres use for the USER variable, but I feel like there should be a better UX for when people make this mistake.
Then I put in an RLS policy allowing users to edit their own data. At first it rejected the policy with some error that I couldn't understand, so I casted the user type to uuid and it worked. Then I got confusing errors like invalid input syntax for type uuid: "authenticated"
It took a while to figure out that the column could not be named user and had to be named user_id. I get that there's some postgres use for the USER variable, but I feel like there should be a better UX for when people make this mistake.
No pledges yet. Be the first to back this.
Comments
Similar requests
Better protection against failing to protect tables with RLS
1 vote · 0 comments
Add Feature to Test + Debug Row Level Security Policies
47 votes · 0 comments
Default RLS Policies.
3 votes · 0 comments
Improve Column Name Copying and Visibility in Tables
1 vote · 0 comments
Move RLS verification into the policy editor, not beside it
1 vote · 0 comments
No comments yet.