<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Pg_roles on Postgres Scripts</title><link>https://www.postgresscripts.com/tags/pg_roles/</link><description>Recent content in Pg_roles on Postgres Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>PostgresScripts.com</copyright><lastBuildDate>Fri, 17 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.postgresscripts.com/tags/pg_roles/index.xml" rel="self" type="application/rss+xml"/><item><title>List PostgreSQL Roles and Their Privileges</title><link>https://www.postgresscripts.com/post/list-postgresql-roles-and-privileges/</link><pubDate>Fri, 17 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.postgresscripts.com/post/list-postgresql-roles-and-privileges/</guid><description>
&lt;h2 id="how-to-list-postgresql-roles-and-privileges"&gt;How to List PostgreSQL Roles and Privileges&lt;/h2&gt;
&lt;p&gt;PostgreSQL uses &lt;strong&gt;roles&lt;/strong&gt; for both users and groups. A role with the &lt;code&gt;LOGIN&lt;/code&gt; attribute is a user account. A role without &lt;code&gt;LOGIN&lt;/code&gt; is typically a group role used to collect privileges that are then granted to login roles. Understanding which roles exist, what privileges they have, and which roles belong to which groups is a fundamental security audit task.&lt;/p&gt;
&lt;p&gt;This article shows SQL queries to list all roles, their key attributes, and role membership.&lt;/p&gt;</description></item></channel></rss>