O'Reilly logo

PostgreSQL 9 Administration Cookbook by Hannu Krosing, Simon Riggs

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting parameters for particular groups of users

PostgreSQL supports a variety of ways of defining parameter settings for various user groups.

How to do it...

For all users in database saas:

ALTER DATABASE saas
SET configuration_parameter = value1;

For a user named simon connected to any database, use the following:

ALTER ROLE saas
SET configuration_parameter = value2;

or set a parameter for a user only when connected to a specific database, as follows:

ALTER ROLE simon
IN DATABASE saas
SET configuration_parameter = value3;

The user won't know that these have been executed specifically for him. These are default settings, and in most cases can be overridden if the user requires non-default values.

How it works...

You can set parameters for each ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required