Postgres table access check
See which Neon or other Postgres tables are shared too widely.
Check my database- Customer table is open
- V.I.B.E reads your database rules
- Table rule is fixed
Checks
- Data API tables with row security switched off
- Data API rules open to anyone or to any signed-in account
- Public actions and views that skip row rules
- Saved actions with a loose search path
- Tables shared with every database login, where there is no data API
- Logins and owners that skip row rules
A data API with an open table
This made-up bookings table sits behind a data API, a web address that lets an app ask the database directly. Its lock is off, and signed-in accounts may read and change it, so anyone who makes an account reaches every row. In the corrected version the lock is on and a rule shows each person only their own bookings.
- Any signed-in user can read and change every row in “bookings”RLS disabled; authenticated may read, change
In one run, turn the lock on and add a rule for each thing your app does: read, add, change or delete. Anything without a rule stops working, saving included.
Checked again after the fix: none of these results come back.
A table every login can read
A made-up invoices table was shared with PUBLIC. The PostgreSQL manual says that word means all roles, including those created later, so a reporting login or a contractor’s account added next month could read it from the first day. The corrected version takes that share away.
- Every database login can read “invoices”invoices: PUBLIC may read
Remove the shared access. Give it only to the login your app uses.
Checked again after the fix: none of these results come back.
What happens when row security has no rule?
Row level security decides which rows a login may see or change. The manual says that when it is switched on and no policy exists, no rows are visible and none can be modified. Superusers and roles with the BYPASSRLS attribute always skip it. A table’s owner normally skips it too, unless the table is set to force it. An app that connects as the owner can therefore pass every test while its rules do nothing, which is why the result also looks at logins and owners.
Why do saved functions matter?
A function marked SECURITY DEFINER runs with the rights of the user who owns it. The manual notes that new functions can be run by PUBLIC by default, and suggests revoking that and granting only to those who need it. It also asks for a fixed search_path, the list of places a function looks for names, so that nobody can slip in a look-alike table. The result names public actions that skip row rules and saved actions with a loose path.
Can a view show more than the table allows?
By default a view applies the row rules of whoever owns the view, not those of the person asking. PostgreSQL offers a security_invoker setting that applies the asker’s rights instead. A view built over a locked table can therefore show what the table itself would refuse.
Using the Neon Data API?
Neon describes its Data API as an HTTP query service for apps and agents, and says every request is authorized by your PostgreSQL grants and row level security policies. It warns that a missing or wrong policy can expose a table to anyone who has the endpoint address. Treat each table the API reaches as a public door until a rule says otherwise.
How do you run the query?
Copy the query, open your database’s SQL editor, choose the branch and database your live app uses, run it, then copy the single result cell. It reads the system catalogs, which are the tables PostgreSQL keeps about itself, and your rows are not part of the result.
Change access one table at a time
Export your data first. Apply one suggested statement, run the query again, then sign in as two different people and open the screens that use that table. Never grant wider access just to make an error go away.
Sources, read 30 November 2026
- PostgreSQL: row security policiescurrent manual
- PostgreSQL: GRANTcurrent manual
- PostgreSQL: writing functions safelycurrent manual
- PostgreSQL: viewscurrent manual
- Neon: Data APIno date shown
V.I.B.E is made by TNAADO. It is not part of, or endorsed by, Neon or the PostgreSQL project.
Advanced app builds
TNAADO builds multiplatform products that take payments and protect sensitive data.
Start a project