[Storage RLS] the "name" variable is replaced by another table's "name" column #25992
Closed
2 tasks done
Labels
bug
Something isn't working
Bug report
Describe the bug
I'm building a image storage system, and I'm setting up a RLS. A user can only access images of a task if they have created the project containing the tasks.
My tables look like that:
My bucket looks like that:
My storage RLS
Here, I'm using
WHERE task.id::text = (storage.foldername(name))[1]
as I'm creating a subfolder for each task.The problem: when I create this RLS (either by applying a migration or using the studio), it gets rewritten. When I view it (or query directly pg_policies), the condition is changed to:
I look like some optimization step is thinking "table Tasks has a 'name' column, so this 'name' variable must be that".
To Reproduce
Expected behavior
Screenshots
System information
Additional context
The text was updated successfully, but these errors were encountered: