- PostgreSQL 11 Administration Cookbook
- Simon Riggs Gianni Ciolli Sudheer Kumar Meesala
- 116字
- 2021-06-24 14:35:12
How to do it…
Follow these steps to set parameters at various levels as per the requirements:
- For all users in the saas database, use the following commands:
ALTER DATABASE saas
SET configuration_parameter = value1;
- For a user named simon connected to any database, use the following commands:
ALTER ROLE simon
SET configuration_parameter = value2;
- Alternatively, you can set a parameter for a user only when they're 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 them. These are default settings, and in most cases they can be overridden if the user requires non-default values.