Skip to content
Nightclerk

How to create a read-only Postgres user for a support tool

A support tool, an internal dashboard or an AI agent that answers customer questions has to read your database and must never change it. This guide sets that up in Postgres in four layers, with every statement ready to copy.

Published

On this page

What read-only has to cover

Create a dedicated role

Grant only what it should read

Make its transactions read-only

Set timeouts

Limit the rows it reads

The whole setup in one script

Test it as the role

What this does not cover

How Nightclerk handles this

Have the replies drafted for you.

Nightclerk drafts email replies from your codebase, database and docs, and waits for your approval before anything is sent. It is pre-release: add your email and you will get access when it opens.

We'll email you when access opens, and send product updates while you wait.By joining you agree to the Terms and Privacy Policy. Unsubscribe any time.