citusdata / citusdata/citus

RLS Policies don't work if built on non-partitioned columns

Open
#7,182 2 comments 0 reactions 0 assignees View on GitHub
RLS
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

**Issue**
All of our current RLS policies are based on checking against a partitioned column, however we now want to limit results via an RLS policy based around a non partitioned column. The RLS and queries work as expected in a standard postgres setup as well as within citus across distributed tables should the shard key be the data piece the RLS is built around. But as we try to write the RLS policy around a timestamp column/value that cannot be a shard key or partitioned column the RLS policy is not respected and all results are returned. Is this a limitation of citus?

**Steps to Reproduce:**
Create within a citus environment with postgres a table with two columns.
Make one column a partitioned column and fill with dummy data.
Apply RLS policy and see the results are returned correctly.
Write a new RLS policy based around values found in the non partitioned columns.

Results returned do not respect the limitations of the RLS policy. There is no error or anything that signals anything is amiss.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.