How to Configure Greenplum Row Level Security
You set up greenplum row level security by turning on table rules for specific database roles. These rules check each row before a user can read or write data. Most data teams start by building shared roles for analysts and apps. When these shared roles are too broad, users can read rows meant for other teams. A single bad query can expose private records across the whole warehouse. How greenplum row level security works Greenplum builds on Postgres rules to filter table data at query time. F
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You set up greenplum row level security by turning on table rules for specific database roles. These rules check each row before a user can read or write data. Most data teams start by building shared roles for analysts and apps. When these shared roles are too broad, users can read rows meant for other teams. A single bad query can expose private records across the whole warehouse.
How greenplum row level security works
Greenplum builds on Postgres rules to filter table data at query time. First, a database admin enables row filtering on a target table. Once you turn this on, the database blocks all rows by default. Next, the admin writes a rule that links a role to a row check. This check compares the logged-in role against a value inside the row.
When a user runs a read query, the database adds this filter by default. The user only gets rows that pass the rule check. You can also set separate rules for adding or changing rows. One rule checks which rows a role is allowed to see. Another rule checks new data before the database saves it to disk. Table owners and superusers bypass these rules unless the admin forces checks on owners too.
Planning roles and filter rules for data teams
Good row filtering starts with clear database roles and clean table design. Each table needs a column that marks who owns or uses that row. Teams often use a tenant ID, region code, or department name in that column. When an analyst logs in, the database reads their active role name. The rule then matches that role name to the tenant or region column.
Keep filter checks simple so you do not slow down large warehouse scans. Greenplum splits table data across many segment hosts to run queries in parallel. If a row rule runs a slow lookup on another table, every segment slows down. Sticking to direct column checks keeps parallel scans fast across all segment nodes. Teams should test each rule with a non-admin role before shipping it.
Row-Level Security + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native row rules solve and what they miss
Native row rules do a great job of splitting multi-tenant data inside one table. You do not have to copy data into separate tables for each team. They also stop analysts from reading rows outside their assigned region or group.
Still, database roles only check who logs in and which rows match the filter. They do not inspect what individual statements do in flight or mask columns inside allowed rows. If a user has permission to read a row, they get every column in it by default. That row might hold emails, phone numbers, card numbers, or national IDs. Also, apps and engineers often share a single service role to log in. When ten engineers share one role, row rules treat all ten users the same. You lose individual user tracking in your audit logs, and one mistake affects all allowed rows.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev sits inline in the protocol beside each supported service as an open-source proxy, a sidecar for your database or API. For every query or command an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human approval.
First, hoop.dev guardrails block banned queries before they run or hold risky ones for review, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Do table owners bypass greenplum row level security by default?
Yes, table owners and database superusers bypass row rules by default. Admins must apply an extra table setting if they want rules to restrict the owner.
Does row filtering hide sensitive columns inside an allowed row?
No, row rules only decide if a full row is returned or hidden. To protect emails, phone numbers, or card numbers inside a row, you need column masking.
How do shared app roles affect row level rules?
Shared roles make every person or app using that login look identical to the database. Every user on that shared role gets the exact same row permissions and audit trail.
Related guides
In this post