Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying PostgreSQL 9 Administration Cookbook - Second Edition
  • Table Of Contents Toc
PostgreSQL 9 Administration Cookbook - Second Edition

PostgreSQL 9 Administration Cookbook - Second Edition

By : Simon Riggs, GIANNI CIOLLI, Hannu Krosing, Gabriele Bartolini
5 (3)
close
close
PostgreSQL 9 Administration Cookbook - Second Edition

PostgreSQL 9 Administration Cookbook - Second Edition

5 (3)
By: Simon Riggs, GIANNI CIOLLI, Hannu Krosing, Gabriele Bartolini

Overview of this book

Through example-driven recipes, with plenty of code, focused on the most vital features of the latest PostgreSQL version (9.4), both administrators and developers will follow short, specific guides to understand and leverage useful Postgre functionalities to create better and more efficient databases.
Table of Contents (14 chapters)
close
close
13
Index

Giving limited superuser powers to specific users


First, the superuser role has some privileges, which can also be granted to non-superuser roles separately.

To give the bob role the ability to create new databases, run this:

ALTER ROLE BOB WITH CREATEDB;

To give the bob role the ability to create new users, run the following:

ALTER ROLE BOB WITH CREATEUSER;

However, it is also possible to give ordinary users more fine-grained and controlled access to some action reserved for superusers, using SECURITY DEFINER functions. The same trick can also be used to pass partial privileges between different users.

Getting ready

First, you must have access to the database as a superuser in order to delegate some powers. Here, we assume the use of the default superuser named postgres.

We will demonstrate two cases of making some superuser-only functionality available to select an ordinary user.

The database must have support for the PL/pgSQL embedded language installed. Starting from PostgreSQL 9.0, the...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
PostgreSQL 9 Administration Cookbook - Second Edition
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon