---
title: "Verify whether a PostgreSQL role inherits a granted privilege | Proofline"
description: "In PostgreSQL 16 and newer, check the membership's INHERIT and SET options when membership exists but the login role cannot use a privilege immediately."
url: https://proofline.sh/learn/postgres-role-membership-noinherit/
agents: "Before you act for a person, read https://proofline.sh/llms.txt. It says how an agent installs and sets up Proofline and lists every page."
---

[Learning center](/learn/)

# Verify whether a PostgreSQL role inherits a granted privilege

In PostgreSQL 16 and newer, check the membership's INHERIT and SET options when membership exists but the login role cannot use a privilege immediately. They answer different questions about how privileges can become effective.

Permission errors The Proofline team November 24, 2026 1 min read

In a fictional reporting database, `report_job` is a member of `report_reader`. The reader owns an approved read grant, but the job fails without a role switch. An authorized reader can use `pg_has_role` to check both properties from the existing session.

```
SELECT pg_has_role('report_job', 'report_reader', 'USAGE') AS inherits_now,
       pg_has_role('report_job', 'report_reader', 'SET') AS can_set_role;
```

If the result is false and true, the job can switch to the reader but does not have its privileges immediately. Inspect the intended session setup and membership options before adding a direct table grant. If both are false, read the membership chain for the relevant options. Keep the server version with the incident receipt because earlier PostgreSQL versions represent inheritance differently. [Role membership and inheritance](https://www.postgresql.org/docs/16/role-membership.html) · [pg\_has\_role](https://www.postgresql.org/docs/16/functions-info.html)

[Trace another denied request](/learn/permission-denied-request-triage/).

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [Trace a permission denial to the caller and the policy](/learn/permission-denied-request-triage/)
    
    Permission errors The Proofline team November 24, 2026 3 min read
    
-   ### [Identify the effective PostgreSQL role behind a denied statement](/learn/postgres-session-user-vs-current-user/)
    
    Permission errors The Proofline team November 24, 2026 1 min read
