Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
PostgreSQL 11 Administration Cookbook

You're reading from   PostgreSQL 11 Administration Cookbook Over 175 recipes for database administrators to manage enterprise databases

Arrow left icon
Product type Paperback
Published in May 2019
Publisher Packt
ISBN-13 9781789537581
Length 600 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Authors (3):
Arrow left icon
Gianni Ciolli Gianni Ciolli
Author Profile Icon Gianni Ciolli
Gianni Ciolli
Sudheer Kumar Meesala Sudheer Kumar Meesala
Author Profile Icon Sudheer Kumar Meesala
Sudheer Kumar Meesala
Simon Riggs Simon Riggs
Author Profile Icon Simon Riggs
Simon Riggs
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. First Steps FREE CHAPTER 2. Exploring the Database 3. Configuration 4. Server Control 5. Tables and Data 6. Security 7. Database Administration 8. Monitoring and Diagnosis 9. Regular Maintenance 10. Performance and Concurrency 11. Backup and Recovery 12. Replication and Upgrades 13. Other Books You May Enjoy

The PostgreSQL superuser


In this recipe, you will learn how to grant the right to a user to become a superuser.

A PostgreSQL superuser is a user that bypasses all permission checks, except the right to log in. This is a dangerous privilege and should not be used carelessly. Many cloud databases do not allow this level of privilege to be granted. It is normal to place strict controls on users of this type.

How to do it…

Follow the steps to add or remove superuser privileges for any user:

  1. A user becomes a superuser when it is created with the SUPERUSER attribute set:
CREATE USER username SUPERUSER;
  1. A user can be deprived of its superuser status by removing the SUPERUSER attribute using this command:
ALTER USER username NOSUPERUSER;
  1. A user can be restored to superuser status later using the following command:
ALTER USER username SUPERUSER;
  1. When neither SUPERUSER nor NOSUPERUSER is given in the CREATE USER command, then the default is to create a user who is not a superuser.

How it works…

The rights to...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime