CertGrid CertGrid
Hands-on Lab·PostgreSQL

PostgreSQL Default Privileges and Role Membership

A grant covers the tables that exist when you make it, and nothing created afterwards. `ALTER DEFAULT PRIVILEGES` fixes the future; a group role fixes the past - and you usually need both.

Roles and Authentication Guide 20 of 47 Advanced

Written against the versions above. Default privileges are recorded per granting role and per schema. A table created by a **different** role is not covered, which is the commonest reason they appear not to work.

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

Before you start

  1. Create a new table and watch the grant not cover it

  2. Grant for the future

  3. Fix the past with a group role

Official sources