Cannot add a "user" column with RLS #32910
Unanswered
code3z
asked this question in
Feature Requests
Replies: 1 comment
|
I changed your category to feature request. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
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
userand had to be nameduser_id. I get that there's some postgres use for theUSERvariable, but I feel like there should be a better UX for when people make this mistake.All reactions