{"id":8493,"date":"2020-11-30T05:56:00","date_gmt":"2020-11-30T05:56:00","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=8493"},"modified":"2026-01-16T06:01:07","modified_gmt":"2026-01-16T06:01:07","slug":"how-to-create-user-with-superuser-privileges-in-postgresql","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/","title":{"rendered":"How To Create User With Superuser Privileges in PostgreSQL"},"content":{"rendered":"\n<p>Sometimes database administrators need to create a superuser to carry out certain administrative tasks. In this regard, you may need to create superuser in PostgreSQL for database management or website administration. PostgreSQL allows you to <a href=\"https:\/\/ubiq.co\/tech-blog\/create-user-postgresql\/\">create users<\/a> and roles with varying degree of privileges and permissions. In this article, we will look at how to create user with superuser privileges 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-create-user-with-superuser-privileges-in-postgresql\/#What_is_PostgreSQL_Superuser\" >What is PostgreSQL Superuser<\/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-create-user-with-superuser-privileges-in-postgresql\/#How_To_Create_User_With_Superuser_Privileges_in_PostgreSQL\" >How To Create User With Superuser Privileges in PostgreSQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/#1_Using_CREATE_ROLE\" >1. Using CREATE ROLE<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/#2_Using_CREATE_USER\" >2. Using CREATE USER<\/a><\/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-create-user-with-superuser-privileges-in-postgresql\/#3_Using_ALTER_ROLE\" >3. Using ALTER ROLE<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/#4_Using_ALTER_USER\" >4. Using ALTER USER<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/#5_Check_Status\" >5. Check Status<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/#5_Revoke_Superuser\" >5. Revoke Superuser<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_PostgreSQL_Superuser\"><\/span>What is PostgreSQL Superuser<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>PostgreSQL superuser is a database user with highest privileges in PostgreSQL database. It has access to all databases and tables, and can run any kinds of queries such as creation, modification and deletion of tables, databases, users and roles. By default, at the time of installation, PostgreSQL automatically creates a superuser postgres. Generally, most database programmers and web developers work with this user instead of creating another superuser. This is because if unauthorized person gains access to superuser account, they can seriously damage your system.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_To_Create_User_With_Superuser_Privileges_in_PostgreSQL\"><\/span>How To Create User With Superuser Privileges in PostgreSQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are the steps to create user with superuser privileges in PostgreSQL. There are 4 different ways to create superuser, depending on your PostgreSQL version.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Using_CREATE_ROLE\"><\/span>1. Using CREATE ROLE<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>PostgreSQL 8.1 onwards uses the concept of ROLE instead of a USER. A role can be a user or a group depending on your configuration. So we will create a ROLE with superuser privileges. <\/p>\n\n\n\n<p>Log into PostgreSQL and run the following command to create a new role with superuser privileges. Replace<em> test_role<\/em> as per your requirement.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>CREATE ROLE test_role LOGIN SUPERUSER;<\/code><\/pre>\n\n\n\n<p>A database role has all permissions, except the permission to login. So you need to grant it to the new role.<\/p>\n\n\n\n<p>If you also want to assign a log in password, modify the above command to the following. Replace <em>test_password<\/em> with your choice of password.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>CREATE ROLE rolename LOGIN SUPERUSER PASSWORD 'test_password';<\/code><\/pre>\n\n\n\n<p>You can also create a non-super user ROLE and then make it superuser as shown below. Replace <em>test_role<\/em> with your choice of role.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>CREATE ROLE test_role LOGIN;<\/code>\n<code>ALTER ROLE test_role WITH SUPERUSER;<\/code><\/pre>\n\n\n\n<p>Here is the command to change superuser into a regular role.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ALTER ROLE test_role WITH NOSUPERUSER;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Using_CREATE_USER\"><\/span>2. Using CREATE USER<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here is the command to create user with superuser privileges as per the PostgreSQL version lower than 8.1. Replace <em>test_user<\/em> as your requirement.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>CREATE USER test_user SUPERUSER;<\/code><\/pre>\n\n\n\n<p>If you want you superuser to have a login password, modify the above command as shown below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>CREATE USER username SUPERUSER WITH PASSWORD 'test_password';<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Using_ALTER_ROLE\"><\/span>3. Using ALTER ROLE<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can also convert a regular user into a superuser using ALTER ROLE and ALTER USER commands. Let us first create an ordinary user.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">CREATE USER test_user WITH PASSWORD 'test_password';<\/pre>\n\n\n\n<p>Next, convert it into a superuser using the ALTER USER command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ALTER USER test_user WITH SUPERUSER;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Using_ALTER_USER\"><\/span>4. Using ALTER USER<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Similarly, you can also change an ordinary user to superuser using ALTER USER statement. Here is the command for it. You just need to add &#8216;WITH SUPERUSER&#8217; after username in ALTER USER statement.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ALTER USER username WITH SUPERUSER<\/pre>\n\n\n\n<p>For this purpose, let us first create a regular user.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">CREATE USER test_user WITH PASSWORD 'test_password';<\/pre>\n\n\n\n<p>Next, convert it into superuser with the following command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ALTER USER test_user WITH SUPERUSER<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Check_Status\"><\/span>5. Check Status<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>No matter which of the above commands you use to create a superuser, you can easily verify it using the following command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\\du<\/pre>\n\n\n\n<p>It will give the following output.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ROLE      | Attributes<br>----------+-------------<br>test_user | Superuser<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Revoke_Superuser\"><\/span>5. Revoke Superuser<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can also revoke superuser privileges granted to a user using ALTER USER statement. Here is its syntax.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ALTER USER username NOSUPERUSER;<\/pre>\n\n\n\n<p>Here is an example to revoke superuser privileges of test_user.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ALTER USER test_user NOSUPERUSER;<\/pre>\n\n\n\n<p>That&#8217;s it. As you can see it is quite easy to create a superuser in PostgreSQL.<\/p>\n\n\n\n<p>If you want to change user password, you can also do so with ALTER ROLE or ALTER USER statements.<\/p>\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 learnt how to create a superuser in PostgreSQL. You can directly create a superuser using CREATE USER or CREATE ROLE statement, or change an regular user into a superuser using ALTER USER or ALTER ROLE statement, depending on your requirement. We have also learnt how to revoke superuser privileges and convert a superuser to regular user. In most cases, the default postgres superuser is enough to get the work done. So please be careful while creating a superuser for your database. It is important to monitor the usage of superuser accounts and revoke them if not required, to avoid any abuse. You can do this by regularly viewing a <a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-list-all-users-in-postgresql\/\">list of all PostgreSQL users<\/a> on your system.<\/p>\n\n\n\n<p>Need a good reporting tool for PostgreSQL? <a href=\"https:\/\/ubiq.co\/\">Ubiq<\/a>&nbsp;makes it easy to visualize data, and monitor them in real-time dashboards.&nbsp;<a href=\"https:\/\/ubiq.co\/accounts\/register\">Try Ubiq<\/a>&nbsp;for free.<\/p>\n\n\n\n<p>Also read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-setup-remote-connection-to-postgresql\/\">How to Setup Remote Connection in PostgreSQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-compare-two-schemas-in-postgresql\/\">How to Compare PostgreSQL Schemas<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/top-5-free-database-design-tools\/\">Top Free Database Design Tools<\/a><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You need to create superuser for database administration. Here is how to create user with superuser privileges in PostgreSQL.<\/p>\n","protected":false},"author":1,"featured_media":8496,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[348],"tags":[472],"class_list":["post-8493","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postgresql","tag-superuser"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Create User With Superuser Privileges in PostgreSQL - Ubiq BI<\/title>\n<meta name=\"description\" content=\"You need to create superuser for database administration. Here is how to create user with superuser privileges 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-create-user-with-superuser-privileges-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 Create User With Superuser Privileges in PostgreSQL - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"You need to create superuser for database administration. Here is how to create user with superuser privileges in PostgreSQL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-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=\"2020-11-30T05:56:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-16T06:01:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/create-superuser-postgresql.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"730\" \/>\n\t<meta property=\"og:image:height\" content=\"410\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\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=\"4 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-create-user-with-superuser-privileges-in-postgresql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-user-with-superuser-privileges-in-postgresql\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How To Create User With Superuser Privileges in PostgreSQL\",\"datePublished\":\"2020-11-30T05:56:00+00:00\",\"dateModified\":\"2026-01-16T06:01:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-user-with-superuser-privileges-in-postgresql\\\/\"},\"wordCount\":734,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-user-with-superuser-privileges-in-postgresql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/create-superuser-postgresql.webp?fit=730%2C410&ssl=1\",\"keywords\":[\"superuser\"],\"articleSection\":[\"PostgreSQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-user-with-superuser-privileges-in-postgresql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-user-with-superuser-privileges-in-postgresql\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-user-with-superuser-privileges-in-postgresql\\\/\",\"name\":\"How To Create User With Superuser Privileges in PostgreSQL - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-user-with-superuser-privileges-in-postgresql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-user-with-superuser-privileges-in-postgresql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/create-superuser-postgresql.webp?fit=730%2C410&ssl=1\",\"datePublished\":\"2020-11-30T05:56:00+00:00\",\"dateModified\":\"2026-01-16T06:01:07+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"You need to create superuser for database administration. Here is how to create user with superuser privileges in PostgreSQL.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-user-with-superuser-privileges-in-postgresql\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-user-with-superuser-privileges-in-postgresql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-user-with-superuser-privileges-in-postgresql\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/create-superuser-postgresql.webp?fit=730%2C410&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/create-superuser-postgresql.webp?fit=730%2C410&ssl=1\",\"width\":730,\"height\":410,\"caption\":\"create superuser postgresql\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-create-user-with-superuser-privileges-in-postgresql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Create User With Superuser Privileges 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 Create User With Superuser Privileges in PostgreSQL - Ubiq BI","description":"You need to create superuser for database administration. Here is how to create user with superuser privileges 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-create-user-with-superuser-privileges-in-postgresql\/","og_locale":"en_US","og_type":"article","og_title":"How To Create User With Superuser Privileges in PostgreSQL - Ubiq BI","og_description":"You need to create superuser for database administration. Here is how to create user with superuser privileges in PostgreSQL.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2020-11-30T05:56:00+00:00","article_modified_time":"2026-01-16T06:01:07+00:00","og_image":[{"width":730,"height":410,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/create-superuser-postgresql.webp","type":"image\/webp"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How To Create User With Superuser Privileges in PostgreSQL","datePublished":"2020-11-30T05:56:00+00:00","dateModified":"2026-01-16T06:01:07+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/"},"wordCount":734,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/create-superuser-postgresql.webp?fit=730%2C410&ssl=1","keywords":["superuser"],"articleSection":["PostgreSQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/","name":"How To Create User With Superuser Privileges in PostgreSQL - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/create-superuser-postgresql.webp?fit=730%2C410&ssl=1","datePublished":"2020-11-30T05:56:00+00:00","dateModified":"2026-01-16T06:01:07+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"You need to create superuser for database administration. Here is how to create user with superuser privileges in PostgreSQL.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/create-superuser-postgresql.webp?fit=730%2C410&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/create-superuser-postgresql.webp?fit=730%2C410&ssl=1","width":730,"height":410,"caption":"create superuser postgresql"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-create-user-with-superuser-privileges-in-postgresql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How To Create User With Superuser Privileges 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\/2020\/11\/create-superuser-postgresql.webp?fit=730%2C410&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-2cZ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8493","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=8493"}],"version-history":[{"count":6,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8493\/revisions"}],"predecessor-version":[{"id":10289,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8493\/revisions\/10289"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/8496"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=8493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=8493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=8493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}