TL;DR: Listing PostgreSQL users is straightforward with psql, pgAdmin, and catalog queries, but the real security issue is whether teams can actually see roles, privileges, and session activity well enough to audit access and spot misuse, according to StrongDM. The operational gap is governance, not syntax: access visibility only matters when it is tied to review, logging, and revocation decisions.
At a glance
What this is: NHI Mgmt Group's analysis, drawing on StrongDM's blog post: Access visibility only becomes security value when it feeds audit, logging, and revocation decisions for PostgreSQL users and roles.
Why it matters: For IAM and database security teams, the real control issue is not whether roles can be queried, but whether those queries support lifecycle governance, least privilege, and timely access removal.
By the numbers:
- Up to 80% of data breaches in the U.S. start with unauthorized access.
Context
PostgreSQL access listing is the operational act of identifying which roles exist, what they can do, and whether those permissions still match the business need. The governance gap appears when teams can query access but cannot reliably tie those results to review, logging, and revocation decisions.
This article is really about database access governance, not syntax. The same role inventory that helps with audits and compliance can also expose privilege creep, inherited membership, and stale login access if it is not wired into an access lifecycle process.
For practitioners, the question is whether PostgreSQL role visibility is a one-time administrative task or part of a repeatable control model for database IAM and PAM.
Key questions
Q: What breaks when PostgreSQL access reviews focus only on usernames?
A: Usernames do not show inherited privileges, database grants, schema rights, or foreign server access, so a review can appear complete while the real access surface remains broad. The result is false confidence: teams certify a login, not the effective permission chain. Effective review has to follow the privilege path, not stop at the role name.
Q: Why does PostgreSQL role membership increase audit and governance risk?
A: Role membership can silently expand a user’s permissions through inheritance, group grants, and object ownership, which makes the visible account list a poor proxy for real access. That matters because risk rises when teams cannot explain how a user reached a table, schema, or foreign server. Governance has to inspect inherited rights, not just direct grants.
Q: How can teams tell whether PostgreSQL access review is actually working?
A: Access review is working when catalog data, membership paths, and session logs line up with approved access and recent business need. If a role still exists, still logs in, and still carries privileges that no one can justify, the process is failing. The best signal is a clean match between entitlement records and observed use.
Q: Should database teams treat PostgreSQL user management as part of IAM or as a separate admin task?
A: It should be treated as part of IAM and privilege governance, because PostgreSQL roles are identities with lifecycle, assignment, review, and removal requirements. Keeping it separate usually means stale access, weak revocation discipline, and poor audit evidence. Database admin tasks become safer when they follow the same governance model as other privileged identities.
Technical breakdown
How PostgreSQL role inventory is exposed through system catalogs
PostgreSQL stores role and privilege data in system catalogs such as pg_roles, pg_auth_members, and information_schema views. Commands like \du, \du+, and catalog queries surface whether a role can log in, create databases, inherit privileges, or belong to other groups. That makes the database itself the source of truth for effective access, but it also means visibility depends on query discipline and the permissions of the person running the audit. Practical implication: use catalog queries as the baseline for access review, not as the review itself.
Practical implication: build periodic role inventory checks from catalog data, then compare the output to approved access and ownership records.
Why privilege inheritance and membership matter more than simple user counts
Listing usernames alone misses the way PostgreSQL permissions accumulate through role membership, grants, and inherited rights. A user may have no obvious direct grant yet still inherit broad access through group membership or database-level privileges. This is where access review often fails: teams certify a name, but not the full path by which that name reaches a table, schema, or foreign server. Practical implication: evaluate effective access paths, not just the presence of a login-capable account.
Practical implication: review role membership, inherited grants, and database-level ACLs together so hidden privilege chains do not survive certification.
Audit logging turns access visibility into governance evidence
PostgreSQL logging settings and extensions such as pgAudit turn role visibility into evidence by recording logins, logouts, query duration, DDL activity, and other sensitive actions. Without that trail, an organisation may know who exists in the system but not what they actually did during a session. That is a governance gap because access review needs activity context, not just entitlement context. Practical implication: pair role inventory with audit logs so revocation decisions are based on observed use as well as assigned privilege.
Practical implication: connect database audit events to access review and incident investigation workflows so entitlement decisions have behavioural evidence.
Breaches seen in the wild
- Azure Key Vault Contributor escalation 2024: Datadog found Azure Key Vault Contributor could add itself to access policies and read every secret, key and certificate in a vault.
Read and download The State of NHI & AI Agent Breach Report 2026, covering 150+ breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
PostgreSQL role visibility is not the control; it is the evidence source. The article shows that users, roles, memberships, and privileges can be listed through built-in catalog views and GUI tools. That visibility is useful only when it is attached to a governance process that can review, challenge, and revoke access. The practitioner lesson is that an accessible role inventory is necessary, but not sufficient, for database security.
Access review fails when teams certify names instead of effective privileges. PostgreSQL roles can inherit rights through membership, database grants, schema grants, and foreign server mappings. That means the real access surface is wider than the login list suggests. The governance mistake is treating a user directory as the control plane when the control plane is actually the effective permission chain. Practitioners should assess the path to privilege, not only the presence of a role.
Audit logging is the missing bridge between administrative visibility and accountable access. PostgreSQL can log connections, disconnections, DDL changes, and query duration, but those records only matter if they inform review and remediation. Listing users without session evidence leaves organisations unable to explain whether access was appropriate, overused, or stale. The implication is that database governance must combine entitlement inventory with activity evidence to make access decisions defensible.
Database access governance is converging with PAM and IGA expectations. The article’s emphasis on create, grant, revoke, and delete operations shows that PostgreSQL user management sits inside the broader identity lifecycle, not outside it. Database roles are not just local admin objects; they are governed identities with assignment, review, and removal requirements. The practical conclusion is that database teams should treat PostgreSQL access as part of the same lifecycle discipline used for privileged human and non-human identities.
Role sprawl creates an identity blast radius inside the database layer. When groups, inherited permissions, and object-level grants are not regularly reconciled, the database accrues access paths that no one can explain quickly. That is not a tooling problem alone. It is a control model problem, and the practitioner response is to make effective access review a standing part of database governance rather than an occasional cleanup exercise.
From our research library:
- 97% of NHIs carry excessive privileges, increasing unauthorised access and broadening the attack surface, according to the Ultimate Guide to NHIs.
- Read next: Privileged Access Management Guide
What this signals
Identity blast radius inside PostgreSQL: once role membership, database grants, and session logging drift apart, the database becomes a place where access can be present without being explainable. That is why role visibility has to be connected to recertification and removal, not treated as a standalone admin utility.
The practical shift for database programmes is to manage PostgreSQL roles as governed identities. That means pairing entitlement review with audit evidence, then making revocation the default outcome when the business justification is missing or stale.
For practitioners
- Map effective PostgreSQL access paths Inventory roles, memberships, schema grants, database ACLs, and foreign server mappings together so you can see who can actually reach data, not just who can log in.
- Tie role review to session evidence Use connection logs, disconnection logs, DDL logging, and pgAudit output to validate whether assigned privileges are being used as expected.
- Revoke stale login-capable roles Remove login privileges and inherited memberships from accounts that no longer need database access, then confirm the change with a fresh catalog query.
- Automate periodic access certification Schedule recurring reviews of rolcanlogin, rolcreaterole, rolcreatedb, and role membership so access changes are re-validated instead of assumed.
Key takeaways
- PostgreSQL access listing helps only when it is tied to review, logging, and revocation, because visibility alone does not close the governance gap.
- Role membership and inherited grants make the real access surface wider than a simple username list suggests.
- Database teams should treat PostgreSQL roles as governed identities and fold them into the same lifecycle controls used for other privileged access.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 addresses the attack and risk surface, while NIST SP 800-53 Rev 5, CIS Controls v8 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-05 — Overprivileged NHI | PostgreSQL roles can accumulate privileges through grants and inheritance, creating excess access. |
| NHI-01 — Improper Offboarding | Stale database accounts and unused login-capable roles persist when offboarding is weak. | |
| Recommendation — Audit PostgreSQL roles for overprivilege and remove permissions that are not tied to current duties. Revoke PostgreSQL access promptly when accounts or role memberships are no longer needed. | ||
| NIST SP 800-53 Rev 5 | AC-6 — Least Privilege | The article’s core issue is whether database permissions remain limited to what is required. |
| Recommendation — Apply least-privilege reviews to PostgreSQL roles, grants, and inherited permissions. | ||
| CIS Controls v8 | CIS-5 — Account Management | Role creation, revocation, and periodic review are central to PostgreSQL user governance. |
| Recommendation — Use account management controls to review, disable, and remove stale PostgreSQL roles. | ||
| NIST CSF 2.0 | PR.AA-05 — Access Permissions, Entitlements and Authorizations | The article is fundamentally about understanding and governing database entitlements. |
| Recommendation — Document and review PostgreSQL entitlements so effective access matches approved authorisation. | ||
Key terms
- Effective Access: The actual permissions an identity can exercise after inheritance, nested groups, delegation, and object-level controls are evaluated. In Active Directory, effective access is more useful than direct membership because it reveals the true operational reach of a service account.
- Role Membership: Role membership is the assignment relationship that adds one role to another so access can be managed collectively. It is useful for groups and shared functions, but it requires close oversight because membership changes can silently expand access across multiple users or applications.
- Audit Evidence: Audit evidence is the record set used to prove that access was authorised, limited, and revoked according to policy. For modern identity programmes, evidence must come from runtime logs, approval events, and lifecycle records rather than from manual spreadsheets assembled after the fact.
- Privilege Review: Privilege review is the process of checking whether an identity still needs the access it has. It is used to find standing access, excessive permissions, and orphaned credentials before they become an incident path. Effective reviews are repeatable, evidence-based, and tied to ownership and remediation workflows.
Deepen your knowledge
NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an IAM programme, it is worth exploring.
Published by the NHIMG editorial team on June 7, 2026.
Updated on October 7, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org