How to Configure TimescaleDB Read Only User
You set up a timescaledb read only user by assigning select rights on schemas and hypertables. You also must set default privileges so the role can read new time-series chunks. Many teams skip this setup and share a single admin account for quick debugging. Broad roles let one bad query change or drop vital production time-series data. How a timescaledb read only user works in practice TimescaleDB runs on PostgreSQL and uses the same role system to manage access. First, an admin creates a rol
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 a timescaledb read only user by assigning select rights on schemas and hypertables. You also must set default privileges so the role can read new time-series chunks. Many teams skip this setup and share a single admin account for quick debugging. Broad roles let one bad query change or drop vital production time-series data.
How a timescaledb read only user works in practice
TimescaleDB runs on PostgreSQL and uses the same role system to manage access. First, an admin creates a role that can log in with a password. Next, the admin grants usage rights on the target database and its schemas. Then, the admin grants select rights on all existing tables and views.
Time-series workloads add an extra step because hypertables split data into many small chunks. As time moves forward, the database creates new chunks in internal schemas. A basic role setup only covers tables that exist at that exact moment. You must alter default privileges so the user can read future chunks too. Some teams use built-in read roles in newer database versions to save time. This step ensures dashboards and analysts can read new metrics without permission errors.
How to handle compressed chunks and continuous aggregates
TimescaleDB uses background jobs to compress old chunks and refresh summary views. A read role needs select rights on the views that store these rollups. Without access to the backing tables, queries on summary views will fail. Admins must check that default rules apply to the role that owns the views.
Database upgrades or schema changes can also add new tables outside the main schema. Teams often group read permissions into a shared group role to keep things clean. Individual users then join that group role when they need to check data. When someone leaves the team, you remove their account and keep the group role.
Read-Only Root Filesystem + User Provisioning (SCIM): architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native database roles solve and what they miss
A read role stops users from running insert, update, or delete commands. It protects your time-series data from accidental edits during a late-night check. It also blocks apps and reporting tools from dropping tables or changing schemas. This setup is a strong first step for basic database safety.
Still, native database roles only check who logs in and which tables they touch. Once a user logs in, they can read every column in those allowed tables by default. If a table holds emails, phone numbers, or card numbers, the query returns them. Standard select rights do not rewrite matched fields in results to hide private data. A static password can also leak in chat logs or local text files. Native roles also lack a clear audit trail that ties queries to team identities. Finally, a read role cannot block a massive query that slows down the whole database.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits inline in the protocol beside the service as an open-source proxy, a sidecar for your database or API. On every production query an agent or human runs, hoop.dev decides whether to pass, mask, block, or escalate it for review.
Before a query runs, hoop.dev guardrails check the statement against your rules, an AI Analyzer you configure can score intent or hold risky calls for human approval, and hoop.dev data masking rewrites sensitive fields in responses in memory. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Why does my read user fail on new hypertable data?
TimescaleDB creates new child tables as fresh time-series data arrives. You must set default select rules for future tables in your schemas.
Can a read role still hurt database performance?
Yes, a user with select rights can run heavy scans across years of data. You should set a query timeout on the role to stop long runs.
Does a read role hide sensitive user columns?
No, table select rights let the user read every column in that table by default. To limit columns, you must grant rights per column or use a separate view.
Related guides
In this post