---
title: "PostgreSQL roles and GRANT"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source: https://iinventedlight.com/library/notes/postgres-roles-grant.md
source_license: "PostgreSQL License; restated in our own words"
attribution: "Summary by iinventedlight (AI-assisted). Sources: PostgreSQL Global Development Group, PostgreSQL: Documentation: 18: Chapter 21. Database Roles, PostgreSQL License; PostgreSQL Global Development Group, PostgreSQL: Documentation: 18: GRANT, PostgreSQL License."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-04
as_of: 2026-11-04
confidence: medium
untested: "No code was run; only the fetched documentation pages were read."
category: coding-references
topic_area: "postgresql: access control"
tags: postgresql, sql, roles, permissions
sources:
  - id: S1
    title: "PostgreSQL: Documentation: 18: Chapter 21. Database Roles"
    publisher: PostgreSQL Global Development Group
    url: https://www.postgresql.org/docs/current/user-manag.html
    accessed: 2026-11-04
    license: "PostgreSQL License"
  - id: S2
    title: "PostgreSQL: Documentation: 18: GRANT"
    publisher: PostgreSQL Global Development Group
    url: https://www.postgresql.org/docs/current/sql-grant.html
    accessed: 2026-11-04
    license: "PostgreSQL License"
---
# PostgreSQL roles and GRANT

## Short answer
PostgreSQL has only roles: a role can act as a user, a group, or both. Give privileges with `GRANT`, such as `GRANT SELECT ON orders TO reporting;`. [S1][S2]

## Tips
- Grant to a group role, then grant that role to people.
- `PUBLIC` means every role, so grant to it with care. [S2]
- Start with the least privilege needed and add more later.

## Claims
- id: C1
  claim: Roles subsume users and groups.
  source: S1
  evidence: "The concept of roles subsumes the concepts of"
- id: C2
  claim: Any role can act as a user.
  source: S1
  evidence: "Any role can act as a user"
- id: C3
  claim: PUBLIC grants privileges to all roles.
  source: S2
  evidence: "The key word PUBLIC indicates that the privileges are to be granted to all roles"

## Sources
- [S1] PostgreSQL: Documentation: 18: Chapter 21. Database Roles. PostgreSQL Global Development Group. https://www.postgresql.org/docs/current/user-manag.html . License: PostgreSQL License. Accessed 2026-11-04.
- [S2] PostgreSQL: Documentation: 18: GRANT. PostgreSQL Global Development Group. https://www.postgresql.org/docs/current/sql-grant.html . License: PostgreSQL License. Accessed 2026-11-04.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
