mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
2d2bc052e1
* Typo fix. * Links fix. * Fixed links in docs. * More fixes. * docs/en: cleaning some files * docs/en: cleaning data_types * docs/en: cleaning database_engines * docs/en: cleaning development * docs/en: cleaning getting_started * docs/en: cleaning interfaces * docs/en: cleaning operations * docs/en: cleaning query_lamguage * docs/en: cleaning en * docs/ru: cleaning data_types * docs/ru: cleaning index * docs/ru: cleaning database_engines * docs/ru: cleaning development * docs/ru: cleaning general * docs/ru: cleaning getting_started * docs/ru: cleaning interfaces * docs/ru: cleaning operations * docs/ru: cleaning query_language * docs: cleaning interfaces/http * Update docs/en/data_types/array.md decorated ``` Co-Authored-By: BayoNet <da-daos@yandex.ru> * Update docs/en/getting_started/example_datasets/nyc_taxi.md fixed typo Co-Authored-By: BayoNet <da-daos@yandex.ru> * Update docs/en/getting_started/example_datasets/ontime.md fixed typo Co-Authored-By: BayoNet <da-daos@yandex.ru> * Update docs/en/interfaces/formats.md fixed error Co-Authored-By: BayoNet <da-daos@yandex.ru> * Update docs/en/operations/table_engines/custom_partitioning_key.md Co-Authored-By: BayoNet <da-daos@yandex.ru> * Update docs/en/operations/utils/clickhouse-local.md Co-Authored-By: BayoNet <da-daos@yandex.ru> * Update docs/en/query_language/dicts/external_dicts_dict_sources.md Co-Authored-By: BayoNet <da-daos@yandex.ru> * Update docs/en/operations/utils/clickhouse-local.md Co-Authored-By: BayoNet <da-daos@yandex.ru> * Update docs/en/query_language/functions/json_functions.md Co-Authored-By: BayoNet <da-daos@yandex.ru> * Update docs/en/query_language/functions/json_functions.md Co-Authored-By: BayoNet <da-daos@yandex.ru> * Update docs/en/query_language/functions/other_functions.md Co-Authored-By: BayoNet <da-daos@yandex.ru> * Update docs/en/query_language/functions/other_functions.md Co-Authored-By: BayoNet <da-daos@yandex.ru> * Update docs/en/query_language/functions/date_time_functions.md Co-Authored-By: BayoNet <da-daos@yandex.ru> * Update docs/en/operations/table_engines/jdbc.md Co-Authored-By: BayoNet <da-daos@yandex.ru> * docs: fixed error * docs: fixed error
69 lines
2.3 KiB
Markdown
69 lines
2.3 KiB
Markdown
# Constraints on Settings
|
|
|
|
The constraints on settings can be defined in the `users` section of the `user.xml` configuration file and prohibit users from changing some of the settings with the `SET` query.
|
|
The constraints are defined as following:
|
|
|
|
```xml
|
|
<profiles>
|
|
<user_name>
|
|
<constraints>
|
|
<setting_name_1>
|
|
<min>lower_boundary</min>
|
|
</setting_name_1>
|
|
<setting_name_2>
|
|
<max>upper_boundary</max>
|
|
</setting_name_2>
|
|
<setting_name_3>
|
|
<min>lower_boundary</min>
|
|
<max>upper_boundary</max>
|
|
</setting_name_3>
|
|
<setting_name_4>
|
|
<readonly/>
|
|
</setting_name_4>
|
|
</constraints>
|
|
</user_name>
|
|
</profiles>
|
|
```
|
|
|
|
If user tries to violate the constraints an exception is thrown and the setting isn't actually changed.
|
|
There are supported three types of constraints: `min`, `max`, `readonly`. The `min` and `max` constraints specify upper and lower boundaries for a numeric setting and can be used in combination. The `readonly` constraint specify that the user cannot change the corresponding setting at all.
|
|
|
|
**Example:** Let `users.xml` includes lines:
|
|
|
|
```xml
|
|
<profiles>
|
|
<default>
|
|
<max_memory_usage>10000000000</max_memory_usage>
|
|
<force_index_by_date>0</force_index_by_date>
|
|
...
|
|
<constraints>
|
|
<max_memory_usage>
|
|
<min>5000000000</min>
|
|
<max>20000000000</max>
|
|
</max_memory_usage>
|
|
<force_index_by_date>
|
|
<readonly/>
|
|
</force_index_by_date>
|
|
</constraints>
|
|
</default>
|
|
</profiles>
|
|
```
|
|
|
|
The following queries all throw exceptions:
|
|
|
|
```sql
|
|
SET max_memory_usage=20000000001;
|
|
SET max_memory_usage=4999999999;
|
|
SET force_index_by_date=1;
|
|
```
|
|
|
|
```text
|
|
Code: 452, e.displayText() = DB::Exception: Setting max_memory_usage should not be greater than 20000000000.
|
|
Code: 452, e.displayText() = DB::Exception: Setting max_memory_usage should not be less than 5000000000.
|
|
Code: 452, e.displayText() = DB::Exception: Setting force_index_by_date should not be changed.
|
|
```
|
|
|
|
**Note:** the `default` profile has a special handling: all the constraints defined for the `default` profile become the default constraints, so they restrict all the users until they're overriden explicitly for these users.
|
|
|
|
[Original article](https://clickhouse.yandex/docs/en/operations/settings/constraints_on_settings/) <!--hide-->
|