How to Configure TimescaleDB Grant Permissions
You set up timescaledb grant permissions by assigning standard PostgreSQL role rules to schemas and hypertables. You must also set default privileges so new time chunks inherit the right read or write access. Many teams take shortcuts during setup and give broad admin roles to developers and apps. This shortcut lets any user drop data chunks, change retention policies, or read sensitive rows. How timescaledb grant permissions work on hypertables TimescaleDB runs as an extension inside a Postg
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 timescaledb grant permissions by assigning standard PostgreSQL role rules to schemas and hypertables. You must also set default privileges so new time chunks inherit the right read or write access. Many teams take shortcuts during setup and give broad admin roles to developers and apps. This shortcut lets any user drop data chunks, change retention policies, or read sensitive rows.
How timescaledb grant permissions work on hypertables
TimescaleDB runs as an extension inside a PostgreSQL database engine. It uses the exact same role and privilege system as standard PostgreSQL. When you create a hypertable, the database splits your data into many smaller child tables. The system calls these child tables chunks and stores them in an internal schema.
When you grant read or write rules on the parent hypertable, those rules pass down. The database applies those same permissions to all existing and future data chunks. You do not need to assign rules to each individual chunk by hand. Still, you must grant usage on the schema that holds the parent hypertable first.
Without schema usage, a role cannot find or query the hypertable at all. Teams also set up default privileges at the schema level for new tables. This step makes sure that newly created hypertables by default grant access to the right team roles. You should create separate roles for apps that write metrics and analysts who read them.
Write roles only need insert permissions on the main hypertable to record new time series events. Read roles only need select permissions on the parent table and any continuous aggregate views. Background jobs, like data retention or compression, require table ownership or superuser access to run.
Managing permissions for continuous aggregates and views
Continuous aggregates are special views that precalculate time series data in the background. When you create a continuous aggregate, the database builds a materialization table behind the scenes. Granting select rules on the view lets users query the summarized data fast. You do not need to grant direct access to the internal backing tables.
Still, refreshing a continuous aggregate by hand requires extra permissions beyond basic read access. Only the table owner or a superuser can change the refresh policy of a view. If an analyst needs to run a manual refresh, they need elevated role privileges. Teams often solve this by sharing the owner role across multiple engineers.
AI Agent Permissions + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Sharing the owner role creates a big risk for your production time series data. Anyone with that shared role can drop the continuous aggregate or delete raw hypertable chunks. You lose the ability to see which person ran a destructive command in the logs.
Where native database roles fall short in production
Native database roles do a good job of separating read apps from write apps. They stop a basic reporting tool from deleting tables or changing schema structures. Still, static role permissions only check who logs in at the start of a session. They cannot inspect or filter what individual queries do once the session is active.
If an engineer has select access on a hypertable, they can read every single column. Native grants cannot rewrite sensitive fields like emails, phone numbers, card numbers, or national IDs. If your time series events include user metadata, every analyst sees the raw text. Column level grants exist, but they break queries that select all fields from a table.
Static roles also stay active twenty-four hours a day until an admin revokes them. When an engineer needs temporary write access to fix a broken data chunk, they get a permanent role. Nobody remembers to remove the grant after the fix is done. Over time, every user collects broad permissions that keeps the session active forever.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev sits inline in the wire protocol beside those services as an open-source proxy, a sidecar for your Postgres or API. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
Do I need to grant permissions on internal TimescaleDB chunk schemas?
No, you only need to grant permissions on the public schema and the parent hypertable. TimescaleDB passes those rules down to the internal chunk tables by default.
Why can a user with select permissions not see newly created hypertables?
Standard grants only apply to tables that exist at the moment you run the command. You must alter default privileges in the schema so future tables inherit the read rule.
Can standard read-only roles compress or drop old hypertable chunks?
No, running compression or dropping chunks requires ownership of the hypertable or superuser access. Standard read-only roles can only query the data inside the chunks.
Related guides
In this post