Thread: Assign Role based on Table Cell value
I have several users accessing PostgreSQL database managed through pgAdmin. The database consists of a table with several columns and rows. I want to grant permission to certain users to write/edit certain certain rows based on the value of a certain cell i.e., if cell value = x than user 123 has edit rights. From what I have understood, the Grant Wizard grants access to the entire table. Is there anyway be more granular in granting access/assigning roles?
Thanks
Hi,
pgAdmin 4 includes a Row Level Security (RLS) Policy (https://www.pgadmin.org/docs/pgadmin4/9.2/rls_policy_dialog.html#index-0) feature, which you can try—it may help resolve the issue.
On Thu, Apr 24, 2025 at 5:57 AM Æ • <hiwire03@yahoo.com> wrote:
I have several users accessing PostgreSQL database managed through pgAdmin. The database consists of a table with several columns and rows. I want to grant permission to certain users to write/edit certain certain rows based on the value of a certain cell i.e., if cell value = x than user 123 has edit rights. From what I have understood, the Grant Wizard grants access to the entire table. Is there anyway be more granular in granting access/assigning roles?Thanks
There is row-level security from PostgreSQL 9.5 onwards, see if that fits your needs.
On 4/24/25 02:26, Æ • wrote:
I have several users accessing PostgreSQL database managed through pgAdmin. The database consists of a table with several columns and rows. I want to grant permission to certain users to write/edit certain certain rows based on the value of a certain cell i.e., if cell value = x than user 123 has edit rights. From what I have understood, the Grant Wizard grants access to the entire table. Is there anyway be more granular in granting access/assigning roles?Thanks