How to Configure Neon Backup User

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a neon backup user by making a read-only database role. Then you grant this role select rights on all your schemas and tables. Many teams skip this step and use the default project owner role instead. That choice gives your export job full rights to change or drop tables. If a thief steals that key, they can wipe out your whole database. How to set up a neon backup user Neon runs on standard Postgres under the hood for all roles and rights. Your project starts with a default owner

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 neon backup user by making a read-only database role. Then you grant this role select rights on all your schemas and tables. Many teams skip this step and use the default project owner role instead. That choice gives your export job full rights to change or drop tables. If a thief steals that key, they can wipe out your whole database.

How to set up a neon backup user

Neon runs on standard Postgres under the hood for all roles and rights. Your project starts with a default owner role that holds very wide rights. You should not use this main role for daily automated data exports. Instead, you log in as the owner and create a fresh role. This new role needs a strong key and permission to log in.

Next, you give the role usage rights on each target schema. Then you grant select rights on all current tables and views. You must also set default privileges for any future tables your team makes. Without default rules, your export job will miss new tables created next week. Finally, you granting select rights on sequences lets the job read serial numbers.

Why branch snapshots are not a full backup plan

Neon splits compute nodes from storage in its cloud design. This setup lets you make quick database branches and restore from past points. Many teams rely on these storage branches for fast fixes after bad updates. Still, inside storage history does not replace an outside copy of your data. Rules and safety checks often need a separate copy stored in another cloud.

If someone deletes your main cloud project, your storage branches disappear too. An outside export job logs in with your neon backup user and pulls data. It saves a full file to a storage bucket you own and control. This method keeps your business safe even if your main account goes down. You get fast branch restores plus a safe copy stored far away.

User Provisioning (SCIM) + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native database roles solve and what they leave open

A dedicated read-only role stops your export script from altering live data. If a script has a bug, it cannot delete rows or drop tables. This simple step cuts down the risk of a broken automated job. It also stops attackers from changing records if they steal the backup key.

Still, native database roles only check who logs in at the start. Once the role logs in, it can read every single row and column. The database cannot tell a planned night dump from a stolen key attack. A leaked key lets anyone pull emails, phone numbers, and card numbers at will. Native roles also force you to put static keys inside your script runners. Rotating those keys takes manual work and can break your nightly jobs. Also, native logs do not easily tie shared role queries to one person. When someone uses the backup key on a laptop, you lose clear tracking.

Check every Postgres query on the wire

Database roles and network rules decide who can open a session. They do not read what each SQL statement does after login. With hoop.dev, you run an open-source proxy, a sidecar for your Postgres, inline in the Postgres wire protocol. 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 apps and agents keep their login details and change only the host and port in the connection string their tool uses.

Before a query runs, hoop.dev guardrails refuse bad deletes or drops with a real Postgres error, or hold risky queries for approval. On the way back, hoop.dev data masking rewrites sensitive values in returned rows in memory, and every verdict goes to the audit trail. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and generates evidence for HIPAA, GDPR, and PCI DSS. See the code on GitHub.

Frequently asked questions

Why did my backup job miss newly created tables?

Standard grant rules only cover tables that exist at that exact moment. You must alter the default privileges so the role can read future tables.

Can a neon backup user run logical data dumps without locking tables?

Yes, standard export tools can run consistent reads without blocking live app writes. The role still needs select rights on all target tables and sequences.

Should I use the default project owner role for automated backups?

No, the default owner role can drop tables and change database settings. Always use a separate read-only role to limit damage if a key leaks.

The query runs. The emails stay hidden.