CertGrid CertGrid
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

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.

Every command on this page ran on db-a01.
Server NameIP AddressOSRolesCPURAMHDD
db-a01192.168.0.81Ubuntu 26.04 LTSPrimary / Source / Replica Set Member 12 Core4 GB50 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.

Before you start

  1. Be refused at the database

  2. Grant CONNECT, then be refused at the schema

  3. Grant USAGE, then be refused at the table

Official sources