Troubleshooting·PostgreSQL
PostgreSQL Database, Schema and Table Privileges
Three separate refusals before a role can read one table: CONNECT on the database, USAGE on the schema, SELECT on the table. Each is a different message, and granting the wrong one leaves you exactly where you started.
Roles and Authentication Guide 19 of 47 Intermediate
- OSUbuntu 26.04 LTS
- PostgreSQL18.6-0ubuntu0.26.04.1
- Authscram-sha-256
- TimeAbout 16 min
PUBLIC holds CONNECT on every new database by default, which is why the first step revokes it - otherwise the database-level denial cannot be demonstrated.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| db-a01 | 192.168.0.81 | Ubuntu 26.04 LTS | Primary / Source / Replica Set Member 1 | 2 Core | 4 GB | 50 GB |
This guide includes
Use this when a role cannot read a table and you are unsure which grant is missing. This matters because there are three separate refusals on the way in - the database, the schema, then the table - and each names a different object.
- being refused at the database, before anything else happens
- granting CONNECT, and then being refused at the schema
- granting USAGE, and then being refused at the table itself
Before you start
- The
appdbdatabase with asalesschema.
-
Be refused at the database
-
Grant CONNECT, then be refused at the schema
-
Grant USAGE, then be refused at the table