{"id":9562,"date":"2025-09-22T05:39:54","date_gmt":"2025-09-22T05:39:54","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=9562"},"modified":"2026-01-16T06:00:37","modified_gmt":"2026-01-16T06:00:37","slug":"how-to-list-all-users-in-postgresql","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/","title":{"rendered":"How to List All Users in PostgreSQL"},"content":{"rendered":"\n<p>Database administrators need to regularly keep track of all the users in PostgreSQL database system. This will help identify unknown users and block unauthorized database access. Also, as and when people leave your team, it is essential to remove them from your system and revoke their access. This will help you control access to your databases. In this article, we will learn how to list all users in PostgreSQL.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#How_to_List_All_Users_in_PostgreSQL\" >How to List All Users in PostgreSQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#1_Using_PSQL\" >1. Using PSQL<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#List_Users\" >List Users<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#List_Users_with_Details\" >List Users with Details<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#2_Using_SQL\" >2. Using SQL<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#Filter_only_roles_with_login_privileges\" >Filter only roles with login privileges<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#Show_users_with_their_permissions\" >Show users with their permissions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#Check_user-specific_grants_on_tables\" >Check user-specific grants on tables<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#To_check_schema-level_privileges\" >To check schema-level privileges<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#For_database-level_privileges\" >For database-level privileges<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#Check_role_membership\" >Check role membership<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#User_not_listed_in_du_output\" >User not listed in \\du output<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#3_List_Databases\" >3. List Databases<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#4_List_Schemas\" >4. List Schemas<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#5_List_Tables\" >5. List Tables<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_List_All_Users_in_PostgreSQL\"><\/span>How to List All Users in PostgreSQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><a href=\"https:\/\/ubiq.co\/tech-blog\/create-user-postgresql\/\">Creating new users<\/a> and managing them is commonly required in many places such as <a href=\"\/postgresql-reporting-tools\">PostgreSQL database reporting<\/a>. There are two main ways to get a list of all users in PostgreSQL &#8211; using psql tool and using plain SQL query.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Using_PSQL\"><\/span>1. Using PSQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>PSQL tool provides readymade commands to perform certain tasks. Here are a couple of commands to get list of users.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"List_Users\"><\/span>List Users<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You can easily get list of users using \\du command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#- \\du<\/pre>\n\n\n\n<p>The above command will display a table of user roles along with their user privileges, including <a href=\"https:\/\/ubiq.co\/tech-blog\/create-read-only-mysql-user\/\">read only users<\/a>. It is a useful shortcut for system administrators to easily view who can access their system.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"List_Users_with_Details\"><\/span>List Users with Details<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you want more details, you can use the \\du+ command. It will display a table of &#8216;role name&#8217; that is PostgreSQL user role, &#8216;attribute&#8217; that is role permission, and &#8216;member of&#8217; that is if it is part of other groups. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#- \\du+<\/pre>\n\n\n\n<p>This command is useful if you want to thoroughly evaluate each user accessing your data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Using_SQL\"><\/span>2. Using SQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The above commands always return a list of all PostgreSQL users. Sometimes you may need to customize the output or view only a subset of this result. For this purpose, you can use SQL queries. Now let us look at some of the SQL queries that you can use to get user details.<\/p>\n\n\n\n<p>PostgreSQL stores details of all user roles in pg_roles system database table. It is automatically created at the time of PostgreSQL installation and maintained by PostgreSQL server. Here is the query to get a list of users with details.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT rolname, rolsuper, rolinherit, rolcreaterole, rolcreatedb, rolcanlogin, rolreplication FROM pg_roles;<\/pre>\n\n\n\n<p>In the above query, the column names mean the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>rolname &#8211; user role name<\/li>\n\n\n\n<li>rolsuper &#8211; flag to indicate if user is a superuser<\/li>\n\n\n\n<li>rolcreaterole &#8211; indicates if user can create new roles<\/li>\n\n\n\n<li>rolcreatedb &#8211; indicates if user can create databases<\/li>\n\n\n\n<li>rolcanlogin &#8211; indicates if user role has login privileges<\/li>\n\n\n\n<li>rolreplication &#8211; indicates if role is used for replication<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Filter_only_roles_with_login_privileges\"><\/span>Filter only roles with login privileges<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Using the above information, we can get specific users as per our requirement. Here is the query to get all those users who have login privileges.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT rolname, rolsuper, rolinherit, rolcreaterole, rolcreatedb, rolcanlogin, rolreplication  <br>FROM pg_roles  <br>WHERE rolcanlogin = true;<\/pre>\n\n\n\n<p>In the above query, we select rows where rolcanlogin column has true value, indicating they have login privileges. Similarly, you can filter rows based on other columns&#8217; values.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Show_users_with_their_permissions\"><\/span>Show users with their permissions<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you want to see all users along with their permissions, then you need to query table information_schema.role_table_grants.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT grantee, privilege_type, table_schema, table_name FROM information_schema.role_table_grants;<\/pre>\n\n\n\n<p>This query is useful to periodically evaluate user permissions and privileges so you can modify them as per your requirements.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Check_user-specific_grants_on_tables\"><\/span>Check user-specific grants on tables<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Sometimes, you may want to see the user privileges for tables of only a specific user. In such case, you can filter the result of above query using grantee column name as shown.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT * FROM information_schema.role_table_grants WHERE grantee = 'username';<\/pre>\n\n\n\n<p>This query will help you understand which all tables a given user is able to access.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"To_check_schema-level_privileges\"><\/span>To check schema-level privileges<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you want to check a user&#8217;s schema level privileges, you need to query information_schema.role_schema_grants table.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT *  <br>FROM information_schema.role_schema_grants  <br>WHERE grantee = 'username';<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"For_database-level_privileges\"><\/span>For database-level privileges<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you want to view user privileges pertaining to a database, then you can query pg_database.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT datname, datacl  <br>FROM pg_database;<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Check_role_membership\"><\/span>Check role membership<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Sometimes, you may need to check which users have been assigned to groups. Here is the SQL query for this purpose. For this purpose, we use pg_roles and pg_auth_members tables.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT<br> r.rolname AS role_name, <br> m.rolname AS member_name <br>FROM <br> pg_roles r JOIN pg_auth_members a ON r.oid = a.roleid <br>JOIN <br> pg_roles m ON a.member = m.oid;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"User_not_listed_in_du_output\"><\/span>User not listed in \\du output<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Often you may need to view details about users that are not listed in \\du output. You can do this with the help of the following query, which selects rows from pg_roles system table by filtering on rolename column value.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT 1 FROM pg_roles WHERE rolname = 'username';<\/pre>\n\n\n\n<p>Let us look at some of the other commands commonly used in conjunction with listing users.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_List_Databases\"><\/span>3. List Databases<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>PSQL utility also provides many useful commands to list databases, schemas and tables. You can easily get a list of all databases using \\l or \\l+ command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#- \\l<br>OR<br>#- \\l+<\/pre>\n\n\n\n<p>Alternatively, you can also use the following SELECT statement to get a list of databases from pg_catalog table.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT oid, datname<br>FROM pg_database;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_List_Schemas\"><\/span>4. List Schemas<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Similarly, you can also use \\dn or \\dn+ commands to get a list of schemas in PostgreSQL.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#- \\dn<br>OR<br>#- \\dn+<\/pre>\n\n\n\n<p>Alternatively, you can also use the following SQL query to fetch this information from information_schema database.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT schema_name, schema_owner<br>FROM information_schema.schemata;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_List_Tables\"><\/span>5. List Tables<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you want to list details of all tables in your PostgreSQL installation, then you can run the \\dt or \\dt+ command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#- \\dt<br>OR<br>#- \\dt+<\/pre>\n\n\n\n<p>You can also view details of all tables with the following SQL query.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT tablename <br>FROM pg_catalog.pg_tables;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we have seen several different ways to list all PostgreSQL users. If you want details of all users then you can use \\dt or \\dt+ command. If you want to view only specific column information about users or view information about only certain users then you can use SELECT query on pg_roles table. You can use any of the above commands as per your requirement. <\/p>\n\n\n\n<p>Also read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-alter-column-from-null-to-not-null\/\">How to Alter Column to NOT NULL in PostgreSQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-prevent-sql-injection-attack\/\">How to Prevent SQL Injection Attack<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-check-if-postgresql-array-contains-value\/\">How to Check if PostgreSQL Array Contains Value<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Often database administrators need to find out all users in PostgreSQL system. Here is how to list all users in PostgreSQL.<\/p>\n","protected":false},"author":1,"featured_media":9595,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[348],"tags":[327],"class_list":["post-9562","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postgresql","tag-list-users"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to List All Users in PostgreSQL - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Often database administrators need to find out all users in PostgreSQL system. Here is how to list all users in PostgreSQL.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to List All Users in PostgreSQL - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Often database administrators need to find out all users in PostgreSQL system. Here is how to list all users in PostgreSQL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-22T05:39:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-16T06:00:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/09\/list-users-in-postgresql.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"301\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-list-all-users-in-postgresql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-list-all-users-in-postgresql\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to List All Users in PostgreSQL\",\"datePublished\":\"2025-09-22T05:39:54+00:00\",\"dateModified\":\"2026-01-16T06:00:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-list-all-users-in-postgresql\\\/\"},\"wordCount\":927,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-list-all-users-in-postgresql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/list-users-in-postgresql.jpg?fit=301%2C200&ssl=1\",\"keywords\":[\"list users\"],\"articleSection\":[\"PostgreSQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-list-all-users-in-postgresql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-list-all-users-in-postgresql\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-list-all-users-in-postgresql\\\/\",\"name\":\"How to List All Users in PostgreSQL - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-list-all-users-in-postgresql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-list-all-users-in-postgresql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/list-users-in-postgresql.jpg?fit=301%2C200&ssl=1\",\"datePublished\":\"2025-09-22T05:39:54+00:00\",\"dateModified\":\"2026-01-16T06:00:37+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Often database administrators need to find out all users in PostgreSQL system. Here is how to list all users in PostgreSQL.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-list-all-users-in-postgresql\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-list-all-users-in-postgresql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-list-all-users-in-postgresql\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/list-users-in-postgresql.jpg?fit=301%2C200&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/list-users-in-postgresql.jpg?fit=301%2C200&ssl=1\",\"width\":301,\"height\":200,\"caption\":\"list users in posqtgresql\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-list-all-users-in-postgresql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to List All Users in PostgreSQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sreeram-sreenivasan\\\/\"],\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/author\\\/wordpress\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to List All Users in PostgreSQL - Ubiq BI","description":"Often database administrators need to find out all users in PostgreSQL system. Here is how to list all users in PostgreSQL.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/","og_locale":"en_US","og_type":"article","og_title":"How to List All Users in PostgreSQL - Ubiq BI","og_description":"Often database administrators need to find out all users in PostgreSQL system. Here is how to list all users in PostgreSQL.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2025-09-22T05:39:54+00:00","article_modified_time":"2026-01-16T06:00:37+00:00","og_image":[{"width":301,"height":200,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/09\/list-users-in-postgresql.jpg","type":"image\/jpeg"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to List All Users in PostgreSQL","datePublished":"2025-09-22T05:39:54+00:00","dateModified":"2026-01-16T06:00:37+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/"},"wordCount":927,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/09\/list-users-in-postgresql.jpg?fit=301%2C200&ssl=1","keywords":["list users"],"articleSection":["PostgreSQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/","name":"How to List All Users in PostgreSQL - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/09\/list-users-in-postgresql.jpg?fit=301%2C200&ssl=1","datePublished":"2025-09-22T05:39:54+00:00","dateModified":"2026-01-16T06:00:37+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Often database administrators need to find out all users in PostgreSQL system. Here is how to list all users in PostgreSQL.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/09\/list-users-in-postgresql.jpg?fit=301%2C200&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/09\/list-users-in-postgresql.jpg?fit=301%2C200&ssl=1","width":301,"height":200,"caption":"list users in posqtgresql"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to List All Users in PostgreSQL"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/09\/list-users-in-postgresql.jpg?fit=301%2C200&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-2ue","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/9562","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=9562"}],"version-history":[{"count":33,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/9562\/revisions"}],"predecessor-version":[{"id":10288,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/9562\/revisions\/10288"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/9595"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=9562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=9562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=9562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}